Technical review — 2026-10-13: This article was written in 2015. Its event-timeline concepts remain useful, while the Eclipse / Device Monitor entry points are obsolete. Historical script options below are checked against AOSP
android-5.0.0_r1. The added Perfetto commands target Android 11 / API 30 and later, with older-system differences noted separately. Continue with the Android Perfetto series catalog.
| Old workflow | Current counterpart |
|---|---|
| Systrace button in Eclipse / Device Monitor | On-device System Tracing from Android 9 / API 28, or capture through ADB |
systrace.py calls atrace and produces HTML |
Perfetto records a binary trace, with events selected by categories or a config file |
| Open the old HTML directly in a browser | Import the trace into Perfetto UI, or analyze it with Trace Processor SQL |
| Assume user builds cannot trace | User builds can record system traces; available data depends on the OS, data source, app configuration, and vendor policy |
This is the first article in the Android Performance Optimization Tools series. This series mainly introduces the tools used during the Android performance optimization process, how to use these tools to discover problems, and how to solve them. In terms of performance optimization, Android provides many performance tools for everyone to use. Following our consistent “discover problem - solve problem” thinking, discovering the problem is the most important part. Trying to solve a problem without first identifying it properly often leads to twice the effort for half the result.
In this article, we’ll start with a brief introduction to the Systrace tool.
Introduction to Systrace
Systrace arrived with Android 4.1 / SDK Tools R20 as a system-event tracing and visualization tool. It places enabled CPU scheduling, SurfaceFlinger, WindowManager, View, and other events on a shared timeline. It does not automatically sample every Java method or provide complete call stacks. See the original SDK Tools R20 announcement.
The historical workflow has three parts:
- Kernel events: These depend on enabled ftrace support and accessible kernel events. Scheduling, I/O, frequency, and other categories must be checked on the device.
- Userspace annotations and collection: System components emit ATrace markers, while
atraceconfigures categories and reads tracing data. Apps can add their own sections withandroid.os.Trace.beginSection()/endSection(); these public APIs were added in Android 4.3 / API 18, not Android 4.1. - Host-side reporting: The old
systrace.pyinvokes atrace over ADB, processes the data, and builds an HTML report with a viewer. Existing system events can be captured without changing app code; custom business-operation sections require instrumentation.
Perfetto supports additional data sources, so describing all of it as an ftrace wrapper would be incomplete. It still reads android.os.Trace markers. See the Trace API and Perfetto ATrace documentation.