tools/power turbostat: fix bugs in --add option
authorLen Brown <len.brown@intel.com>
Fri, 10 Feb 2017 03:22:13 +0000 (22:22 -0500)
committerLen Brown <len.brown@intel.com>
Sat, 25 Feb 2017 21:52:28 +0000 (16:52 -0500)
commit678a3bd1b3de6d2ebf604e7d708bc8150bb667e9
treece41087d430d02c5d681b73262f43720dd4fb58e
parentc470abd4fde40ea6a0846a2beab642a578c0b8cd
tools/power turbostat: fix bugs in --add option

When --add was used more than once, overflowed buffers
caused some counters to be stored on top of others,
corrupting the results.  Simplify the code by simply
reserving space for up to 16 added counters per each
cpu, core, package.

Per-cpu added counters were being printed only per-core.

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