• Arnaldo Carvalho de Melo's avatar
    perf stat: Only auto-merge events that are PMU aliases · 63ce8449
    Arnaldo Carvalho de Melo authored
    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: default avatarPeter Zijlstra <peterz@infradead.org>
    Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
    Acked-by: default avatarJiri 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: 430daf2d ("perf stat: Collapse identically named events")
    Link: http://lkml.kernel.org/r/20170831184122.GK4831@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    63ce8449
parse-events.c 60.4 KB