Skip to content

Commit c808624

Browse files
Patryk Wlazlynlenb
authored andcommitted
tools/power turbostat: Honor --show CPU, even when even when num_cpus=1
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 <[email protected]> Signed-off-by: Len Brown <[email protected]>
1 parent fed8511 commit c808624

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8229,7 +8229,7 @@ void topology_probe(bool startup)
82298229
set_max_cpu_num();
82308230
topo.num_cpus = 0;
82318231
for_all_proc_cpus(count_cpus);
8232-
if (!summary_only && topo.num_cpus > 1)
8232+
if (!summary_only)
82338233
BIC_PRESENT(BIC_CPU);
82348234

82358235
if (debug > 1)
@@ -8367,7 +8367,7 @@ void topology_probe(bool startup)
83678367
topo.cores_per_node = max_core_id + 1;
83688368
if (debug > 1)
83698369
fprintf(outf, "max_core_id %d, sizing for %d cores per package\n", max_core_id, topo.cores_per_node);
8370-
if (!summary_only && topo.cores_per_node > 1)
8370+
if (!summary_only)
83718371
BIC_PRESENT(BIC_Core);
83728372

83738373
topo.num_die = topo.max_die_id + 1;

0 commit comments

Comments
 (0)