Perfetto#
1. 使用 perfetto 抓取 trace#
adb shell setprop persist.traced.enable 1
使用 adb 命令抓取
通過 adb 把配置推送到手機:
adb push perfetto.pbtx /data/local/tmp/perfetto.pbtx
使用 adb 讓手機以指定配置抓取 Perfetto Trace:
adb shell 'cat /data/local/tmp/perfetto.pbtx | perfetto --txt -c - -o /data/misc/perfetto-traces/trace'
結束抓取:
adb shell 'perfetto --attach=perf_debug --stop'
相關文件見同級目錄
python3 perfetto.py -c perfetto.pbtx -o /data/misc/perfetto-traces/trace_file.perfetto-trace