Re: [PATCH v4 2/4] perf stat: add event unit and scale support

From: Jiri Olsa
Date: Tue Nov 05 2013 - 09:01:27 EST

On Tue, Nov 05, 2013 at 02:34:45PM +0100, Stephane Eranian wrote:
> Hi,
> One thing I realized while testing is that we cannot simply add the
> unit printout like that.
> This may break all the scripts people may have written to parse the
> output of perf stat.

isn't it what the -x output is meant for?

perf stat -x, ...


> I think we need to make the display of the unit optional. If I do:
> $ perf stat -e cycles ls
> The output should remain as it was before and not show:
> $ perf stat -e cycles ls
> 22782847475 ? cycles

maybe we should display just space ' ' instead
of the '?' ...seems confusing

> So I think we need a --show-unit option. It would be off by default.
> Of course doing this causes a mess with the current code because
> of all the various printf() in builtin-stat.c but I think it is better for
> the end user.
> Any opinion?

I haven't checked by I think we changed the default perf stat
output in the past without any fuzz

maybe just keep the -x output or add the unit
to the end of the line

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at