Skip to main content

cu_trace

Macro cu_trace 

Source
macro_rules! cu_trace {
    ( $label:expr ) => { ... };
}
Expand description

Structured CU tracing macro for profiling.

When the cu-trace feature is enabled, emits both a compute-unit log and a label log, allowing off-chain tooling to reconstruct a CU flame graph from program logs.

When cu-trace is NOT enabled, this is a complete no-op with zero CU cost.

§Usage

cu_trace!("validate_accounts");
// ... validation code ...
cu_trace!("begin_cpi");