使用adb 命令(atrace)抓起systrace的方法。【转】
2024-09-23 18:50:15
本文转载自:https://www.cnblogs.com/liuliu-word/p/9963017.html
adb shell atrace -c -b 10240 --async_start -z gfx
1. 执行查看adb shell atrace 功能
atrace --h
atrace: invalid option -- h usage: atrace [options] [categories...]
options include:
-a appname enable app-level tracing for a comma separated list of cmdlines; * is a wildcard matching any process
-b N use a trace buffer size of N KB
-c trace into a circular buffer
-f filename use the categories written in a file as space-separated
values in a line
-k fname,... trace the listed kernel functions
-n ignore signals
-s N sleep for N seconds before tracing [default 0]
-t N trace for N seconds [default 5]
-z compress the trace dump
--async_start start circular trace and return immediately
--async_dump dump the current contents of circular trace buffer
--async_stop stop tracing and dump the current contents of circular
trace buffer
--stream stream trace to stdout as it enters the trace buffer
Note: this can take significant CPU time, and is best
used for measuring things that are not affected by
CPU performance, like pagecache usage.
--list_categories
list the available tracing categories
-o filename write the trace to the specified file instead
of stdout.
atrace --list_categories 列出连接设备可用的跟踪类别参数(后面分析会看到这些参数)。
atrace --list_categories
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
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
adb - ADB
vibrator - Vibrator
aidl - AIDL calls
pdx - PDX services
sched - CPU Scheduling
irq - IRQ Events
i2c - I2C 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
1.普通抓取方法
adb shell "atrace gfx -b 20480 -t 1 | grep xxx/xxx.SGameActivity"
2.指向文件输出使用
adb shell atrace -c -b 10240 --async_start -z gfx input view wm am sched load idle freq
adb shell atrace -c -b 10240 --async_stop -z gfx input view wm am sched load idle freq > d:/trace_raw 或者
adb shell "atrace gfx -b 20480 -t 1 | grep xxx/xxx.SGameActivity" > d:/trace_raw
3.不间断循环抓取
开始:
adb shell atrace -c -b 10240 --async_start gfx 执行循环输出
adb shell atrace -c -b 10240 --async_dump gfx 停止
adb shell atrace -c -b 10240 --async_stop
最新文章
- PHP实现RTX发送消息提醒
- js基本类型和引用类型
- useradd与adduser的区别
- 在webstorm设置File watcher for Jade
- 《C与指针》第八章练习
- ShareDrop – 苹果 AirDrop 服务的 HTML5 实现
- vi 使用
- Linux 中的零拷贝技术,第 1 部分
- iOS 页面间传值 之 单例传值 , block 传值
- HDU4432 Sum of Divisors
- jvisualvm远程监控Tomcat
- android屏蔽home键的实现
- Lock锁子类了解一下
- wpf 命令
- [洛谷P4147] 玉蟾宫
- whatis命令,一个非常有用的命令
- Excel GET.CELL说明
- C# Web 数据注解Data Annotations、模型状态ModelState、数据验证
- linux系统编程:获取glibc的版本号
- BZOJ4254 : Aerial Tramway