Skip to main content

start_tracing

Function start_tracing 

Source
pub fn start_tracing(path: &str) -> Result<(), TracingError>
Expand description

Start trace capture, writing Chrome JSON to path.

Installs a global tracing subscriber (chrome layer only) on first call. The trace file is created immediately. All tracing::trace_span! spans emitted by HAL crates will be recorded until stop_tracing is called.

Only one session per process lifetime is supported (a limitation of Rust’s global subscriber model).

§Errors

Returns TracingError::AlreadyActive if a session is currently capturing. Returns TracingError::SessionExhausted if a session was previously started and stopped (the global subscriber cannot be replaced). Returns TracingError::SubscriberInstallFailed if another tracing subscriber was installed by user code outside the HAL.