device-drivers/ltp_acpi_cpufreq: measure time spent instead of cur_freq

Right now the test gives false results on kernels since v3.9. That's because
of the following commit:
acpi-cpufreq: set current frequency based on target P-State
8673b83bf2f013379453b4779047bf3c6ae387e4

So the sysfs 'cpuinfo_cur_freq' gives target frequency which is set by
acpi-cpufreq driver itself.

One possible way to find out that boost is actually off is to compare
time spent on CPU load function (simple sum calculation) with/without
boost feature. This is how is done in the patch.

Another way is to calculate CPU frequency by utilizing MSR APERF/MPERF
registers and TSC in Intel processors. That can be done by reading MSR from
/dev/cpu/0/msr. But this will require additional checks in configure of
asm/msr-index.h file and built-in non-portable __get_cpuid() function,
also reading TSC register using asm instructions. And who knows what else
for AMD silicons.

Let's not complicate things too much and use the first method.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
2 files changed