官方文档:
https://perfetto.dev/docs/quickstart/android-tracing
一、
# Needed only on Android 9 (P) and 10 (Q) on non-Pixel phones.
adb shell setprop persist.traced.enable 1
二、下载external/perfetto/tools/record_android_trace
Using the tools/record_android_trace helper script.
三、抓日志
record_android_trace -o $(date +%Y%m%d_%H%M%S)_trace_file.perfetto-trace -t 5s -b 32mb sched freq idle am wm gfx view binder_driver hal dalvik camera input res memory gfx view wm am ss video camera hal res sync idle binder_driver binder_lock ss
抓取完毕后,会自动存储到当前目录的 $(date +%Y%m%d_%H%M%S)_trace_file.perfetto-trace
该文档介绍了如何在非Pixel手机上的Android9(P)和10(Q)系统上启用Perfetto性能追踪。通过ADB命令设置traced.enable为1,然后使用tools/record_android_trace脚本抓取系统日志,包括各种系统服务和硬件状态。日志文件会按日期时间自动命名并保存在当前目录。
1375

被折叠的 条评论
为什么被折叠?



