perf tools: Enable config and setting names for legacy cache events
authorWang Nan <wangnan0@huawei.com>
Fri, 19 Feb 2016 11:44:01 +0000 (11:44 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 19 Feb 2016 22:12:51 +0000 (19:12 -0300)
commit43d0b97817a41b274aaec0476e912dae3ae1f93d
treef865dd5a4fce34a7ad911bdfb30ee91f80c859d9
parent10bf358a1b79fa1311eb05ee31f2cefdcad01741
perf tools: Enable config and setting names for legacy cache events

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: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo 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.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/parse-events.c
tools/perf/util/parse-events.c
tools/perf/util/parse-events.h
tools/perf/util/parse-events.y