Commit b8ead30e authored by Len Brown's avatar Len Brown
Browse files

tools/power turbostat: Fix swidle header vs data display



I changed my mind about displaying swidle statistics,
which are "added counters".  Recently I reverted the
column headers to 8-columns, but kept print_decimal_value()
padding out to 16-columns for all 64-bit counters.

Simplify by keeping print_decimial_value() at %lld -- which
will often fit into 8-columns, and live with the fact
that it can overflow and shift the other columns,
which continue to tab-delimited.

This is a better compromise than inserting a bunch
of space characters that most users don't like.

Fixes: 1a23ba6a ("tools/power turbostat: Print wide names only for RAW 64-bit columns")
Reported-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 57d2371d
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -2852,10 +2852,9 @@ static inline int print_hex_value(int width, int *printed, char *delim, unsigned

static inline int print_decimal_value(int width, int *printed, char *delim, unsigned long long value)
{
	if (width <= 32)
		return (sprintf(outp, "%s%d", (*printed++ ? delim : ""), (unsigned int)value));
	else
		return (sprintf(outp, "%s%-8lld", (*printed++ ? delim : ""), value));
	UNUSED(width);

	return (sprintf(outp, "%s%lld", (*printed++ ? delim : ""), value));
}

static inline int print_float_value(int *printed, char *delim, double value)