From: Maynard J. <may...@us...> - 2013-08-07 16:04:05
|
On 08/07/2013 09:53 AM, Andi Kleen wrote: > On Wed, Aug 07, 2013 at 07:37:00AM -0500, Maynard Johnson wrote: >> On 08/05/2013 09:41 AM, Carl E. Love wrote: >>> OProfile, fix the units for the reported CPU frequency. >>> >>> The freqency of the processor is found by function op_cpu_frequency() in >>> libutil/op_cpufreq.c by either checking for the frequency in the file >>> /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq or from /proc/cpuinfo. >>> >>> Most of the Intel processors get the frequency from cpuinfo_max_freq. The >>> frequency stored in this file is stored in units of KHz for the Intel >>> processors I can check. >> >> *Suravee, Will, Andi*, can you please check the /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq file on AMD, ARM, and Intel processors to validate Carl's assumption that the value is stored in units of KHz. Thanks. > > It's stored in Khz, but it's not necessarily the max frequency on Intel systems these days due to turbo. It would be better to report the average frequency for the measurement. This would need new interfaces unfortunately. > > Maybe it would be best to just drop the information for now. Thanks for the reply, Andi. If we dropped that info from the opreport output for Intel systems having turbo, we would need to version our opreport schema, since the current doc/opreport.xsd has the following attribute: <xs:attribute name="mhz" type="xs:decimal" use="required"/> We could change this to 'optional' versus 'required', but that change may break tools that currently use the oprofile XML output, requiring an update to such tools to recognize the new schema version. The srcdoc for op_cpu_frequency() says it returns "the estimated cpu frequency in Mhz", so I think this is probably OK as is. -Maynard > > -Andi > |