因为Systrace抓取的数据可能会比较多,所以Android为其设定了若干tag,可以在抓取的时候选择。
比如我这样指定:
python systrace.py --time=10 -o ~/working/trace001.html gfx input view webview wm am audio video camera
在Android 4.3之前,这些tag是固定的:
- gfx - Graphics
- input - Input
- view - View
- webview - WebView
- wm - Window Manager
- am - Activity Manager
- sync - Synchronization Manager
- audio - Audio
- video - Video
- camera - Camera
在Android 4.3之后的版本上,Android团队开始偷懒,不写文档了。。。让我们动态去获取。
我们可以通过systrace.py -l参数去获取,下面是我在Android 7.1上获取的列表:
python systrace.py -l
gfx - Graphics
input - Input
view - View System
webview - WebView
wm - Window Manager
am - Activity Manager
sm - Sync Manager
audio - Audio
video - Video
camera - Camera
hal - Hardware Modules
app - Application
res - Resource Loading
dalvik - Dalvik VM
rs - RenderScript
bionic - Bionic C Library
power - Power Management
pm - Package Manager
ss - System Server
database - Database
network - Network
sched - CPU Scheduling
irq - IRQ Events
freq - CPU Frequency
idle - CPU Idle
disk - Disk I/O
mmc - eMMC commands
load - CPU Load
sync - Synchronization
workq - Kernel Workqueues
memreclaim - Kernel Memory Reclaim
regulators - Voltage and Current Regulators
binder_driver - Binder Kernel driver
binder_lock - Binder global lock trace
pagecache - Page cache
有了这个列表之后,我们又可以继续愉快地抓取systrace信息了。
我们举个例子:
python systrace.py --time=10 -o ~/working/log/weibo-002.html gfx input view webview wm am audio video camera app ss sched irq freq idle disk load sync workq regulators
这样就可以抓到带更多信息的systrace了。
systrace
网友评论