tracing-perfetto

Crates.iotracing-perfetto
lib.rstracing-perfetto
version0.1.5
created_at2024-07-01 08:12:59.294606+00
updated_at2025-01-02 09:27:26.993167+00
descriptionTracing layer for recording spans and events as perfetto event format.
homepage
repositoryhttps://github.com/csmoe/tracing-perfetto
max_upload_size
id1288544
size2,043,616
csmoe (csmoe)

documentation

README

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:

Upgrade perfetto_trace.proto

  1. Download the latest perfetto_trace.proto into protos/peffetto_trace.proto.

  2. Run upgrade.rs

    • Windows cargo +nightly -Zscript upgrade.rs
    • *nix ./upgrade.rs
  3. Create a pull request with the changes.

License

Licensed under the MIT license

Commit count: 34

cargo fmt