| Crates.io | tracing-profile-perfetto-sys |
| lib.rs | tracing-profile-perfetto-sys |
| version | 0.10.1 |
| created_at | 2024-09-16 20:41:17.735774+00 |
| updated_at | 2025-06-04 13:03:16.278963+00 |
| description | Low-level bindings to Perfetto, optionally used by the tracing-profile crate |
| homepage | |
| repository | https://github.com/IrreducibleOSS/tracing-profile |
| max_upload_size | |
| id | 1376876 |
| size | 9,481,183 |
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 the PerfettoGuard 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: