Perfetto is an open-source suite of SDKs, daemons and tools which use tracing to help developers understand the behaviour of the complex systems and root-cause functional and performance issues on client / embedded systems.
If you are unfamiliar with tracing or, in general, are new to the world of performance, we suggest reading the What is Tracing? page first.
It consists of:
Perfetto was designed from the ground up to act as the default tracing system for the Android OS and the Chrome Browser. As such, Perfetto is the offficially supported for collecting, analysing and visualizing:
System traces on Android to debug and root-cause functional and performance issues in the Android platform and Android apps. Perfetto is suited for debugging e.g. slow startups, dropped frames (jank), animation glitches, low memory kills, App Not Responding (ANRs) and general buggy behaviour.
Java heap dumps and native heap profiles on Android to debug and root-cause high memory use in both Java/Kotlin code and C++ code respectively, in the Android platform and Android apps.
Callstack sampling profiles on Android to debug and root-cause high CPU usage by C++/Java/Kotlin code in the Android platform and Android apps.
Chrome browser traces to debug and root cause issues in the browser, V8, Blink and, in advanced usecases, in websites themselves.
Beyond these “official” usecases, Perfetto consists a highly flexible set of tools. This makes it capable of being used as a general purpose tracing system, a performance data analyzer or a timeline visualizer. The Perfetto team dedicates a porition of their time to supporting these cases, albeit at a reduced level of support.
Other usecases Perfetto is commonly used for include:
Collecting, analysing and visualizing in-app traces to debug functional and performance issues in C/C++ apps and libraries on Windows, macOS and Linux-based embedded systems.
Collecting, analysing and visualizing heap profiles on Linux to debug high memory usage of C/C++/Rust apps and libraries.
Analysing and visualizing CPU profiles (Linux perf profiles) on Linux to optmize CPU usage in C/C++/Rust apps and libraries.
Analysing and visualizing common profiling/tracing formats. Chrome JSON format, Firefox Profiler JSON format, Linux perf binary and text formats, Linux ftrace text format, macOS Instruments, Fuchsia tracing format etc. Even if the traces/profiles were not collected with Perfetto's recording tools, they can still be be visualized with the Perfetto UI and analyzed with our SQL-based query engine.
Analysing and visualizing arbitrary “trace-like” data. The Perfetto analysis and visualization tools can be used on any “trace-like” data as long as it can be converted to the Perfetto protobuf format; the possibilities are only limited by creativity!
There are several types of problems Perfetto is either not designed for or is explicltly unsupported.
Recording traces for distributed / server systems
Recording system traces on Windows or macOS
Consuming traces on the critical path
Recording traces with the lowest overhead possible
Recording, analysing or visualizing GPU traces for games
We appreicate that Perfetto has a lot of parts to it so it can be confusing to someone new to the project to know what is relevant to them. For this reason, we have a whole page dedicated to this: see How do I start using Perfetto?
Perfetto is the default tracing system for the Android operating system and the Chromium browser. As such, Perfetto is utilized extensively by these teams in Google, both to proactively identify performance improvements and reactively to debug/root-cause issues locally, in the lab and even from the field.
There are also many other teams in Google who use Perfetto in diverse ways. This includes including “non-traditional” uses of a tracing system. Perfetto has also been used and adopted widely in the wider industry by many other companies.
The following is a non-exhaustive list of public mentions of Perfetto in blog posts, articles and videos:
For our source code and project home: Github
For Q/A:
For bugs affecting any part of Perfetto except Chrome tracing:
For bugs affecting Chrome Tracing:
Component:Speed>Tracing label:Perfetto.For chatting directly with the Perfetto team:
Perfetto follows Google's Open Source Community Guidelines.