Perfetto: Swiss army knife for Linux client tracing
6 months ago
- #Tracing
- #Linux
- #Performance
- Perfetto is a suite of tools for Linux client and embedded tracing, useful for debugging performance issues.
- It includes recording tools, a trace processor for parsing and querying trace data, and a web-based UI for visualization.
- The Perfetto UI supports various trace formats, including perf.data, ftrace, and Chrome JSON, and operates entirely in the browser.
- Perfetto's development has moved to GitHub, making it more accessible for contributions.
- A demo Rust program was used to illustrate Perfetto's capabilities, showcasing a performance bug related to frame rate drops.
- Perf profiling and flame graphs were initially used but lacked time dimension visibility, leading to the use of Perfetto for deeper analysis.
- Perfetto's UI allows for interactive area selection and visualization of specific time regions, enhancing debugging efficiency.
- Scheduler traces were used to identify thread sleeping patterns, revealing serialization issues.
- Application-level tracing with Rust's `tracing` and `tracing-perfetto` crates provided insights into the adaptive quality update causing frame drops.
- Trace merging in Perfetto UI combines data from different sources (perf, ftrace, app traces) into a single timeline for comprehensive analysis.
- Perfetto's query interface and dynamic pivot tables enable powerful data filtering and correlation analysis.
- The talk highlighted various community projects using Perfetto, such as Mesa, VizTracer, and magic-trace.
- Resources for getting started with Perfetto include a demo repo, comprehensive documentation, and the Perfetto UI.