抓取trace文件
https://androidperformance.com/2024/05/21/Android-Perfetto-02-how-to-get-perfetto/
要勾選一下再導(dǎo)致配置文件

image.png
打開trace文件

image.png

image.png
即便是篩選也是可以抓取到的

image.png
主要的配置
data_sources {
config {
name: "linux.perf"
perf_event_config {
timebase {
frequency: 100
timestamp_clock: PERF_CLOCK_MONOTONIC
}
callstack_sampling {
scope {
target_cmdline: "這里替換成你的包名"
}
}
}
}
}
官方案例:
https://perfetto.dev/docs/case-studies/scheduling-blockages