autotest: Expose average cpu frequency in power_status.

Add an entry, wavg_cpufreq, to the test results to show average cpu
frequency during the test run.

For devices running intel_pstate driver, we calculate this value from
<sysfs>/devices/system/cpu/intel_pstate/aperf_mperf.
For all other cpufreq drivers, we calculate a weighted average based on
residency stats from time_in_state weighted on the time spent in each
frequency.

BUG=chromium:412066
TEST=Run power_LoadTest against rambi and verify valid percent_cpufreq_<freq>_time entries in results/keyval.
CQ-DEPEND=CL:217014

Change-Id: Id2b37a26f2449bb6e0fd2beb552976cae38b708a
Reviewed-on: https://chromium-review.googlesource.com/217015
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Anup Chenthamarakshan <anupc@chromium.org>
Tested-by: Anup Chenthamarakshan <anupc@chromium.org>
1 file changed