performancecopilot/pcp

[RFE] broader platform support for hinv.cpu.clock metric

Closed this issue · 1 comments

@christianhorn noticed recently that non-x86_64 platform's /proc/cpuinfo file lacks the information that backs the popular clock rate metric. However, sysfs files below /sys/devices/system/cpu/cpuN/cpufreq/scaling_cur_freq do contain this information for other platforms - and we already have code reading these sysfs files for other metrics - it'd be good to use these as an alternate source for this metric.

Yes, that's from where we should take the data if not available from /proc/cpuinfo. On Asahi:

[chris@asahi pmcd]$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
912000
912000
912000
912000
702000
702000
702000
2208000
2208000
2208000

Seems like we already have refresh_sysfs_frequency_scaling() in src/pmdas/linux/proc_cpuinfo.c.