tools/power turbostat: harden against cpu hotplug
authorLen Brown <len.brown@intel.com>
Thu, 1 Oct 2020 00:58:15 +0000 (20:58 -0400)
committerLen Brown <len.brown@intel.com>
Fri, 23 Oct 2020 20:54:05 +0000 (16:54 -0400)
commit3d7772ea5602b88c7c7f0a50d512171a2eed6659
tree1f51c47ba019658cad7401d8037490a5a0c6d3a5
parent6ff7cb371c4bea3dba03a56d774da925e78a5087
tools/power turbostat: harden against cpu hotplug

turbostat tends to get confused when CPUs are added and removed
while it is running.

There are races, such as checking the current cpu, and then
reading a sysfs file that depends on that cpu number.

Close the two issues that seem to come up the most.
First, there is an infinite reset loop detector --
change that to allow more resets before giving up.
Secondly, one of those file reads didn't really need
to exit the program on failure...

Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c