Skip to content

Commit 2ba8b24

Browse files
committed
tools/power turbostat: Print percentages in 8-columns
Added counters that are FORMAT_PERCENT do not need to be 64-bits -- 32 is plenty. This allows the output code to fit them, and their header, into 8-columns. Signed-off-by: Len Brown <len.brown@intel.com>
1 parent 8808292 commit 2ba8b24

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/power/x86/turbostat/turbostat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3482,7 +3482,7 @@ int format_counters(PER_THREAD_PARAMS)
34823482

34833483
/* Totl%C0, Any%C0 GFX%C0 CPUGFX% */
34843484
if (DO_BIC(BIC_Totl_c0))
3485-
outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), 100 * p->pkg_wtd_core_c0 / tsc); /* can exceed 100% */
3485+
outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), 100 * p->pkg_wtd_core_c0 / tsc); /* can exceed 100% */
34863486
if (DO_BIC(BIC_Any_c0))
34873487
outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), pct(p->pkg_any_core_c0 / tsc));
34883488
if (DO_BIC(BIC_GFX_c0))
@@ -10997,7 +10997,7 @@ void probe_cpuidle_residency(void)
1099710997
if (is_deferred_skip(name_buf))
1099810998
continue;
1099910999

11000-
add_counter(0, path, name_buf, 64, SCOPE_CPU, COUNTER_USEC, FORMAT_PERCENT, SYSFS_PERCPU, 0);
11000+
add_counter(0, path, name_buf, 32, SCOPE_CPU, COUNTER_USEC, FORMAT_PERCENT, SYSFS_PERCPU, 0);
1100111001

1100211002
if (state > max_state)
1100311003
max_state = state;

0 commit comments

Comments
 (0)