]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
tools/power turbostat: Honor --show CPU, even when even when num_cpus=1
authorPatryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Tue, 17 Sep 2024 20:33:26 +0000 (22:33 +0200)
committerLen Brown <len.brown@intel.com>
Sat, 30 Nov 2024 21:42:06 +0000 (16:42 -0500)
Honor --show CPU and --show Core when "topo.num_cpus == 1".
Previously turbostat assumed that on a 1-CPU system, these
columns should never appear.

Honoring these flags makes it easier for several programs
that parse turbostat output.

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

index b4386d54e65dc75cce96d01b1c1fa9b6425ef3c7..924f14e1ec35314d7e84f8b2b9ba2f85f7b230db 100644 (file)
@@ -8229,7 +8229,7 @@ void topology_probe(bool startup)
        set_max_cpu_num();
        topo.num_cpus = 0;
        for_all_proc_cpus(count_cpus);
-       if (!summary_only && topo.num_cpus > 1)
+       if (!summary_only)
                BIC_PRESENT(BIC_CPU);
 
        if (debug > 1)
@@ -8367,7 +8367,7 @@ void topology_probe(bool startup)
        topo.cores_per_node = max_core_id + 1;
        if (debug > 1)
                fprintf(outf, "max_core_id %d, sizing for %d cores per package\n", max_core_id, topo.cores_per_node);
-       if (!summary_only && topo.cores_per_node > 1)
+       if (!summary_only)
                BIC_PRESENT(BIC_Core);
 
        topo.num_die = topo.max_die_id + 1;