2 releases
0.1.1 | Jul 2, 2024 |
---|---|
0.1.0 | Jul 1, 2024 |
#595 in Debugging
340 downloads per month
180KB
430 lines
tracing-perfetto
Overview
tracing-perfetto is a Layer for tracing-subscriber that outputs traces in perfetto's trace packet format that can be viewed with ui.perfetto.dev.
Usage
Add this near the beginning of main
:
use tracing_perfetto::PerfettoLayer;
use tracing_subscriber::{registry::Registry, prelude::*};
let layer = PerfettoLayer::new(std::sync::Mutex::new(std::fs::File::create("/tmp/test.pftrace").unwrap()));
tracing_subscriber::registry().with(layer).init();
Open that file with ui.perfetto.dev:
License
Licensed under the MIT license
Dependencies
~2.7–9MB
~159K SLoC