2 unstable releases
0.9.0 | Dec 4, 2024 |
---|---|
0.7.0 | Sep 16, 2024 |
#8 in #perfetto
302 downloads per month
Used in tracing-profile
2.5MB
43K
SLoC
Perfetto-sys
This crate wraps the perfetto sdk. Use it as follows:
Create a PerfettoGuard
which will live for the duration of the tracing session via PerfettoGuard::new
. Two types of backend are supported:
BackendConfig::InProcess
will record only the trace data from the current process.BackendConfig::System
will also record system data. To do this kind of tracing the perfetto tools binaries must be available. Note that thePerfettoGuard
creation and dropping will take some additional time to launch and stop the perfetto processes. See the perfetto documentation for the details.
To create a span, create a TraceEvent
via TraceEvent::new
. The event will persist until the TraceEvent
is dropped. Using custom track event arguments, track id and flow id are supported.
To update a counter value use set_counter_u64
and set_counter_f64
methods.
Resources:
- Perfetto Trace configuration documentation
Dependencies
~2–10MB
~133K SLoC