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地址导入后查看

您可能感兴趣的与本文相关的镜像

ACE-Step

ACE-Step

音乐合成
ACE-Step

ACE-Step是由中国团队阶跃星辰(StepFun)与ACE Studio联手打造的开源音乐生成模型。 它拥有3.5B参数量,支持快速高质量生成、强可控性和易于拓展的特点。 最厉害的是,它可以生成多种语言的歌曲,包括但不限于中文、英文、日文等19种语言

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值