Skip to contentSkip to conversation

perf, x86: Handle extended offcore mask on Haswell

PATCH In review Andi Kleen 1 participant 2 messages Jul 31, 2014

Subsystems (2)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 perf, x86: Handle extended offcore mask on Haswell

From: Andi Kleen <[email protected]>

HSW-EP has a larger offcore mask than the client Haswell CPUs. It is the same mask as on Sandy/IvyBridge-EP.

On the client parts some bits were also missing compared to Sandy/IvyBridge, in particular the bits to match on a L4 cache hit.

Specifying extra bits is ignored by the CPU.

So use the snbep extended mask, which is a superset of the client and the server, for all of Haswell.

This allows specifying a number of extra offcore events, like for example for HSW-EP.

% perf stat -e cpu/event=0xb7,umask=0x1,offcore_rsp=0x3fffc00100,name=offcore_response_pf_l3_rfo_l3_miss_any_response/ true

which were <not counted> before.

---
 arch/x86/kernel/cpu/perf_event_intel.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/perf_event_intel.c +4 -1
index 2502d0d..42cd9bc 100644
@@ -2552,7 +2552,10 @@ __init int intel_pmu_init(void)
 
 		x86_pmu.event_constraints = intel_hsw_event_constraints;
 		x86_pmu.pebs_constraints = intel_hsw_pebs_event_constraints;
-		x86_pmu.extra_regs = intel_snb_extra_regs;
+		if (boot_cpu_data.x86_model == 63)
+			x86_pmu.extra_regs = intel_snbep_extra_regs;
+		else
+			x86_pmu.extra_regs = intel_snb_extra_regs;
 		x86_pmu.pebs_aliases = intel_pebs_aliases_snb;
 		/* all extra regs are per-cpu when HT is on */
 		x86_pmu.er_flags |= ERF_HAS_RSP_1;
Signature · 1 line
1.9.3
author
#1 lore raw
Quoted 4 lines · Andi Kleen

From: Andi Kleen <[email protected]>

HSW-EP has a larger offcore mask than the client Haswell CPUs. It is the same mask as on Sandy/IvyBridge-EP.

Sorry I posted the wrong patch, not matching the description. Use the followon patch instead.

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only