]> git.baikalelectronics.ru Git - kernel.git/commit
perf stat: Only auto-merge events that are PMU aliases
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 31 Aug 2017 18:32:18 +0000 (15:32 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 1 Sep 2017 17:48:59 +0000 (14:48 -0300)
commitb1697a632dc25632bfc74c1067e12270603abee5
tree38c7f4f56f7de233a504c592b63b678d2a16b160
parent38c2f73264d40ad394d72b9b1fbf0ad6800a5b8e
perf stat: Only auto-merge events that are PMU aliases

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 a 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 the 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@infradead.org>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 799e6701091e ("perf stat: Collapse identically named events")
Link: http://lkml.kernel.org/r/20170831184122.GK4831@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-stat.c
tools/perf/util/evsel.h
tools/perf/util/parse-events.c