System Graphics Driver Samsung là gì

Overview of system tracing

Recording device activity over a short period of time is known as system tracing. System tracing produces a trace file that can be used to generate a system report. This report helps you identify how best to improve your app or game's performance.

The Android platform provides several different options for capturing traces:

  • Android Studio CPU profiler
  • System tracing utility
  • Perfetto command-line tool (Android 10 and higher)
  • Systrace command-line tool

The Android Studio CPU profiler inspects your apps CPU usage and thread activity in real time while you interact with your app. You can also inspect the details in recorded method traces, function traces, and system traces.

The System tracing utility is an Android tool that saves device activity to a trace file. On a device running Android10 (API level 29) or later, trace files are saved in Perfetto format, shown later in this topic. On a device running an earlier version of Android, trace files are saved in the Systrace format.

Perfetto is the platform-wide tracing tool introduced in Android10. It is a sophisticated open-source tracing project for Android, Linux, and Chrome. It offers a superset of data sources compared to Systrace and allows you to record arbitrarily long traces in a protocol buffer binary stream. You can open these traces in the Perfetto UI.

Systrace is a legacy platform-provided command-line tool that records device activity over a short period of time in a compressed text file. The tool produces a report that combines data from the Android kernel, such as the CPU scheduler, disk activity, and app threads. Systrace works on all platform versions from Android 4.3 (API level 18) and higher, but Perfetto is recommended for devices running Android 10 and higher.

System Graphics Driver Samsung là gì

Figure 1. A sample Perfetto trace view, which shows about 20 seconds of interaction with an app

System Graphics Driver Samsung là gì

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

Both reports provide an overall picture of an Android device's system processes for a given period of time. The report also inspects the captured tracing information to highlight problems that it observes, such as UI jank or high power consumption.

Perfetto and Systrace are interoperable:

  • Open both Perfetto files and Systrace files in the Perfetto UI. Open Systrace files with the legacy Systrace viewer in the Perfetto UI (use the Open with legacy UI link).
  • Convert a Perfetto trace to the legacy Systrace text format using the traceconv tool.
Note: Systrace and Perfetto don't collect detailed information about code execution within your app process. For more detailed information about which methods your app is executing and how many CPU resources it's using, use the CPU profiler in Android Studio.

System tracing guides

To learn more about system tracing tools, see the following guides:

Inspect CPU activity with CPU Profiler Shows how to profile your apps CPU usage and thread activity in Android Studio. System Tracing system app Explains how to capture a system trace directly on any device running Android 9 (API level 28) or higher. Systrace command-line reference Defines the different options and flags that you can pass into the command-line interface for Systrace. Running Perfetto using ADB Describes how to run the perfetto command-line tool to capture traces. Running Perfetto External documentation that describes how to build and run the perfetto command-line tool to capture traces. Perfetto UI The Perfetto Web-based trace viewer opens Perfetto traces and displays a complete report. You can also open Systrace traces in this viewer using the legacy UI option. Navigate a Systrace report Lists the elements of a typical report, presents keyboard shortcuts for navigating through the report, and describes how to identify types of performance 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 or Perfetto.

Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2021-12-08 UTC.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]