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

使用adb 命令(atrace)抓起systrace的方法。【转】的更多相关文章

  1. 使用adb 命令(atrace)抓起systrace的方法。

    adb shell atrace -c -b --async_start -z gfx 1. 执行查看adb shell atrace 功能 atrace --h atrace: invalid op ...

  2. adb环境配置+常用adb命令+Logcat命令的用法+手动进行文件比对的方法+批量挪bug

    1. adb环境配置:下载adb环境变量包:打开计算机属性-高级系统设置-环境变量:新建变量adb,值为刚才的环境变量包路径:编辑path值,在最后面加上;%adb%;确定就妥了 2. 常用adb命令 ...

  3. 夜神模拟已开启,adb命令检测不了设备解决方法

    日常APP测试中,很难拥有多种机型和各种安卓版本的手机,此时可以借助模拟器. 命令返回结果只有 “List of devices attached”,即代表检测不了模拟器 最近在使用夜神模拟器的时候, ...

  4. Android ADB 命令链接模拟器出现 daemon not running 解决方法

    用adb命令链接远程模拟器 有时候会遇到如下问题: C:Documents and SettingsAdministrator>adb connect 192.168.0.183 * daemo ...

  5. 使用adb命令查看APP包名 和 包入口方法

    方法一: 1.查看 前台应用 包名,使用此命令注意:手机只启动要查看包名的app adb shell dumpsys activity | find "mFocusedActivity&qu ...

  6. python中使用adb命令的方法

    在python中使用adb命令,可以导入os模块. 1 简单的adb命令. 如:os.system('adb version') 2 稍微复杂的adb命令. 如:os.system('adb shel ...

  7. 分享一个常用Adb命令

    分享一个常用Adb命令 首先 首先感谢@xuxu的常用adb命令,收益良多,但是已经不能满足于我,所以补充了下. 再者 好久没发帖了,最近论坛老司机们都在讨论/总结,我就用这个干货回报吧. 最后 基于 ...

  8. Android的常用adb命令

    第一部分:1. ubuntu下配置环境anroid变量:在终端执行 sudo gedit /etc/profile 打开文本编辑器,在最后追加#setandroid environment2. 运行E ...

  9. 常用的adb命令

    在平时的工作中,会经常用到adb命令,在这里稍微整理了一下. 一.概要 1.什么是adb? adb全称为Android Debug Bridge,就是起到调试桥的作用.顾名思义,adb就是一个debu ...

随机推荐

  1. Jupyter Notebook环境安装

    Jupyter Notebook环境安装 一.什么是jupyter Notebook 1.简介 Jupyter Notebook 是基于网页的用于交互计算机的应用程序器可被应用程序. 能让用户将说明文 ...

  2. IDEA设置项目文件自动Add到Svn/Git

    1)配置自动Add 2)将未添加的文件添加到本地 3)取消已经添加的文件

  3. 微信小程序 时间戳 转化为 日期格式

    util.js  : function transTime(unixtime) { var dateTime = new Date(parseInt(unixtime) * 1000) var yea ...

  4. Flask之Flask_Session插件

    一,Flask_Session介绍 因为flask自带的session是将session存在cookie中: 所以才有了第三方Flask_session插件,可以将session存储在我们想存储的数据 ...

  5. 常用模块(collections模块,时间模块,random模块,os模块,sys模块,序列化模块,re模块,hashlib模块,configparser模块,logging模块)

    认识模块 什么是模块? 常见的场景:一个模块就是一个包含了python定义和声明的文件,文件名就是模块名字加上.py的后缀. 但其实import加载的模块分为四个通用类别: 1 使用python编写的 ...

  6. IDEA快速搭建WEB项目【记录篇】

    这里用的都是市面上通用的技术,而每个公司都有自己的调用方式,可以根据实际情况与业务场景不同去进行变通 三层架构: 界面层(User Interface layer).业务逻辑层(Business Lo ...

  7. 云计算第二阶段shell脚本

    pstree               #查看进程树 cat /etc/shells       #查看系统安装的所有shell解释器 yum -y install ksh             ...

  8. 科普文:Node.js 如何上传文件到后端服务【转】

    原文链接 https://www.yuque.com/egg/nodejs/httpclient-upload 背景 互联网时代,无数服务是基于 HTTP 协议进行通信的. 除了常见的 前端浏览器 - ...

  9. 在DEV c++ 中如何设置默认的代码模板

    /*菜单,工具=>编辑器选项(弹出对话框)=>代码(属性页)=>缺省源(属性页),写入一些代码确定即可(勾选“向项目初始源文件插入代码”).版本是5.11,中文版 */ #inclu ...

  10. 二维码内嵌LOGO

    package Test; import java.awt.BasicStroke; import java.awt.Graphics; import java.awt.Graphics2D; imp ...