Skip to content

Perf tools: Support eGPRs/SSP/SIMD registers sampling

Dapeng Mi linux-perf-users lkml sashiko-reviews 13 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v11 Latest10 patches 8 repliesIn review
  2. v10 posting 3/323 patches 10 repliesApplied
  3. v10 posting 2/310 patches 11 repliesSuperseded
Earlier versions · 10
VersionPostedPatchesRepliesStatus
v10 posting 1/323 patches2 repliesSuperseded
v9 posting 2/210 patches4 repliesSuperseded
v9 posting 1/224 patches12 repliesSuperseded
v8 posting 2/25 patches11 repliesSuperseded
v8 posting 1/223 patches23 repliesSuperseded
v7 posting 2/24 patches5 repliesSuperseded
v7 posting 1/224 patches13 repliesSuperseded
v6 posting 2/24 patches7 repliesSuperseded
v6 posting 1/222 patches22 repliesSuperseded
v519 patches66 repliesSuperseded

Changes in v11 from the cover letter

- Patch 05/10: Change evsel__is_hardware_event() to evsel__is_non_software_event() to avoid the issue that cpu_atom type events (type = 10) are recognized to software events incorrectly.
- Patch 09/10: Refine APX/SSP registers sampling test with perf_record_with_retry() (Sashiko).
- Patch 10/10: Refine SIMD registers sampling test with perf_record_with_retry() (Sashiko).

Patches in v11 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10perf dwarf-regs: Fix DWARF register index bounds checktools/perf/util/dwarf-regs-arch/dwarf-regs-csky.c tools/perf/util/dwarf-regs-arch/dwarf-regs-powerpc.c tools/perf/util/dwarf-regs-arch/dwarf-regs-s390.c +1 more+5 -50 replies
2/10perf util: Add missed fields in _attr__fprintf() and __attr_swap()tools/perf/util/perf_event_attr_fprintf.c tools/perf/util/session.c+14 -00 replies
3/10tools headers: Sync x86 headers with kernel sourcestools/arch/x86/include/asm/msr-index.h+7 -01 reply
4/10perf headers: Sync perf_event.h/perf_regs.h with the kernel headerstools/arch/x86/include/uapi/asm/perf_regs.h tools/include/uapi/linux/perf_event.h tools/perf/util/header.c +2 more+117 -61 reply
5/10perf regs: Support x86 eGPRs/SSP samplingtools/perf/builtin-script.c tools/perf/util/evsel.c tools/perf/util/evsel.h +8 more+198 -450 replies
6/10perf regs: Support x86 SIMD registers samplingtools/perf/Documentation/perf-record.txt tools/perf/util/evsel.c tools/perf/util/parse-regs-options.c +3 more+596 -191 reply
7/10perf regs: Enable dumping of SIMD registerstools/perf/builtin-script.c tools/perf/util/evsel.c tools/perf/util/sample.h +3 more+387 -225 replies
8/10perf dwarf-regs: Add SIMD/eGPRs support for x86 DWARF registerstools/perf/util/dwarf-regs-arch/dwarf-regs-x86.c tools/perf/util/dwarf-regs.c tools/perf/util/include/dwarf-regs.h +1 more+132 -280 replies
9/10perf tests: Add x86 eGPRs/SSP registers sampling testtools/perf/tests/shell/record.sh+119 -00 replies
10/10perf tests: Add SIMD registers sampling testtools/perf/tests/shell/record.sh+138 -00 replies

Reviews trailers per patch

1 of 10 patches has a Reviewed-by or Acked-by.

PatchIan Rogers
1/10
2/10
3/10
4/10
5/10
6/10R-b
7/10
8/10
9/10
10/10

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

Read the v11 thread

Cover letter [Patch v11 00/10] Perf tools: Support eGPRs/SSP/SIMD registers sampling

Patch layout:
- Patches 1-2: Fix two bugs in DWARF register bounds checking and event attribute printing/swapping.
- Patches 3-4: Sync tools and perf headers with the kernel sources.
- Patches 5-8: Add SIMD/eGPR/SSP sampling and dump support.
- Patches 9-10: Add unit tests for SIMD/eGPR/SSP sampling.

Changes since v10:
- Patch 05/10: Change evsel__is_hardware_event() to evsel__is_non_software_event() to avoid the issue that cpu_atom type events (type = 10) are recognized to software events incorrectly.
- Patch 09/10: Refine APX/SSP registers sampling test with perf_record_with_retry() (Sashiko).
- Patch 10/10: Refine SIMD registers sampling test with perf_record_with_retry() (Sashiko).

Changes since v9:
- Patch 05/10: Fix the issue that cpu-clock/task-clock fails to sample GPRs.
- Patch 06/10: Ensure sample_intr_{pred|vec}_regs and sample_user_{pred|vec}_regs to keep identical if both are set since they share sample_{pred|vec}_reg_qwords.

