Skip to content

RFC perf tools: Add non-architectural event aliases

Jiri Olsa lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest8 patches 8 repliesIn review
  2. v1 RFC3 patches 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8perf tools: Add '.' as part of the event 'name' tokentools/perf/util/parse-events.l+2 -28 replies
2/8perf tools: Change perf_pmu__new_alias function interfacetools/perf/util/pmu.c+13 -100 replies
3/8perf tools: Add name term processing for aliastools/perf/util/parse-events.c tools/perf/util/pmu.c tools/perf/util/pmu.h+40 -170 replies
4/8perf tools: Add pmu interface to parse single file of aliasestools/perf/util/pmu.c tools/perf/util/pmu.h+25 -00 replies
5/8perf tools: Add support to include non architectural event aliasestools/perf/arch/x86/Makefile tools/perf/arch/x86/util/pmu.c tools/perf/util/pmu.c +1 more+141 -50 replies
6/8perf tools: Add non arch events for SandyBridge microarchitecturetools/perf/arch/x86/Makefile tools/perf/arch/x86/events/intel/snb tools/perf/arch/x86/util/pmu.c+281 -10 replies
7/8perf tools: Add non arch events for IvyBridge micro architecturetools/perf/arch/x86/events/intel/ivb tools/perf/arch/x86/util/pmu.c+250 -00 replies
8/8perf tools: List kernel supplied event aliases in perf list v2tools/perf/Documentation/perf-list.txt tools/perf/builtin-list.c tools/perf/util/parse-events.c +2 more+73 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFCv2 0/8] perf tools: Add non-architectural event aliases

hi,
adding support to use non-architectural events in perf via name, to be able to use them like:

$ perf stat -e 'cpu/IDQ.ALL_DSB_CYCLES/' ...
$ perf stat -e 'cpu/L2_STORE_LOCK_RQSTS.MISS/' ...
...

The perf list command displays current non-arch. events available:

$ perf list
...
  cpu/AGU_BYPASS_CANCEL.COUNT/                       [Kernel PMU event]
  cpu/ARITH.FPU_DIV/                                 [Kernel PMU event]
  cpu/ARITH.FPU_DIV_ACTIVE/                          [Kernel PMU event]
  cpu/BACLEARS.ANY/                                  [Kernel PMU event]
...

This version is dependent on precise changes:
http://marc.info/?l=linux-kernel&m=135922143117888&w=2

First version of this RFC is here:
http://marc.info/?l=linux-kernel&m=135575146128720&w=2

This version provides support for non-architectural events aliasses being defined in sigle files, like for SandyBridge:

$ cat arch/x86/events/intel/snb | head -5
name=AGU_BYPASS_CANCEL.COUNT,event=0xb6,umask=0x1
name=ARITH.FPU_DIV_ACTIVE,event=0x14,umask=0x1
name=ARITH.FPU_DIV,event=0x14,umask=0x10401
name=BACLEARS.ANY,event=0xe6,umask=0x1f
...

So far this is still under testing and only SandyBridge and IvyBridge events were added. I have no problem to add the rest of the archs. when the shape of this is agreed.

Available also at:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/linux.git
perf/nonarch9

any comments are welcome,
jirka

---
Andi Kleen (1):
perf tools: List kernel supplied event aliases in perf list v2

Jiri Olsa (7):
perf tools: Add '.' as part of the event 'name' token perf tools: Change perf_pmu__new_alias function interface perf tools: Add name term processing for alias
perf tools: Add pmu interface to parse single file of aliases perf tools: Add support to include non architectural event aliases perf tools: Add non arch events for SandyBridge microarchitecture perf tools: Add non arch events for IvyBridge micro architecture

 tools/perf/Documentation/perf-list.txt |   4 +-
 tools/perf/arch/x86/Makefile           |  11 ++++
 tools/perf/arch/x86/events/intel/ivb   | 248 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/perf/arch/x86/events/intel/snb   | 274 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/perf/arch/x86/util/pmu.c         | 125 ++++++++++++++++++++++++++++++++++++++++++
 tools/perf/builtin-list.c              |   3 +
 tools/perf/util/parse-events.c         |  24 ++------
 tools/perf/util/parse-events.l         |   4 +-
 tools/perf/util/pmu.c                  | 158 ++++++++++++++++++++++++++++++++++++++++++++++++-----
 tools/perf/util/pmu.h                  |   9 +++
 10 files changed, 824 insertions(+), 36 deletions(-)