linux/tools/power
Chen Yu 87e15da957 tools/power turbostat: Introduce functions to accumulate RAPL consumption
Since the RAPL Joule Counter is 32 bit, turbostat would
only print a *star* instead of printing the actual energy
consumed to indicate the overflow due to long duration.
This does not meet the requirement from servers as the
sampling time of turbostat is usually very long on servers.

So maintain a set of MSR buffer, and update them
periodically before the 32bit MSR register is wrapped round,
so as to avoid the overflow.

The idea is similar to the implementation of ktime_get():

Periodical MSR timer:
total_rapl_sum += (current_rapl_msr - last_rapl_msr);

Using get_msr_sum() to get the accumulated RAPL:
return (current_rapl_msr - last_rapl_msr) + total_rapl_sum;

The accumulated RAPL mechanism will be turned on in next patch.

Originally-by: Aaron Lu <aaron.lwe@gmail.com>
Reviewed-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:57:47 -04:00
..
acpi ACPICA: acpidump: Removed dead code from oslinuxtbl.c 2020-06-05 13:34:23 +02:00
cpupower cpupower: Remove unneeded semicolon 2020-05-08 10:13:26 -06:00
pm-graph Misc cleanups in the SMP hotplug and cross-call code. 2020-06-01 13:38:55 -07:00
x86 tools/power turbostat: Introduce functions to accumulate RAPL consumption 2020-09-03 13:57:47 -04:00