Skip to content

Commit 14a3318

Browse files
gautshenshuahkh
authored andcommitted
pm: cpupower: Fix printing of CORE, CPU fields in cpupower-monitor
After the commit 0014f65 ("pm: cpupower: remove hard-coded topology depth values"), "cpupower monitor" output ceased to print the CORE and the CPU fields on a multi-socket platform. The reason for this is that the patch changed the behaviour to break out of the switch-case after printing the PKG details, while prior to the patch, the CORE and the CPU details would also get printed since the "if" condition check would pass for any level whose topology depth was lesser than that of a package. Fix this ensuring all the details below a desired topology depth are printed in the cpupower monitor output. Link: https://lore.kernel.org/r/20250612122355.19629-3-gautham.shenoy@amd.com Fixes: 0014f65 ("pm: cpupower: remove hard-coded topology depth values") Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent cda7ac8 commit 14a3318

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,8 @@ void print_header(int topology_depth)
121121
switch (topology_depth) {
122122
case TOPOLOGY_DEPTH_PKG:
123123
printf(" PKG|");
124-
break;
125124
case TOPOLOGY_DEPTH_CORE:
126125
printf("CORE|");
127-
break;
128126
case TOPOLOGY_DEPTH_CPU:
129127
printf(" CPU|");
130128
break;
@@ -167,10 +165,8 @@ void print_results(int topology_depth, int cpu)
167165
switch (topology_depth) {
168166
case TOPOLOGY_DEPTH_PKG:
169167
printf("%4d|", cpu_top.core_info[cpu].pkg);
170-
break;
171168
case TOPOLOGY_DEPTH_CORE:
172169
printf("%4d|", cpu_top.core_info[cpu].core);
173-
break;
174170
case TOPOLOGY_DEPTH_CPU:
175171
printf("%4d|", cpu_top.core_info[cpu].cpu);
176172
break;

0 commit comments

Comments
 (0)