Cant find any data from android.dvfs and android.battery in moto g40 fusion(anddroid 12)
Hey, Almost a week ago, I opened this issue https://github.com/google/perfetto/issues/730 , and was told that all the tables will be present, but they might just be empty if there would be no data available from the trace. So i dug deeper on what exactly I wanted, and there are 2 notable things, first being android's dvfs counters and the second is the monitor contention table. I have multiple phones for testing, and one thing I noted is that these 2 tables were available when I was testing with a pixel7 running Android 14, but they were not in the moto g40 fusion running android 12. They both are running the same perfetto config which is
buffers: {
size_kb: 522240
fill_policy: DISCARD
}
buffers: {
size_kb: 2048
fill_policy: DISCARD
}
data_sources: {
config {
name: "android.packages_list"
target_buffer: 1
}
}
data_sources: {
config {
name: "android.gpu.memory"
}
}
data_sources: {
config {
name: "android.power"
android_power_config {
battery_poll_ms: 1000
battery_counters: BATTERY_COUNTER_CAPACITY_PERCENT
battery_counters: BATTERY_COUNTER_CHARGE
battery_counters: BATTERY_COUNTER_CURRENT
collect_power_rails: true
}
}
}
data_sources: {
config {
name: "linux.process_stats"
target_buffer: 1
process_stats_config {
scan_all_processes_on_start: true
proc_stats_poll_ms: 1000
}
}
}
data_sources: {
config {
name: "android.log"
android_log_config {
log_ids: LID_EVENTS
log_ids: LID_CRASH
log_ids: LID_KERNEL
log_ids: LID_DEFAULT
log_ids: LID_RADIO
log_ids: LID_SECURITY
log_ids: LID_STATS
log_ids: LID_SYSTEM
}
}
}
data_sources: {
config {
name: "android.surfaceflinger.frametimeline"
}
}
data_sources: {
config {
name: "linux.sys_stats"
sys_stats_config {
meminfo_period_ms: 1000
meminfo_counters: MEMINFO_ACTIVE
meminfo_counters: MEMINFO_ACTIVE_ANON
meminfo_counters: MEMINFO_ACTIVE_FILE
meminfo_counters: MEMINFO_ANON_PAGES
meminfo_counters: MEMINFO_BUFFERS
meminfo_counters: MEMINFO_CACHED
meminfo_counters: MEMINFO_CMA_FREE
meminfo_counters: MEMINFO_CMA_TOTAL
meminfo_counters: MEMINFO_COMMIT_LIMIT
meminfo_counters: MEMINFO_COMMITED_AS
meminfo_counters: MEMINFO_DIRTY
meminfo_counters: MEMINFO_INACTIVE
meminfo_counters: MEMINFO_INACTIVE_ANON
meminfo_counters: MEMINFO_INACTIVE_FILE
meminfo_counters: MEMINFO_KERNEL_STACK
meminfo_counters: MEMINFO_MAPPED
meminfo_counters: MEMINFO_MEM_AVAILABLE
meminfo_counters: MEMINFO_MEM_FREE
meminfo_counters: MEMINFO_MEM_TOTAL
meminfo_counters: MEMINFO_MLOCKED
meminfo_counters: MEMINFO_PAGE_TABLES
meminfo_counters: MEMINFO_SHMEM
meminfo_counters: MEMINFO_SLAB
meminfo_counters: MEMINFO_SLAB_RECLAIMABLE
meminfo_counters: MEMINFO_SLAB_UNRECLAIMABLE
meminfo_counters: MEMINFO_SWAP_CACHED
meminfo_counters: MEMINFO_SWAP_FREE
meminfo_counters: MEMINFO_SWAP_TOTAL
meminfo_counters: MEMINFO_UNEVICTABLE
meminfo_counters: MEMINFO_VMALLOC_CHUNK
meminfo_counters: MEMINFO_VMALLOC_TOTAL
meminfo_counters: MEMINFO_VMALLOC_USED
meminfo_counters: MEMINFO_WRITEBACK
stat_period_ms: 1000
stat_counters: STAT_CPU_TIMES
stat_counters: STAT_FORK_COUNT
}
}
}
data_sources: {
config {
name: "android.heapprofd"
target_buffer: 0
heapprofd_config {
sampling_interval_bytes: 4096
process_cmdline: "com.google.android.youtube"
continuous_dump_config {
dump_phase_ms: 1000
dump_interval_ms: 1000
}
shmem_size_bytes: 8388608
block_client: false
all_heaps: true
}
}
}
data_sources: {
config {
name: "android.java_hprof"
target_buffer: 0
java_hprof_config {
process_cmdline: "com.google.android.youtube"
continuous_dump_config {
dump_phase_ms: 0
dump_interval_ms: 1000
}
}
}
}
data_sources: {
config {
name: "linux.ftrace"
ftrace_config {
ftrace_events: "binder/*"
ftrace_events: "block/*"
ftrace_events: "clk/*"
ftrace_events: "ext4/*"
ftrace_events: "f2fs/*"
ftrace_events: "fastrpc/*"
ftrace_events: "i2c/*"
ftrace_events: "irq/*"
ftrace_events: "kmem/*"
ftrace_events: "memory_bus/*"
ftrace_events: "mmc/*"
ftrace_events: "oom/*"
ftrace_events: "power/*"
ftrace_events: "regulator/*"
ftrace_events: "sched/*"
ftrace_events: "sync/*"
ftrace_events: "task/*"
ftrace_events: "vmscan/*"
ftrace_events: "sched/sched_switch"
ftrace_events: "power/suspend_resume"
ftrace_events: "sched/sched_wakeup"
ftrace_events: "sched/sched_wakeup_new"
ftrace_events: "sched/sched_waking"
ftrace_events: "power/gpu_frequency"
ftrace_events: "gpu_mem/gpu_mem_total"
ftrace_events: "power/gpu_work_period"
ftrace_events: "regulator/regulator_set_voltage"
ftrace_events: "regulator/regulator_set_voltage_complete"
ftrace_events: "power/clock_enable"
ftrace_events: "power/clock_disable"
ftrace_events: "power/clock_set_rate"
ftrace_events: "mm_event/mm_event_record"
ftrace_events: "kmem/rss_stat"
ftrace_events: "ion/ion_stat"
ftrace_events: "dmabuf_heap/dma_heap_stat"
ftrace_events: "kmem/ion_heap_grow"
ftrace_events: "kmem/ion_heap_shrink"
ftrace_events: "sched/sched_process_exit"
ftrace_events: "sched/sched_process_free"
ftrace_events: "task/task_newtask"
ftrace_events: "task/task_rename"
ftrace_events: "lowmemorykiller/lowmemory_kill"
ftrace_events: "oom/oom_score_adj_update"
ftrace_events: "sched/sched_blocked_reason"
ftrace_events: "ftrace/print"
atrace_categories: "am"
atrace_categories: "adb"
atrace_categories: "aidl"
atrace_categories: "dalvik"
atrace_categories: "audio"
atrace_categories: "binder_lock"
atrace_categories: "binder_driver"
atrace_categories: "bionic"
atrace_categories: "camera"
atrace_categories: "database"
atrace_categories: "gfx"
atrace_categories: "hal"
atrace_categories: "input"
atrace_categories: "network"
atrace_categories: "nnapi"
atrace_categories: "pm"
atrace_categories: "power"
atrace_categories: "rs"
atrace_categories: "res"
atrace_categories: "rro"
atrace_categories: "sm"
atrace_categories: "ss"
atrace_categories: "vibrator"
atrace_categories: "video"
atrace_categories: "view"
atrace_categories: "webview"
atrace_categories: "wm"
atrace_apps: "*"
symbolize_ksyms: true
}
}
}
duration_ms: 60000
and the 2 traces can be found in Moto g40 Fusion and Pixel7
Thanks
The DVFS tables being unavailable does not surprise me as that's very closely tied to the hardware of the device. If the Moto device is using a different method for handling dvfs, that system might not be instrumented or might be instrumented in a different way meaning we don't have any insight into that system.
The monitor contention talbe being missing is a bit more surprising and likely because of something subtle which changed between Android 12 and more recent versions. I've forwarded to the author of that table to see if there's an easy fix.
https://r.android.com/3000578 adds support for monitor contention slices on old versions of Android. This should be available on the autopush UI and will make its way to other builds of trace processor/UI over the next several weeks.