Re: [PATCH 1/1] perf stat: Only auto-merge events that are PMU aliases

From: Peter Zijlstra
Date: Fri Sep 01 2017 - 07:20:32 EST


On Thu, Aug 31, 2017 at 03:41:22PM -0300, Arnaldo Carvalho de Melo wrote:
> Hi Andi, Jiri,
>
> Please check the patch below, would be glad to have your acks,
>
> - Arnaldo
>
> Peter reported that when he explicitely asked for multiple events with
> the same name on the command line it got coalesced into just one line,
> i.e.:
>
> # perf stat -e cycles -e cycles -e cycles usleep 1
>
> Performance counter stats for 'usleep 1':
>
> 3,269,652 cycles
>
> 0.000884123 seconds time elapsed
>
> #
>
> And while there is the --no-merges option to disable that auto-merging, this is
> an blunt change in behaviour for such explicit request, so change the code so
> that this auto merging is done only when handling the multi PMU aliases with
> the same name that introduced this coalescing, restoring the previous behaviour
> for explicit case:
>
> # perf stat -e cycles -e cycles -e cycles usleep 1
>
> Performance counter stats for 'usleep 1':
>
> 1,472,837 cycles
> 1,472,837 cycles
> 1,472,837 cycles
>
> 0.001764870 seconds time elapsed
>
> #
>
> Reported-by: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
> Cc: Wang Nan <wangnan0@xxxxxxxxxx>
> Fixes: 430daf2dc7af ("perf stat: Collapse identically named events")
> Link: http://lkml.kernel.org/n/tip-phjedddz2oe8udy9co3alo7d@xxxxxxxxxxxxxx
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

Thanks Arnaldo!