Skip to content

Arch-PEBS and PMU supports for Clearwater Forest and Panther Lake

Dapeng Mi linux-perf-users lkml 3 versions – Applied

Status from this message: The following commit has been merged into the perf/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest22 patches 24 repliesApplied
  2. v224 patches 33 repliesSuperseded
  3. v120 patches 26 repliesSuperseded

Changes in v3 from the cover letter

* Rebase patches to 6.15-rc1 code base.
* Refactor arch-PEBS buffer allocation/release code, decouple with legacy PEBS buffer allocation/release code.
* Support to capture SSP/XMM/YMM/ZMM registers for user space registers sampling (--user-regs options) with PEBS events.
* Fix incorrect sampling frequency issue in frequency sampling mode.
* Misc changes to address other v2 comments.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/22perf/x86/intel: Add Panther Lake supportarch/x86/events/intel/core.c+9 -20 replies
2/22perf/x86/intel: Add PMU support for Clearwater Forestarch/x86/events/intel/core.c+24 -00 replies
3/22perf/x86/intel: Parse CPUID archPerfmonExt leaves for non-hybrid CPUsarch/x86/events/intel/core.c+22 -90 replies
4/22perf/x86/intel: Decouple BTS initialization from PEBS initializationarch/x86/events/intel/bts.c arch/x86/events/intel/core.c arch/x86/events/intel/ds.c +1 more+9 -60 replies
5/22perf/x86/intel: Rename x86_pmu.pebs to x86_pmu.ds_pebsarch/x86/events/intel/core.c arch/x86/events/intel/ds.c arch/x86/events/perf_event.h+22 -180 replies
6/22perf/x86/intel: Introduce pairs of PEBS static callsarch/x86/events/core.c arch/x86/events/intel/core.c arch/x86/events/intel/ds.c +1 more+27 -40 replies
7/22perf/x86/intel: Initialize architectural PEBSarch/x86/events/core.c arch/x86/events/intel/core.c arch/x86/events/intel/ds.c +2 more+120 -310 replies
8/22perf/x86/intel/ds: Factor out PEBS record processing code to functionsarch/x86/events/intel/ds.c+55 -250 replies
9/22perf/x86/intel/ds: Factor out PEBS group processing code to functionsarch/x86/events/intel/ds.c+105 -670 replies
10/22perf/x86/intel: Process arch-PEBS records or record fragmentsarch/x86/events/intel/core.c arch/x86/events/intel/ds.c arch/x86/include/asm/msr-index.h +1 more+300 -12 replies
11/22perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSRarch/x86/events/intel/core.c arch/x86/events/intel/ds.c arch/x86/events/perf_event.h +1 more+66 -154 replies
12/22perf/x86/intel: Update dyn_constranit base on PEBS event precise levelarch/x86/events/intel/core.c arch/x86/events/intel/ds.c+10 -09 replies
13/22perf/x86/intel: Setup PEBS data configuration and enable legacy groupsarch/x86/events/intel/core.c arch/x86/events/intel/ds.c arch/x86/events/perf_event.h +2 more+171 -00 replies
14/22perf/x86/intel: Add counter group support for arch-PEBSarch/x86/events/intel/core.c arch/x86/events/intel/ds.c arch/x86/include/asm/msr-index.h +1 more+77 -90 replies
15/22perf/x86/intel: Support SSP register capturing for arch-PEBSarch/x86/events/core.c arch/x86/events/intel/core.c arch/x86/events/intel/ds.c +4 more+39 -42 replies
16/22perf/core: Support to capture higher width vector registersarch/arm/kernel/perf_regs.c arch/arm64/kernel/perf_regs.c arch/csky/kernel/perf_regs.c +12 more+304 -85 replies
17/22perf/x86/intel: Support arch-PEBS vector registers group capturingarch/x86/events/core.c arch/x86/events/intel/core.c arch/x86/events/intel/ds.c +2 more+214 -100 replies
18/22perf tools: Support to show SSP registertools/arch/x86/include/uapi/asm/perf_regs.h tools/perf/arch/x86/util/perf_regs.c tools/perf/util/intel-pt.c +1 more+11 -20 replies
19/22perf tools: Enhance arch__intr/user_reg_mask() helperstools/perf/arch/arm/util/perf_regs.c tools/perf/arch/arm64/util/perf_regs.c tools/perf/arch/csky/util/perf_regs.c +10 more+59 -540 replies
20/22perf tools: Enhance sample_regs_user/intr to capture more registerstools/include/uapi/linux/perf_event.h tools/perf/builtin-script.c tools/perf/util/evsel.c +6 more+116 -410 replies
21/22perf tools: Support to capture more vector registers (x86/Intel)tools/arch/x86/include/uapi/asm/perf_regs.h tools/perf/arch/x86/util/perf_regs.c tools/perf/util/perf-regs-arch/perf_regs_x86.c+285 -50 replies
22/22perf tools/tests: Add vector registers PEBS sampling testtools/perf/tests/shell/record.sh+55 -00 replies

