CN

Android Systrace -- Series Article Index

Word count: 1.6kReading time: 9 min
2019/05/26
loading

Technical update — 2026-10-13: This page is dated 2019 and retains update records from earlier tutorials. The old Systrace tooling workflow is obsolete. Read historical screenshots, source code and experiments against the Android versions stated in each article; they do not describe every current implementation. Start with the Perfetto series below for current capture and analysis workflows.

As Systrace and Android changed, my earlier tutorials started to show their age. I had also learned to read more from a trace, which helped me solve performance problems. I wanted to write those things down and get better at explaining what I had learned. If the notes helped someone else too, all the better.

The purpose of this series is to view the overall operation of the Android system from a different perspective using Systrace, while also providing an alternative angle for learning the Framework. Perhaps you’ve read many articles about the Framework but can never remember the code, or you’re unclear about the execution flow. Maybe from Systrace’s graphical perspective, you can gain a deeper understanding.

Perfetto has essentially replaced Systrace in my daily work. Many newcomers to Android performance optimization find Perfetto’s busy interface and numerous features overwhelming. They have asked me to present the earlier Systrace articles using Perfetto. Android’s SDK Platform-Tools notes identify the old systrace tool as superseded. That does not mean ATrace instrumentation or kernel ftrace has been deprecated as well.

Read this index along two lines: the Systrace articles retain the Framework flows and case studies of their time; the Perfetto articles cover capture, viewing, search, SQL and large-trace analysis, alongside system mechanisms. Changing the viewer does not make the function names, thread relationships or timing in an old screenshot applicable to every newer system.

Getting Started Today: Tools and Versions

Entry point or capability Version and scope
Legacy systrace.py The historical workflow typically produces an HTML report. Do not assume a current Platform-Tools installation still contains the script at the old tutorial’s path.
System Tracing in Developer options Available from Android 9 / API 28. Android 9 saves Systrace format (.ctrace); Android 10 / API 29 and later save Perfetto format (.perfetto-trace).
On-device perfetto and tracing services Platform services exist from Android 9 and are enabled by default from Android 11 / API 30. Some Android 9 and 10 devices need an extra enabling step; check the official instructions and device support.
Perfetto UI and command-line analysis The UI can display Perfetto and supported legacy Systrace formats; trace_processor supports local SQL analysis. A filename extension does not guarantee complete data.
FrameTimeline Available from Android 12 / API 31, with its data source actually recorded. Opening an old trace in a new UI cannot add frame data that was never captured.

Version references: on-device System Tracing, Perfetto Android capture guide, and FrameTimeline. The current graphical recording tutorial assumes Android 11+; for older devices, use its command-line branch. See Recording system traces.

Start with Perfetto 1–3 and capture a short scenario, then follow the particular problem into MainThread, RenderThread, CPU or Binder analysis. Record the device, Android/ROM version, refresh rate, app version and trace configuration. Before naming a bottleneck, confirm that the relevant time range, threads and data sources are present. A missing track may reflect configuration, permissions, device support or lost data; it does not mean zero time was spent there.

App developers can start with the system’s capture tools. Experiments that modify Framework code, change Buffer configuration or enable privileged data sources require the appropriate system build and permissions. You do not need to modify the OS before learning to read a trace, and not every experiment from a platform development environment applies to a retail device.

Perfetto Series Index

  1. Android Perfetto Series Index
  2. Android Perfetto Series 1: Introduction to Perfetto
  3. Android Perfetto Series 2: Capturing Perfetto Traces
  4. Android Perfetto Series 3: Getting Familiar with Perfetto View
  5. Android Perfetto Series 4: Opening Large Traces Locally Using Command Line
  6. Android Perfetto Series 5: Android App Rendering Pipeline Based on Choreographer
  7. Android Perfetto Series 6: Why 120Hz? Advantages and Challenges of High Refresh Rate
  8. Android Perfetto Series 7 - MainThread and RenderThread Explained
  9. Android Perfetto Series 8: Deep Dive into Vsync Mechanism and Performance Analysis
  10. Android Perfetto Series 9 - CPU Information Explained
  11. Android Perfetto Series 10: Binder Scheduling and Lock Contention
  12. Android Perfetto Series 11: PerfettoSQL, Trace Processor and Regression Detection
  13. Android Perfetto Series 12: Trace Dataflow and Data Loss
  14. Android Perfetto Series 13: Perfetto SDK, Track Event and App Field Traces
  15. Android Perfetto Series 14: heapprofd and Memory Profiling
  16. Android Perfetto Series 15: Boot Traces and Long-running Field Tracing
  17. Android Perfetto Series 16: GPU, Power Counters and Hardware Bottlenecks
  18. Android Perfetto Series 17: Scenario Automation and Platform Tracing
  19. Android Perfetto Series 18: Input Response Latency
  20. Video (Bilibili) - Android Perfetto Basics and Case Studies
  21. Video (Bilibili) - Android Perfetto: Trace Graph Types - AOSP, WebView, Flutter + OEM System Optimization

Systrace Series Article Index

I’ll keep the series collected on this page as I add articles.

When migrating from the old Systrace series to the current Perfetto workflow, start with this mapping:

