A: Introduction
Systrace is a set of tools introduced by Android4.1 for performance analysis.
Linux kernel-based ftrace mechanism (for tracking function calls to the Linux kernel),
You can output the current function call state of each thread.
It helps developers to collect key Android subsystems such as Surfaceflinger,
Windowmanagerservice and other Framework parts of the key modules, services)
Operational information to help developers analyze system bottlenecks more intuitively and improve performance
Two: Kernel configuration
Kernel hacking
---->tracers
Three: Init.rc configuration
Add Mount Debugfs none/sys/kernel/debug/
Four: Useenvironment: Android 4.3
ADB connection device (network/usb)
Cases:
CD External/chromium-trace//This is used in the Android source code in the Systrace, you can also use the SDK
Python systrace.py-b 32768-t gfx input view webview wm am \Audio Video camera Hal Res Dalvik sched freq Idle
-B:
Specifies the buf length of the trace
-T:
Specify the time, in seconds, of the record
GFX input View WebView, etc.:
specifies that the content to be logged is consistent with the k_categories array inside the frameworks/native/cmds/atrace/atrace.cpp
V: Results Result output to external/chromium-trace/trace.html
Open with Google Chrome
Attached: parameter description
Android Performance Test Systrace