Reviews trailers per patch

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

PatchIan Rogers
1/22
2/22
3/22
4/22
5/22
6/22
7/22
8/22
9/22
10/22
11/22
12/22
13/22
14/22
15/22
16/22
17/22
18/22R-b
19/22
20/22
21/22
22/22

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

Read the v3 thread

Cover letter [Patch v3 00/22] Arch-PEBS and PMU supports for Clearwater Forest and Panther Lake

This v3 patch serires is based on latest perf/core tree "5c3627b6f059
perf/x86/intel/bts: Replace offsetof() with struct_size()" plus extra 2
patches in patchset "perf/x86/intel: Don't clear perf metrics overflow
bit unconditionally"[1].

Changes:
v2 -> v3:
* Rebase patches to 6.15-rc1 code base.
* Refactor arch-PEBS buffer allocation/release code, decouple with legacy PEBS buffer allocation/release code.
* Support to capture SSP/XMM/YMM/ZMM registers for user space registers sampling (--user-regs options) with PEBS events.
* Fix incorrect sampling frequency issue in frequency sampling mode.
* Misc changes to address other v2 comments.

Tests:
Run below tests on Clearwater Forest and Pantherlake, no issue is found.

1. Basic perf counting case.
perf stat -e '{branches,branches,branches,branches,branches,branches,branches,branches,cycles,instructions,ref-cycles}' sleep 1

2. Basic PMI based perf sampling case.
perf record -e '{branches,branches,branches,branches,branches,branches,branches,branches,cycles,instructions,ref-cycles}' sleep 1

3. Basic PEBS based perf sampling case.
perf record -e '{branches,branches,branches,branches,branches,branches,branches,branches,cycles,instructions,ref-cycles}:p' sleep 1

4. PEBS sampling case with basic, GPRs, vector-registers and LBR groups

    perf record -e branches:p -Iax,bx,ip,ssp,xmm0,ymm0 -b -c 10000 sleep 1

5. User space PEBS sampling case with basic, GPRs, vector-registers and LBR groups

    perf record -e branches:pu --user-regs=ax,bx,ip,ssp,xmm0,ymm0 -b -c 10000 sleep 1

6 PEBS sampling case with auxiliary (memory info) group
perf mem record sleep 1

7. PEBS sampling case with counter group
perf record -e '{branches:p,branches,cycles}:S' -c 10000 sleep 1

8. Perf stat and record test
perf test 92; perf test 120

9. perf-fuzzer test

History:
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/

Ref:
[1]: https://lore.kernel.org/all/[email protected]/

