Having this feature would enable the Perfetto plugin to show CPU Sampling of both kernel & user-mode either at the system or process level. What is collected is dependent on the tracing config.
Users could easily see:
CPU Utilization % (dependent on scope of samples) (Note: CPU Util% via CPU Scheduling is already available)
Top callstacks sorted by top cpu %
Correlate cpu sampling with other data/tables, such as CPU Scheduling or other events
Perfetto trace format already seems to support collecting CPU Samples via PerfEventConfig callstack_sampling
PerfEventConfig
Configuration for the traced_perf profiler.
Example config for basic cpu profiling: perf_event_config { timebase { frequency: 80 } callstack_sampling { scope { target_cmdline: "surfaceflinger" target_cmdline: "system_server" } kernel_frames: true } }
In my testing, this did not seem to be supported on Android 11, but it did work on Android 12. This makes sense given the timestamps of the PerfEventConfig checkins.
I did verify that the data was present in the Android 12 trace and symbolic frame information was present via the trace processor CallStack Profilers tables
Having this feature would enable the Perfetto plugin to show CPU Sampling of both kernel & user-mode either at the system or process level. What is collected is dependent on the tracing config.
Users could easily see:
Perfetto trace format already seems to support collecting CPU Samples via PerfEventConfig callstack_sampling PerfEventConfig Configuration for the traced_perf profiler.
Example config for basic cpu profiling: perf_event_config { timebase { frequency: 80 } callstack_sampling { scope { target_cmdline: "surfaceflinger" target_cmdline: "system_server" } kernel_frames: true } }
Defined in perf_event_config.proto
In my testing, this did not seem to be supported on Android 11, but it did work on Android 12. This makes sense given the timestamps of the PerfEventConfig checkins.
I did verify that the data was present in the Android 12 trace and symbolic frame information was present via the trace processor CallStack Profilers tables