Crates.io | tracing-profile-perfetto-sys |
lib.rs | tracing-profile-perfetto-sys |
version | 0.9.0 |
source | src |
created_at | 2024-09-16 20:41:17.735774 |
updated_at | 2024-12-04 17:11:11.750826 |
description | Low-level bindings to Perfetto, optionally used by the tracing-profile crate |
homepage | |
repository | https://gitlab.com/IrreducibleOSS/tracing-profile |
max_upload_size | |
id | 1376876 |
size | 9,479,928 |
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: