当前位置: 首页 > news >正文

Android perfetto 工具使用

Android perfetto 工具简单使用

官方文档:https://developer.android.google.cn/tools/perfetto?hl=zh-cn

  1. perfetto 工具默认是关闭状态需要手动开启,可以从settings中开启或者写系统属性开启

adb shell setprop persist.traced.enable 1
  1. 开启后可查看服务是否启动:ps -A | grep traced

msm8953_64:/ # ps -A | grep traced
nobody       15225     1   52372   3024 poll_schedule_timeout 0 S traced
nobody       15226     1   52372   2904 poll_schedule_timeout 0 S traced_probes
msm8953_64:/ #
  1. 控制命令介绍

    控制命令解释备注
    –background | -d立即退出命令行界面,并继续在后台记录您的跟踪数据
    –config | -c自定义配置文件protobuf格式
    –out | -o保存的文件
    –dropbox TAGUpload trace into DropBox using tag TAG
    -t+time检测时长
    –no-guardrailsIgnore guardrails triggered when using --dropbox (for testing)
    –txtParse config as pbtxt. Not a stable API. Not for production use.
    –help | -h帮助
    –time | -tTrace duration N[s,m,h] (default: 10s)时长需要跟单位
    –buffer | -bRing buffer size N[mb,gb] (default: 32mb)
    –size | -sMax file size N[mb,gb] (default: in-memory ring-buffer only)
    ATRACE_CATRecord ATRACE_CAT (e.g. wm)
    FTRACE_GROUP/FTRACE_NAMERecord ftrace event (e.g. sched/sched_switch)
    FTRACE_GROUP/*Record all events in group (e.g. sched/*)
    –alert-idID of the alert that triggered this trace.
    –config-idID of the triggering config
    –subscription-idID of the subscription that triggered this trace
    –detach=keyDetach from the tracing session with the given key
    –attach=key [–stop]Re-attach to the session (optionally stop tracing once reattached)
    –is_detached=keyCheck if the session can be re-attached (0:Yes, 2:No, 1:Error)
  2. 常用模块介绍

    模块模块介绍
    sched跟踪CPU调度、上下文切换等内核事件‌
    freq记录CPU频率动态调整过程‌
    idle监控CPU进入/退出低功耗状态‌
    am追踪Activity启动、生命周期等应用管理事件‌
    wm记录窗口管理、Surface布局等图形层操作‌
    gfx分析UI渲染、VSync信号、GPU活动‌
    view跟踪View绘制、测量、布局流程‌
    binder_driver监控进程间通信的Binder调用‌
    hal记录Camera/Audio/Sensor等HAL层调用‌
    dalvik追踪ART/Dalvik的GC、JIT编译等事件‌
    camera分析相机开启、预览、拍照等流程耗时‌
    input记录触摸、按键等输入事件处理‌
    res跟踪内存/IO资源分配释放‌
    memory监控内存压力、OOM事件等‌

    如:perfetto -o /data/trace.perfetto-trace -t 10s sched freq idle am wm gfx view binder_driver hal dalvik camera input res memory

  3. 抓取指定的时候后会自动停止,将文件导出可在:https://ui.perfetto.dev/#!/record地址导入后查看

http://www.dtcms.com/a/291648.html

相关文章:

  • 【前端】ikun-pptx编辑器前瞻问题二: pptx的压缩包结构,以及xml正文树及对应元素介绍
  • 从重复劳动到自动化:火语言 RPA 的实践与思考
  • python办自动化--读取邮箱中特定的邮件,并下载特定的附件
  • 物联网_TDengine_EMQX_性能测试
  • RabbitMQ-交换机(Exchange)
  • 【无标题】buuctf-re3
  • 解决pip指令超时问题
  • MCU中的总线桥是什么?
  • Windows PE文件内未用空间学习
  • Collection接口的详细介绍以及底层原理——包括数据结构红黑树、二叉树等,从0到彻底掌握Collection只需这篇文章
  • wed前端简单解析
  • wangEditor5添加键盘事件/实现定时保存功能
  • 【文献笔记】ARS: Automatic Routing Solver with Large Language Models
  • SpringMVC快速入门之启动配置流程
  • C语言基础:函数练习题
  • 【洛谷】用两个数组实现静态单链表、静态双向链表,排队顺序
  • C#初学知识点总结
  • 假发行业数字化突围,外贸ERP重构外协管理引擎,助力效率飞跃
  • 智联智造:国内新能源汽车品牌AGV小车无线控制系统创新实践
  • 面试题:sql题一
  • 前端项目启动后,只有localhost地址,没有ip地址
  • vs2017 c++ 使用sqlite3数据库
  • Java 邂逅 WebSocket:解锁实时通信的无限可能​
  • Flutter基础(前端教程①⑦-Column竖直-Row水平-Warp包裹-Stack堆叠)
  • 【计算机网络 篇】TCP基本认识和TCP三次握手相关问题
  • ArKTS: DAL,Model,BLL,Interface,Factory using SQLite
  • docker-desktop启动失败
  • 【电影剖析】千钧一发
  • 从 “能用“ 到 “好用“:中小制造企业数字化转型中的 IT 系统优化管理策略
  • 【openbmc6】entity-manager