tracing-profile-perfetto-sys

Crates.iotracing-profile-perfetto-sys
lib.rstracing-profile-perfetto-sys
version0.7.0
sourcesrc
created_at2024-09-16 20:41:17.735774
updated_at2024-09-16 20:41:17.735774
descriptionLow-level bindings to Perfetto, optionally used by the tracing-profile crate
homepage
repositoryhttps://gitlab.com/IrreducibleOSS/tracing-profile
max_upload_size
id1376876
size9,475,043
Jim Posen (jimpo-ulvt)

documentation

README

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().
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.

Building the deb package

cd deb
dpkg --build perfetto
sudo dpkg -i perfetto
sudo dpkg -r perfetto

In process mode

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.

Commit count: 10

cargo fmt