Overview of Systrace

Systrace is a platform-provided tool that records device activity over ashort period of time. The tool produces a report that combines data from theAndroid kernel, such as the CPU scheduler, disk activity, and app threads. Thereport helps you identify how best to improve your app or game's performance.

A sample Systrace report appears in Figure 1:

Screen capture of Systracereport


Figure 1. A sample Systrace HTML report, which shows 5 seconds of interaction with an app

This report provides an overall picture of an Android device's system processesfor a given period of time. The report also inspects the captured tracinginformation to highlight problems that it observes, such as UI jank or highpower consumption.

Note: The Systrace tool doesn't collect information about code execution withinyour app process. For more detailed information about which methods your app isexecuting and how many CPU resources it's using, use the CPUprofiler in Android Studio. You can alsogenerate trace logs andimport and inspect them using the CPU Profiler.

Systrace guides

To learn more about the Systrace tool, see the following guides:

  • Command-line reference
  • Defines the different options and flags that you can pass into thecommand-line interface for Systrace.
  • System Tracing system app
  • Explains how to capture a system trace directly on any device running Android9 (API level 28) or higher.
  • Navigate a Systrace report
  • Lists the elements of a typical report, presents keyboard shortcuts fornavigating through the report, and describes how to identify types ofperformance problems.
  • Define custom events
  • Describes how you can apply custom labels to specific sections of your code,allowing for easier root-cause analysis in Systrace.