Skip to content

perf: enforce exclusive PMU access for SNB INST_RETIRED:PREC_DIST

Stephane Eranian lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 7 repliesIn review
  2. v12 patches 19 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2perf tools: add event modifier to request exclusive PMU accesstools/perf/util/parse-events.c tools/perf/util/parse-events.l+8 -17 replies
2/2perf: enforce SNB exclusive access for INST_RETIRED:PREC_DISTarch/x86/kernel/cpu/perf_event.h arch/x86/kernel/cpu/perf_event_intel.c+26 -60 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/2] perf: enforce exclusive PMU access for SNB INST_RETIRED:PREC_DIST

From: Stephane Eranian <[email protected]>

The following patch set enforces exclusive PMU access for Intel SandyBridge INST_REITRED:PREC_DIST event when used with PEBS as described in the SDM Vol 3b. Without this, the sample distribution may not be correct.

The kernel now rejects PEBS + INST_RETIRED:PREC_DIST on SNB if attr->exclusive is not set. One reason to do it this way is to make sure users understands the restriction. If the kernel were to force exclusive on the fly, users would have cases where they would get no samples and no error messages to understand why.

The first patch extends perf to allow users to request exclusive PMU access by introducing a new modifier: x. For instance:

  $ perf record -e r01c0:ppx .....
or
  $ perf record -e cpu/event=0xc0,umask=0x1/ppx ....

In V2, we fixed the pr_info() issue. We know use pr_warn_once(). Also fixed the max repeat factor for the event modifier in the event parser.

Stephane Eranian (2):
perf tools: add event modifier to request exclusive PMU access
perf: enforce SNB exclusive access for INST_RETIRED:PREC_DIST

 arch/x86/kernel/cpu/perf_event.h       |    2 +-
 arch/x86/kernel/cpu/perf_event_intel.c |   30 +++++++++++++++++++++++++-----
 tools/perf/util/parse-events.c         |    7 +++++++
 tools/perf/util/parse-events.l         |    2 +-
 4 files changed, 34 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.9.5