# Perfetto trace config: GPU frequency, load, memory and frame jank on Android. # Works on production (user) builds through `adb shell perfetto`; no root needed. # # adb shell perfetto --txt -c - -o /data/misc/perfetto-traces/gpu.pftrace < gpu_jank.pbtx # adb pull /data/misc/perfetto-traces/gpu.pftrace # # Every event below was checked on an Android 16 user build (Adreno 840) as the # shell user. An event the kernel does not have (kgsl_* on Mali, mali_* on Adreno) # is skipped and only counted in stats.ftrace_setup_errors. # # Do not add `atrace_apps: "*"`: on that build it made most other events fail to # enable. Name your own package instead, e.g. atrace_apps: "com.example.game". buffers { size_kb: 65536 fill_policy: RING_BUFFER } buffers { size_kb: 4096 fill_policy: RING_BUFFER } data_sources { config { name: "linux.ftrace" target_buffer: 0 ftrace_config { # vendor-neutral; Android requires them on recent GPUs ftrace_events: "power/gpu_frequency" # every frequency change ftrace_events: "power/gpu_work_period" # GPU active ns per app uid, about once a second ftrace_events: "gpu_mem/gpu_mem_total" # GPU memory per process and in total # who runs and who waits ftrace_events: "sched/sched_switch" ftrace_events: "sched/sched_waking" # Qualcomm KGSL: readable by the shell user ftrace_events: "kgsl/kgsl_pwrstats" # busy_time / total_time per DCVS window (~8 ms) ftrace_events: "kgsl/kgsl_pwrlevel" # power level and frequency changes ftrace_events: "kgsl/kgsl_buslevel" # DDR vote with the GPU level # Arm Mali kbase (skipped on other GPUs) ftrace_events: "mali/mali_pm_status" ftrace_events: "mali/mali_page_fault_insert_pages" ftrace_events: "mali/mali_total_alloc_pages_change" # Root or userdebug only: per-batch submit / retire on Adreno. # On a user build they fail to enable; leave them commented there. # ftrace_events: "kgsl/adreno_cmdbatch_submitted" # ftrace_events: "kgsl/adreno_cmdbatch_retired" # ftrace_events: "kgsl/adreno_preempt_trigger" # ftrace_events: "kgsl/adreno_gpu_fault" atrace_categories: "gfx" atrace_categories: "view" atrace_categories: "input" atrace_categories: "am" atrace_categories: "wm" } } } data_sources { config { name: "linux.process_stats" target_buffer: 1 process_stats_config { scan_all_processes_on_start: true } } } data_sources { config { name: "android.packages_list" target_buffer: 1 } } data_sources { config { name: "android.surfaceflinger.frametimeline" target_buffer: 0 } } duration_ms: 15000