DebugTracker

Struct DebugTracker 

Source
pub struct DebugTracker {
    pub operation: InterpreterEnergy,
    pub memory_alloc: InterpreterEnergy,
    pub host_call_trace: Vec<(usize, HostCall)>,
    pub emitted_events: Vec<(usize, EmittedDebugStatement)>,
    /* private fields */
}
Expand description

A type that implements DebugInfo and can be used for collecting execution information during execution.

Fields§

§operation: InterpreterEnergy

The amount of interpreter energy used by pure Wasm instruction execution.

§memory_alloc: InterpreterEnergy

The amount of interpreter energy charged due to additional memory allocation in Wasm linear memory.

§host_call_trace: Vec<(usize, HostCall)>

The list of host calls in the order they appeared. The first component is the event index which is shared between the host trace calls and the emitted_events field below so that it is possible to reconstruct one global order of events.

§emitted_events: Vec<(usize, EmittedDebugStatement)>

Events emitted by calls to debug_print host function. The first component is the event index shared with the host_call_trace value.

Implementations§

Source§

impl DebugTracker

Source

pub fn host_call_summary( &self, ) -> BTreeMap<HostFunctionV1, (usize, InterpreterEnergy)>

Summarize all the host calls, grouping them by the host function. The value at each host function is the pair of the number of times the host function was called, and the sum of interpreter energy those calls consumed.

Trait Implementations§

Source§

impl Debug for DebugTracker

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DebugInfo for DebugTracker

Source§

impl Default for DebugTracker

Source§

fn default() -> DebugTracker

Returns the “default value” for a type. Read more
Source§

impl Display for DebugTracker

The Display implementation renders all public fields of the type in multiple lines. The host calls and emitted events are interleaved so that they appear in the order that they occurred.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V