Perfetto是一个强大的性能分析工具,它可以帮助开发者深入了解Android系统的运行状况,从而优化性能。以下是设置Perfetto的步骤:
使用预置的perfetto执行程序:
adb shell perfetto -o /data/misc/perfetto-traces/trace_file.perfetto-trace -t 20s sched freq idle am wm gfx view binder_driver hal dalvik camera input res memory
使用record_android_trace脚本:
curl -o https://raw.githubusercontent.com/google/perfetto/master/tools/record_android_trace
chmod u+x record_android_trace
./record_android_trace -o trace_file.perfetto-trace -t 10s -b 64mb sched freq idle am wm gfx view binder_driver hal dalvik camera input res memory
通过以上步骤,您可以成功设置并使用Perfetto进行性能分析。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:android perfetto怎样操作