• Wang Nan's avatar
    perf tools: Enable config and setting names for legacy cache events · 43d0b978
    Wang Nan authored
    This patch allows setting config terms for legacy cache events.
    For example:
    
      # perf stat -e L1-icache-misses/name=valA/ -e branches/name=valB/ ls
      ...
       Performance counter stats for 'ls':
    
                  11299      valA
                 451605      valB
    
            0.000779091 seconds time elapsed
    
      # perf record -e cache-misses/name=inh/ -e cache-misses/name=noinh,no-inherit/ bash
      # ls
      # exit
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.023 MB perf.data (131 samples) ]
      # perf report --stdio | grep -B 1 'Event count'
      # Samples: 105  of event 'inh'
      # Event count (approx.): 109118
      --
      # Samples: 26  of event 'noinh'
      # Event count (approx.): 48302
    
    A test case is introduced to test this feature.
    Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
    Cc: Cody P Schafer <dev@codyps.com>
    Cc: He Kuang <hekuang@huawei.com>
    Cc: Jeremie Galarneau <jeremie.galarneau@efficios.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Kirill Smelkov <kirr@nexedi.com>
    Cc: Li Zefan <lizefan@huawei.com>
    Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Zefan Li <lizefan@huawei.com>
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1455882283-79592-14-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    43d0b978
parse-events.c 51.5 KB