tools/power turbostat: reduce debug output
authorLen Brown <len.brown@intel.com>
Sat, 22 Sep 2018 02:26:57 +0000 (22:26 -0400)
committerLen Brown <len.brown@intel.com>
Fri, 2 Nov 2018 18:06:31 +0000 (14:06 -0400)
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 <len.brown@intel.com>
Cc: Prarit Bhargava <prarit@redhat.com>
tools/power/x86/turbostat/turbostat.c

index 092853123ddb46215d642a3bb352d7d6fac87a6f..772cf554b6d2e319e5b897778adaebb4d98db72e 100644 (file)
@@ -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,