#tracing-subscriber #tracing #tracing-layer #subscriber #perfetto

tracing-perfetto

Tracing layer for recording spans and events as perfetto event format

2 releases

0.1.1 Jul 2, 2024
0.1.0 Jul 1, 2024

#435 in Profiling

Download history 314/week @ 2024-06-28 32/week @ 2024-07-05 35/week @ 2024-07-19 59/week @ 2024-07-26 136/week @ 2024-08-02 60/week @ 2024-08-09 52/week @ 2024-08-16 49/week @ 2024-08-23 266/week @ 2024-08-30 556/week @ 2024-09-06 459/week @ 2024-09-13 409/week @ 2024-09-20 456/week @ 2024-09-27 732/week @ 2024-10-04 530/week @ 2024-10-11

2,150 downloads per month
Used in sparkles

MIT license

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
~160K SLoC