Skip to content

perf mem/c2c: Support AUX trace

Leo Yan linux-arm-kernel lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest9 patches 1 replyIn review
  2. v39 patches 9 repliesSuperseded
  3. v214 patches 5 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v1 posting 2/211 patches6 repliesSuperseded
v1 posting 1/29 of 11 patches0 repliesSuperseded

Changes in v4 from the cover letter

* Added back the patch 06/09 for introducing the itrace option '-M' (Jiri);
* Added 'itrace_synth_opts' for memory event (Jiri);
* Dropped type 'ldst' so don't change any usages for tools (Ian);
* Dropped the patch "perf mem: Return NULL for event 'ldst' on PowerPC" due type 'ldst' is not added anymore (Ian);
* Added patch 04/09 "perf c2c: Support memory event PERF_MEM_EVENTS__LOAD_STORE", so can convert the load/store requests to event PERF_MEM_EVENTS__LOAD_STORE (James Clark).

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9perf mem: Search event name with more flexible pathtools/perf/util/mem-events.c+3 -30 replies
2/9perf mem: Introduce weak function perf_mem_events__ptr()tools/perf/builtin-c2c.c tools/perf/builtin-mem.c tools/perf/util/mem-events.c +1 more+46 -210 replies
3/9perf mem: Support new memory event PERF_MEM_EVENTS__LOAD_STOREtools/perf/builtin-mem.c tools/perf/util/mem-events.c tools/perf/util/mem-events.h+31 -70 replies
4/9perf c2c: Support memory event PERF_MEM_EVENTS__LOAD_STOREtools/perf/builtin-c2c.c+13 -40 replies
5/9perf mem: Only initialize memory event for recordingtools/perf/builtin-mem.c+5 -50 replies
6/9perf auxtrace: Add itrace option '-M' for memory eventstools/perf/Documentation/itrace.txt tools/perf/util/auxtrace.c tools/perf/util/auxtrace.h+7 -00 replies
7/9perf mem: Support AUX tracetools/perf/builtin-mem.c+13 -00 replies
8/9perf c2c: Support AUX tracetools/perf/builtin-c2c.c+12 -00 replies
9/9perf mem: Support Arm SPE eventstools/perf/arch/arm64/util/Build tools/perf/arch/arm64/util/mem-events.c+38 -10 replies

Reviews trailers per patch

2 of 9 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJiri OlsaIan Rogers
SeriesA-b
1/9A-b
2/9
3/9
4/9
5/9A-b
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/9] perf mem/c2c: Support AUX trace

This patch series is v4 for support perf mem/c2c AUX trace.

Comparing to patch set v3, this patch set adds back the patch 06/09 for introducing the itrace option '-M', this allows to synthenize memory event from the AUX trace data.

Since perf mem/c2c tools are focus on memory profiling, this patch set makes itrace memory event as default for perf mem/c2c, the tool will tell AUX trace decoder that it is _ONLY_ interested in memory event rather than other itrace events. So patches 07, 08 have updated 'itrace_synth_opts' for this.

This patch has dropped the memory type 'ldst' and keeps to use the old types 'load' and 'store', if user passes the type 'load,store', the tool can automatically use PERF_MEM_EVENTS__LOAD_STORE event if arch supports it, otherwise, rolls back to enable both LOAD and STORE events. So we don't need to do any change for tool's usage.

This patch set has been applied clearly on the perf/core branch with the latest commit 7b3bcedf5ee5 ("perf scripting python: Avoid declaring function pointers with a visibility attribute").

This patch set has been verified on both x86 and Arm64.

On x86, below commands have been tested:

  # perf c2c record -- ~/false_sharing.exe 2
  # perf c2c record -e ldlat-loads  -- ~/false_sharing.exe 2
  # perf c2c record -e ldlat-stores  -- ~/false_sharing.exe 2
  # perf mem record -- ~/false_sharing.exe 2
  # perf mem record -t load -- ~/false_sharing.exe 2
  # perf mem record -t store -- ~/false_sharing.exe 2
  # perf mem record -t load,store -- ~/false_sharing.exe 2
  # perf mem record -e ldlat-loads  -- ~/false_sharing.exe 2
  # perf mem record -e ldlat-stores  -- ~/false_sharing.exe 2

On Arm64, below commands have been tested:

  # perf c2c record -- ~/false_sharing.exe 2
  # perf c2c record -e spe-load  -- ~/false_sharing.exe 2
  # perf c2c record -e spe-store  -- ~/false_sharing.exe 2
  # perf c2c record -e spe-ldst  -- ~/false_sharing.exe 2
  # perf mem record -- ~/false_sharing.exe 2
  # perf mem record -t load -- ~/false_sharing.exe 2
  # perf mem record -t store -- ~/false_sharing.exe 2
  # perf mem record -t load,store -- ~/false_sharing.exe 2
  # perf mem record -e spe-load  -- ~/false_sharing.exe 2
  # perf mem record -e spe-store  -- ~/false_sharing.exe 2
  # perf mem record -e spe-ldst  -- ~/false_sharing.exe 2

Changes from v3:
* Added back the patch 06/09 for introducing the itrace option '-M' (Jiri);
* Added 'itrace_synth_opts' for memory event (Jiri);
* Dropped type 'ldst' so don't change any usages for tools (Ian);
* Dropped the patch "perf mem: Return NULL for event 'ldst' on PowerPC" due type 'ldst' is not added anymore (Ian);
* Added patch 04/09 "perf c2c: Support memory event PERF_MEM_EVENTS__LOAD_STORE", so can convert the load/store requests to event PERF_MEM_EVENTS__LOAD_STORE (James Clark).

Leo Yan (9):
perf mem: Search event name with more flexible path perf mem: Introduce weak function perf_mem_events__ptr() perf mem: Support new memory event PERF_MEM_EVENTS__LOAD_STORE perf c2c: Support memory event PERF_MEM_EVENTS__LOAD_STORE perf mem: Only initialize memory event for recording perf auxtrace: Add itrace option '-M' for memory events perf mem: Support AUX trace
perf c2c: Support AUX trace
perf mem: Support Arm SPE events

 tools/perf/Documentation/itrace.txt     |  1 +
 tools/perf/arch/arm64/util/Build        |  2 +-
 tools/perf/arch/arm64/util/mem-events.c | 37 ++++++++++++++++
 tools/perf/builtin-c2c.c                | 39 ++++++++++++++---
 tools/perf/builtin-mem.c                | 56 +++++++++++++++++++------
 tools/perf/util/auxtrace.c              |  4 ++
 tools/perf/util/auxtrace.h              |  2 +
 tools/perf/util/mem-events.c            | 45 +++++++++++++++-----
 tools/perf/util/mem-events.h            |  3 +-
 9 files changed, 158 insertions(+), 31 deletions(-)
 create mode 100644 tools/perf/arch/arm64/util/mem-events.c
Signature · 1 line
2.17.1