Crates.io | tracing-profile-perfetto-sys |
lib.rs | tracing-profile-perfetto-sys |
version | 0.7.0 |
source | src |
created_at | 2024-09-16 20:41:17.735774 |
updated_at | 2024-09-16 20:41:17.735774 |
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,475,043 |
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()
.
To create a span, create a TraceEvent
via TraceEvent::new(<event name>)
. The event will persist until the TraceEvent
is dropped.
The crate allows you to generate compile-time defined categories of events and counters by specifying the path to a JSON file in PERFETTO_INTERFACE_FILE
environment variable during the build. See InterfaceData
structure in build.rs
for reference.
data_sources {
config {
name: "track_event"
}
}
Note that the PerfettoGuard
currently causes the thread to block until it establishes a connection to the tracing service.
cd deb
dpkg --build perfetto
sudo dpkg -i perfetto
sudo dpkg -r perfetto
When using in-process mode, all the data will be written to a local file, path to which can be set by passing the argument to init_perfetto
function. If the value is null tracing.perfetto-trace
will be used as a default value. When system mode is chosen this argument is ignored.