https://github.com/csmoe/tracing-perfetto
A `tracing` crate layer that logs in Perfetto trace packet format.
https://github.com/csmoe/tracing-perfetto
Last synced: 3 months ago
JSON representation
A `tracing` crate layer that logs in Perfetto trace packet format.
- Host: GitHub
- URL: https://github.com/csmoe/tracing-perfetto
- Owner: csmoe
- License: mit
- Created: 2024-06-22T07:39:52.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-02-24T06:54:55.000Z (4 months ago)
- Last Synced: 2025-03-20T13:13:00.559Z (3 months ago)
- Language: Rust
- Homepage: https://docs.rs/tracing-perfetto
- Size: 446 KB
- Stars: 9
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
tracing-perfetto
======# Overview
tracing-perfetto is a Layer for [tracing-subscriber](https://crates.io/crates/tracing-subscriber) that outputs traces in perfetto's trace packet format that can be viewed with [ui.perfetto.dev](https://ui.perfetto.dev).
## Usage
Add this near the beginning of `main`:
```rust
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](https://ui.perfetto.dev):
## Upgrade `perfetto_trace.proto`
1. Download the latest [perfetto_trace.proto](https://github.com/google/perfetto/blob/main/protos/perfetto/trace/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](http://opensource.org/licenses/MIT)