This repo includes a small Rust helper, oy-profile, to summarize samply/Firefox
JSON profiles.
Build a release binary and record a profile:
cargo build -p oyo --release
samply record --save-only -o profile.json.gz -- ./target/release/oy --range HEAD...HEADNotes:
- Use a
.json.gzoutput name to keep files small. - If you need perf permissions on Linux:
sudo sysctl -w kernel.perf_event_paranoid=1Reset it when you are done:
sudo sysctl -w kernel.perf_event_paranoid=2Quick report (hot threads/paths/spots/modules):
cargo run -p oyo --bin oy-profile -- profile.json.gz --report --top 15Add --verbose to include the full ranked function table with --report.
By default the report includes idle samples (percent columns are total). To
exclude idle samples (poll/sleep/etc), pass --no-idle. Customize the idle
matcher with:
cargo run -p oyo --bin oy-profile -- profile.json.gz --report --no-idle
cargo run -p oyo --bin oy-profile -- profile.json.gz --report --idle-pattern "my_idle_fn"List threads:
cargo run -p oyo --bin oy-profile -- profile.json.gz --list-threadsPick a thread and mode (inclusive = hot paths, leaf = self time):
cargo run -p oyo --bin oy-profile -- profile.json.gz --thread 0 --mode inclusive
cargo run -p oyo --bin oy-profile -- profile.json.gz --thread oy --mode leaf --top 30By default the tool selects the hottest thread (based on the chosen metric) and prints a short thread summary. Control the metric and summary size with:
cargo run -p oyo --bin oy-profile -- profile.json.gz --metric weight
cargo run -p oyo --bin oy-profile -- profile.json.gz --metric time --top-threads 0Interpretation notes:
- CPU% is per-thread (threadCPUDelta / thread lifetime), not whole-system CPU.
- Short-lived threads can show near-100% CPU even with few samples.
- If
threadCPUDeltaor timing data is missing, CPU% is omitted.
For diff UI debug logs (extent markers, navigation, etc.), see docs/DEBUG.md.