cpufreq plugin: Limit reported value of percent to 100.1
authorPavel Rochnyack <pavel2000@ngs.ru>
Sat, 27 Oct 2018 17:02:22 +0000 (00:02 +0700)
committerPavel Rochnyack <pavel2000@ngs.ru>
Sat, 27 Oct 2018 17:04:09 +0000 (00:04 +0700)
commit92c3b2ed5f8e49737e29b11244585960a3478494
tree5ad9878ad9bcdf51fb64754e2d1e73537cdf6165
parent9c0380e4b76c86d90a331497c10de2f2f86188f9
cpufreq plugin: Limit reported value of percent to 100.1

cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state \
; sleep 10 ; cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
2664000 463368
1998000 59724070
2664000 463385
1998000 59725054

The sum of counters change is 1001, which produces reported value near
to 100.1%. I got calculated ds[0] = 100.100053 and such value produces gap on
charts.

Added limit to avoid such.
src/cpufreq.c