Dapeng Mi (21):
perf/x86/intel: Add PMU support for Clearwater Forest perf/x86/intel: Parse CPUID archPerfmonExt leaves for non-hybrid CPUs perf/x86/intel: Decouple BTS initialization from PEBS initialization perf/x86/intel: Rename x86_pmu.pebs to x86_pmu.ds_pebs perf/x86/intel: Introduce pairs of PEBS static calls perf/x86/intel: Initialize architectural PEBS perf/x86/intel/ds: Factor out PEBS record processing code to functions perf/x86/intel/ds: Factor out PEBS group processing code to functions perf/x86/intel: Process arch-PEBS records or record fragments perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSR perf/x86/intel: Update dyn_constranit base on PEBS event precise level perf/x86/intel: Setup PEBS data configuration and enable legacy groups perf/x86/intel: Add counter group support for arch-PEBS perf/x86/intel: Support SSP register capturing for arch-PEBS perf/core: Support to capture higher width vector registers perf/x86/intel: Support arch-PEBS vector registers group capturing perf tools: Support to show SSP register
perf tools: Enhance arch__intr/user_reg_mask() helpers perf tools: Enhance sample_regs_user/intr to capture more registers perf tools: Support to capture more vector registers (x86/Intel) perf tools/tests: Add vector registers PEBS sampling test

Kan Liang (1):
perf/x86/intel: Add Panther Lake support

 arch/arm/kernel/perf_regs.c                   |   6 +
 arch/arm64/kernel/perf_regs.c                 |   6 +
 arch/csky/kernel/perf_regs.c                  |   5 +
 arch/loongarch/kernel/perf_regs.c             |   5 +
 arch/mips/kernel/perf_regs.c                  |   5 +
 arch/powerpc/perf/perf_regs.c                 |   5 +
 arch/riscv/kernel/perf_regs.c                 |   5 +
 arch/s390/kernel/perf_regs.c                  |   5 +
 arch/x86/events/core.c                        | 136 +++-
 arch/x86/events/intel/bts.c                   |   6 +-
 arch/x86/events/intel/core.c                  | 329 +++++++-
 arch/x86/events/intel/ds.c                    | 714 ++++++++++++++----
 arch/x86/events/perf_event.h                  |  60 +-
 arch/x86/include/asm/intel_ds.h               |  10 +-
 arch/x86/include/asm/msr-index.h              |  26 +
 arch/x86/include/asm/perf_event.h             | 145 +++-
 arch/x86/include/uapi/asm/perf_regs.h         |  83 +-
 arch/x86/kernel/perf_regs.c                   |  71 +-
 include/linux/perf_event.h                    |   4 +
 include/linux/perf_regs.h                     |  10 +
 include/uapi/linux/perf_event.h               |  11 +
 kernel/events/core.c                          |  98 ++-
 tools/arch/x86/include/uapi/asm/perf_regs.h   |  86 ++-
 tools/include/uapi/linux/perf_event.h         |  14 +
 tools/perf/arch/arm/util/perf_regs.c          |   8 +-
 tools/perf/arch/arm64/util/perf_regs.c        |  11 +-
 tools/perf/arch/csky/util/perf_regs.c         |   8 +-
 tools/perf/arch/loongarch/util/perf_regs.c    |   8 +-
 tools/perf/arch/mips/util/perf_regs.c         |   8 +-
 tools/perf/arch/powerpc/util/perf_regs.c      |  17 +-
 tools/perf/arch/riscv/util/perf_regs.c        |   8 +-
 tools/perf/arch/s390/util/perf_regs.c         |   8 +-
 tools/perf/arch/x86/util/perf_regs.c          | 138 +++-
 tools/perf/builtin-script.c                   |  23 +-
 tools/perf/tests/shell/record.sh              |  55 ++
 tools/perf/util/evsel.c                       |  36 +-
 tools/perf/util/intel-pt.c                    |   2 +-
 tools/perf/util/parse-regs-options.c          |  23 +-
 .../perf/util/perf-regs-arch/perf_regs_x86.c  |  84 +++
 tools/perf/util/perf_regs.c                   |   8 +-
 tools/perf/util/perf_regs.h                   |  20 +-
 tools/perf/util/record.h                      |   4 +-
 tools/perf/util/sample.h                      |   6 +-
 tools/perf/util/session.c                     |  29 +-
 tools/perf/util/synthetic-events.c            |  12 +-
 45 files changed, 2075 insertions(+), 286 deletions(-)

base-commit: 538f1f04b5bfeaff4cd681b2567a0fde2335be38

Signature · 1 line
2.40.1