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: InterpreterEnergyThe amount of interpreter energy used by pure Wasm instruction execution.
memory_alloc: InterpreterEnergyThe 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
impl DebugTracker
Sourcepub fn host_call_summary(
&self,
) -> BTreeMap<HostFunctionV1, (usize, InterpreterEnergy)>
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
impl Debug for DebugTracker
Source§impl DebugInfo for DebugTracker
impl DebugInfo for DebugTracker
const ENABLE_DEBUG: bool = true
fn empty_trace() -> Self
fn trace_host_call(&mut self, f: ImportFunc, energy_used: InterpreterEnergy)
fn emit_debug_event(&mut self, event: EmittedDebugStatement)
Source§impl Default for DebugTracker
impl Default for DebugTracker
Source§fn default() -> DebugTracker
fn default() -> DebugTracker
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.
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.