本文转载自: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

最新文章

  1. PHP实现RTX发送消息提醒
  2. js基本类型和引用类型
  3. useradd与adduser的区别
  4. 在webstorm设置File watcher for Jade
  5. 《C与指针》第八章练习
  6. ShareDrop – 苹果 AirDrop 服务的 HTML5 实现
  7. vi 使用
  8. Linux 中的零拷贝技术,第 1 部分
  9. iOS 页面间传值 之 单例传值 , block 传值
  10. HDU4432 Sum of Divisors
  11. jvisualvm远程监控Tomcat
  12. android屏蔽home键的实现
  13. Lock锁子类了解一下
  14. wpf 命令
  15. [洛谷P4147] 玉蟾宫
  16. whatis命令,一个非常有用的命令
  17. Excel GET.CELL说明
  18. C# Web 数据注解Data Annotations、模型状态ModelState、数据验证
  19. linux系统编程:获取glibc的版本号
  20. BZOJ4254 : Aerial Tramway

热门文章

  1. wireshark分析https数据包解密前后的特点
  2. Django-admin数据库记录展示调整
  3. c# HashTable 类
  4. http通信示例Httpclient和HttpServer
  5. windows系统开机执行文件
  6. java基础(11)---模块(java9)
  7. 神经网络(9)--如何求参数: backpropagation algorithm(反向传播算法)
  8. 语法速学,返回数组 repeated修饰符
  9. 2019-2020-1 20199302《Linux内核原理与分析》第三周作业
  10. Diworth定理