]> git.baikalelectronics.ru Git - kernel.git/commit
tools/power turbostat: work around RC6 counter wrap
authorLen Brown <len.brown@intel.com>
Wed, 6 Apr 2016 21:16:00 +0000 (17:16 -0400)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Apr 2016 20:18:40 +0000 (22:18 +0200)
commit06133ca21a144dd2d8ebd5773743a2d07449186c
tree8ee83e7750e2a51a63ccd2a6a4f41150af382d7b
parent2299af83eb9eb3ff202789d419a31728ab2a93bd
tools/power turbostat: work around RC6 counter wrap

Sometimes the rc6 sysfs counter spontaneously resets,
causing turbostat prints a very large number
as it tries to calcuate % = 100 * (old - new) / interval

When we see (old > new), print ***.**% instead
of a bogus huge number.

Note that this detection is not fool-proof, as the counter
could reset several times and still result in new > old.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
tools/power/x86/turbostat/turbostat.c