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

simpleperf生成火焰图的步骤

1. simpleperf 命令抓取.data文件

adb shell simpleperf record --duration 30 -g -p 8734 --trace-offcpu --clockid monotonic -e cpu-clock -o /data/local/tmp/perf.data

C:\Users\fadi.su>adb shell simpleperf record --duration 30 -g -p 8734 --trace-offcpu --clockid monotonic -e cpu-clock -o /data/local/tmp/perf.datasimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libbase_utils.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libGEhp.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libc++_shared.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libmap.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libGPlatformInterface.so doesn't contain symbol tablesimpleperf W dso.cpp:434] failed to read symbols from [wlan]: File not foundsimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libGNet.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libGbl.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libGNaviDice.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /vendor/lib64/egl/libGLESv2_adreno.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /vendor/lib64/egl/eglSubDriverAndroid.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /vendor/lib64/libgsl.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libnav_data_engine.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libGSQuirrel.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libniocom3rd.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /system_ext/app/ANioNavigation/lib/arm64/libLaneNavBL.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /vendor/lib64/libadreno_utils.so doesn't contain symbol tablesimpleperf W dso.cpp:432] /vendor/lib64/egl/libEGL_adreno.so doesn't contain symbol tablesimpleperf I cmd_record.cpp:760] Samples recorded: 156127. Samples lost: 0.C:\Users\fadi.su>adb shell ls -al /data/local/tmp/perf.data-rw-rw-rw- 1 root root 47036305 2024-12-19 17:07 /data/local/tmp/perf.dataC:\Users\fadi.su>adb pull /data/local/tmp/perf.data C:\Users\fadi.su\Downloads\nio_map_5fps\simpleperf/data/local/tmp/perf.data: 1 file pulled, 0 skipped. 39.1 MB/s (47036305 bytes in 1.147s)

从手机端导出

adb pull /data/local/tmp/perf.data C:\Users\fadi.su\Downloads\nio_map_5fps\simpleperf

2.Simpleper report转化.data文件为html

AndroidStudio的NDK工具下载后,到SDK\ndk\25.1.8937393\simpleperf:找到report_html.py即可,python report_html.py -i perf.data​​​​​​​

D:\SwDownload\AndroidStudioSDK\ndk\25.1.8937393\simpleperf>python report_html.py -i C:\Users\fadi.su\Downloads\nio_map_5fps\simpleperf\perf.datapython.exe W 12-19 17:21:03 17820 28192 dso.cpp:450] failed to read symbols from [wlan]: File not foundpython.exe W 12-19 17:21:03 17820 28192 dso.cpp:450] failed to read symbols from /system_ext/app/ANioNavigation/lib/arm64/libGSQuirrel.so: File not found17:21:16,093 [INFO] (report_html.py:1036) Report generated at 'report.html'.

最近看trace日志,可以从上帝的视角对比出某个线程耗时多,但是想进一步看细节的话就有些费劲,于是使用simplepef抓了火焰图,但是发现没有竞品可以对比。看来还是需要使用AndroidStudio的profile查看该线程具体哪个函数耗时最多。但是没有该线程的源码,故只能转对于模块工程师看下了哈。


http://www.kler.cn/a/443318.html

相关文章:

  • Apache Traffic存在SQL注入漏洞(CVE-2024-45387)
  • 对快速由表及里说拜拜/如何正确运用由表及里
  • DuckDB:PRAGMA语句动态配置数据库行为
  • 用Python实现简单的任务自动化
  • 腾讯云AI代码助手编程挑战赛-凯撒密码解码编码器
  • 联邦学习中的LoRA:FedLoRA
  • Python如何正确解决reCaptcha验证码(9)
  • 揭开 Choerodon UI 拖拽功能的神秘面纱
  • 【容器】k8s学习笔记基础部分(三万字超详细)
  • pset4filter less: helpers.c
  • DHTMLX Scheduler 7.2全新发布:增强了重复事件的编辑、修改了实时更新等
  • 【Linux】HTTPS
  • day38-SSH安全登录
  • 安全地使用 Docker 和 Systemctl 部署 Kafka 的综合指南
  • 【机器人】Graspness 端到端抓取点估计 | 环境搭建 | 模型推理测试
  • 利用Java爬虫获取京东商品SKU信息
  • 敏捷多模态微型机器人:独特的被动变形轮设计
  • C# 基本信息介绍
  • Linux高性能服务器编程 | 读书笔记 | 12. 多线程编程
  • 环境变革下 B2B 销售的转型与创新:开源 AI 智能名片与 S2B2C 商城小程序的助力
  • uniapp 极速上手鸿蒙开发
  • 软件信息化平台项目投标技术方案中如何进行项目实施方案以及安全质量方案培训售后方案应急预案的编写?
  • 日常思考笔记
  • 如何处理对象的状态变化?
  • 公文写作一体机实现个性化写作与专属文风定制
  • Spring MVC 中,处理异常的 6种方式