Perfetto is a platform for system-level performance tracing and analysis on Linux and Android. It combines a high-throughput trace recorder, a SQL-based query engine, and a browser-based visualizer into a single toolchain. The platform covers CPU scheduling and call-stack profiling, native and Java heap memory allocation tracking, GPU and graphics events, and system-wide counters such as CPU frequency and power consumption.
The architecture decouples trace recording from offline analysis, using a compact protobuf format for event encoding and columnar storage for efficient SQL queries. The web UI renders multi-gigabyte timelines in the browser without a backend server, using virtual scrolling and WebGL. Perfetto also provides an instrumentation SDK for emitting custom trace events from C++, Rust, or Java code, and includes a dedicated memory profiler that captures heap snapshots, allocation call stacks, and object graphs for leak detection.
Beyond core tracing, the toolset offers command-line automation for batch trace collection and non-interactive analysis, plus import and export for formats such as Chrome JSON, Firefox profiles, Android Systrace, pprof, and Fuchsia traces. The trace processor supports a PerfettoSQL dialect with module imports, macro definitions, and span-join operators for complex correlation queries. The UI includes timeline navigation with flow events, track pinning and filtering, flamegraph visualization, and a command palette for keyboard-driven workflows. The viewer can also be embedded in external web pages via iframes and programmatic cross-window messaging.
Documentation and prebuilt binaries are available for Android, Linux, macOS, and Windows, with SDK bindings for Python and Rust.