Systrace topic Matching Perfetto articles
Introduction, prerequisites, capture and opening Perfetto 1 / Perfetto 2 / Perfetto 3
Why 60 fps and high refresh rate Perfetto 6
Choreographer, MainThread, RenderThread, jank analysis Perfetto 5 / Perfetto 7
Vsync, SurfaceFlinger, Triple Buffer Perfetto 8
CPU and thread states Perfetto 9
Binder, lock contention, SystemServer waits Perfetto 10
Startup, responsiveness and input-to-first-frame latency Perfetto 18
  1. Systrace Introduction
  2. Systrace Basics - Systrace Prerequisites
  3. Systrace Basics - Why 60 fps?
  4. Systrace Basics - SystemServer Explained
  5. Systrace Basics - SurfaceFlinger Explained
  6. Systrace Basics - Input Explained
  7. Systrace Basics - Vsync Explained
  8. Systrace Basics - Vsync-App: Detailed Explanation of Choreographer-Based Rendering Mechanism
  9. Systrace Basics - MainThread and RenderThread Explained
  10. Systrace Basics - Binder and Lock Contention Explained
  11. Systrace Basics - Triple Buffer Explained
  12. Systrace Basics - CPU Info Explained
  13. Systrace Smoothness Practice 1: Understanding Jank Principles
  14. Systrace Smoothness Practice 2: Case Analysis - MIUI Launcher Scroll Jank Analysis
  15. Systrace Smoothness Practice 3: Questions During Jank Analysis
  16. Systrace Response Speed Practice 1: Understanding Response Speed Principles
  17. Systrace Response Speed Practice 2: Response Speed Analysis - Using App Startup as an Example
  18. Systrace Response Speed Practice 3: Extended Knowledge on Response Speed
  19. Systrace Thread CPU State Analysis Tips - Runnable
  20. Systrace Thread CPU State Analysis Tips - Running
  21. Systrace Thread CPU State Analysis Tips - Sleep and Uninterruptible Sleep

2023-10 update:

Starting to prepare the Perfetto series (historical progress; published articles are listed above)

Target Audience

This series of articles is suitable for both application developers and system developers. I will consider both perspectives when writing. As a system developer, here are roughly my advantages:

  1. Access to system source code, making it convenient to debug and modify code, and see results on the phone at any time
  2. Certain understanding of the system framework
  3. Certain understanding of system tuning

That background lets me cover a few things from the system developer’s side:

  1. Learning Android Framework through Systrace
  2. Modifying certain system configurations to show everyone the results: for example, the impact of Buffer count on applications
  3. Introducing considerations and trade-offs that system manufacturers make when building systems
  4. Introducing important but often overlooked points during application development

Update Log

The historical update records are retained below; their dates do not always match the dates in current article URLs.

The plan is to update one article per week, giving myself a goal and accountability.

  1. 2018-03-30 Index update: Systrace Series Article Index
  2. 2018-04-01 Article update: Systrace Basics - Why 60 fps?
  3. 2019-07-23 Article update: Systrace Basics - Systrace Prerequisites
  4. 2019-10-22 Article update: Systrace Basics - Vsync-App: Detailed Explanation of Choreographer-Based Rendering Mechanism
  5. 2019-11-04 Article update: Systrace Basics - Input Explained
  6. 2019-11-06 Article update: Systrace Basics - MainThread and RenderThread Explained
  7. 2019-12-01 Article update: Systrace Basics - Vsync Explained
  8. 2019-12-06 Article update: Systrace Basics - Binder and Lock Contention Explained
  9. 2019-12-15 Article update: Systrace Basics - Triple Buffer Explained
  10. 2019-12-21 Article update: Systrace Basics - CPU Info Explained
  11. 2020-02-04 Article update: Systrace Basics - SystemServer Explained
  12. 2020-02-14 Article update: Systrace Basics - SurfaceFlinger Explained
  13. 2021-04-24 Article update: Systrace Smoothness Practice 1: Understanding Jank Principles
  14. 2021-04-24 Article update: Systrace Smoothness Practice 2: Case Analysis - MIUI Launcher Scroll Jank Analysis
  15. 2021-04-24 Article update: Systrace Smoothness Practice 3: Questions During Jank Analysis
  16. 2021-10-28 Article update: Systrace Response Speed Practice 1: Understanding Response Speed Principles
  17. 2021-10-28 Article update: Systrace Response Speed Practice 2: Response Speed Analysis - Using App Startup as an Example
  18. 2021-10-28 Article update: Systrace Response Speed Practice 3: Extended Knowledge on Response Speed

About Me && Blog

Below is my personal introduction and related links. I look forward to exchanging ideas with fellow professionals. When three walk together, one can always be my teacher!

  1. Blogger Introduction: Contains my personal WeChat and WeChat group links.
  2. Blog Content Navigation: A navigation guide for my blog content.
  3. Curated Collection of Excellent Blog Articles - Android Performance Optimization Must-Knows: Welcome to recommend articles (via WeChat private message)
  4. Android Performance Optimization Knowledge Planet: The paid community stopped operating in 2026 and no longer accepts new members; this link preserves its history.

One person can walk faster, but a group can walk further

Scan WeChat QR Code

CATALOG
  1. 1. Getting Started Today: Tools and Versions
  • Perfetto Series Index
  • Systrace Series Article Index
    1. 1. Target Audience
    2. 2. Update Log
  • About Me && Blog