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

tracing-perfetto

Tracing layer for recording spans and events as perfetto event format

3 releases

0.1.2 Nov 4, 2024
0.1.1 Jul 2, 2024
0.1.0 Jul 1, 2024

#424 in Profiling

Download history 114/week @ 2024-08-03 62/week @ 2024-08-10 48/week @ 2024-08-17 50/week @ 2024-08-24 326/week @ 2024-08-31 604/week @ 2024-09-07 387/week @ 2024-09-14 450/week @ 2024-09-21 439/week @ 2024-09-28 785/week @ 2024-10-05 547/week @ 2024-10-12 648/week @ 2024-10-19 533/week @ 2024-10-26 752/week @ 2024-11-02 596/week @ 2024-11-09 511/week @ 2024-11-16

2,472 downloads per month
Used in sparkles

MIT license

180KB
406 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
~162K SLoC