Changes since v8:
- Patch 01/10: Fix incorrect DWARF register bounds checking.
- Patch 02/10: Add missing event attribute printing and swapping support (Sashiko).
- Patch 07/10: Remove dead code ([idx++]) in SIMD register dumping (Sashiko).
- Patch 08/10: Restore the original x86 libdw_frame_nregs value (17), as libdw still lacks x86 SIMD/eGPR support (Ian).
- Patch 09/10: Add x86 eGPR/SSP sampling unit tests (Ian).
- Patch 10/10: Add x86 SIMD register sampling unit tests (Ian).

Changes since v7:
- Address Sashiko's comments including,
* documents are not update availably; SIMD registers bitmask may be overwritten by shorter mask; u16 type in sample meta-data break the cross-endian conversion, etc.
- Add SIMD/eGPRs/SSP support in dwarf-regs (Ian).
- Misc enhancements.

Changes since v6:
- Address Ian's comments including,
* Add more comments for newly added register indexes (patch 1/4).
* Several minor enhancements in patch 4/4.
- Limit dwarf minimal regs to legacy GPRs (excluding APX eGPRs) (patch 2/4).

Changes since v5:
- Split the sampling support for eGPRs/SSP registers and SIMD registers into 2 patches.
- Address Ian's comments including,
* Convert the architecture dependent functions into regular architectural independent functions, like whatperf_reg_name() does.
* Refine the functions name to represent what the functions really do.
* Add comments for some key functions arguments.
* Misc enhancements.

This patch-set adds sampling support for x86 eGPRs/SSP/SIMD registers in perf tools base on the corresponding sampling support for eGPRs/SSP/SIMD registers in kernel[1]. In versions before v6, these perf-tools patches are integrated as a whole patch-set with the kernel patches, but it's split and posted to an independent perf-tools patch-set for convenient review.

History:
v10: https://lore.kernel.org/all/[email protected]/
v9: https://lore.kernel.org/all/[email protected]/
v8: https://lore.kernel.org/all/[email protected]/
v7: https://lore.kernel.org/all/[email protected]/
v6: https://lore.kernel.org/all/[email protected]/
v5: https://lore.kernel.org/all/[email protected]/
v4: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/lkml/[email protected]/
v2: https://lore.kernel.org/lkml/[email protected]/
v1: https://lore.kernel.org/lkml/[email protected]/

Ref:
[1] Kernel patches of supporting eGPRs/SSP/SIMD registers sampling:
https://lore.kernel.org/all/[email protected]/

Dapeng Mi (10):
perf dwarf-regs: Fix DWARF register index bounds check perf util: Add missed fields in _attr__fprintf() and __attr_swap() tools headers: Sync x86 headers with kernel sources
perf headers: Sync perf_event.h/perf_regs.h with the kernel headers perf regs: Support x86 eGPRs/SSP sampling
perf regs: Support x86 SIMD registers sampling
perf regs: Enable dumping of SIMD registers
perf dwarf-regs: Add SIMD/eGPRs support for x86 DWARF registers perf tests: Add x86 eGPRs/SSP registers sampling test perf tests: Add SIMD registers sampling test

 tools/arch/x86/include/asm/msr-index.h        |   7 +
 tools/arch/x86/include/uapi/asm/perf_regs.h   |  53 +++
 tools/include/uapi/linux/perf_event.h         |  49 +-
 tools/perf/Documentation/perf-record.txt      |  10 +-
 tools/perf/builtin-script.c                   |  93 +++-
 tools/perf/tests/shell/record.sh              | 257 +++++++++++
 .../util/dwarf-regs-arch/dwarf-regs-csky.c    |   2 +-
 .../util/dwarf-regs-arch/dwarf-regs-powerpc.c |   2 +-
 .../util/dwarf-regs-arch/dwarf-regs-s390.c    |   2 +-
 .../util/dwarf-regs-arch/dwarf-regs-x86.c     | 140 +++++-
 tools/perf/util/dwarf-regs.c                  |   9 +-
 tools/perf/util/evsel.c                       | 108 ++++-
 tools/perf/util/evsel.h                       |   7 +
 tools/perf/util/header.c                      |   3 +-
 tools/perf/util/include/dwarf-regs.h          |   7 +-
 tools/perf/util/parse-regs-options.c          | 210 ++++++++-
 .../perf/util/perf-regs-arch/perf_regs_x86.c  | 436 +++++++++++++++++-
 tools/perf/util/perf_event_attr_fprintf.c     |  13 +
 tools/perf/util/perf_regs.c                   |  84 +++-
 tools/perf/util/perf_regs.h                   |  21 +-
 tools/perf/util/record.h                      |   7 +
 tools/perf/util/sample.h                      |   5 +
 .../scripting-engines/trace-event-python.c    | 127 ++++-
 tools/perf/util/session.c                     | 112 ++++-
 tools/perf/util/synthetic-events.c            |  38 ++
 tools/perf/util/unwind-libdw.c                |   6 +-
 26 files changed, 1698 insertions(+), 110 deletions(-)
Signature · 1 line
2.34.1