From: Len Brown Date: Sat, 22 Sep 2018 02:26:57 +0000 (-0400) Subject: tools/power turbostat: reduce debug output X-Git-Tag: for-linus-20190104~131^2^4^2~2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=0ec712e36c1d5bafe6e65e53a19f136b778866cd;p=linux-2.6-block.git tools/power turbostat: reduce debug output A recent turbostat release increased topo.max_cpu_num to make it convenient to handle sysfs bitmaps of 32-cpus. But users, who regularly make use of "--debug", then saw a bunch of output for cpus that were not present. Remove that extra output by checking a cpu is online before dumping its info. Signed-off-by: Len Brown Cc: Prarit Bhargava --- diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 092853123ddb..772cf554b6d2 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -4887,6 +4887,8 @@ void topology_probe() return; for (i = 0; i <= topo.max_cpu_num; ++i) { + if (cpu_is_not_present(i)) + continue; fprintf(outf, "cpu %d pkg %d node %d lnode %d core %d thread %d\n", i, cpus[i].physical_package_id,