Skip to content

Commit 03de874

Browse files
Andi KleenIngo Molnar
authored andcommitted
perf/x86: Fix :pp without LBR
This fixes a side effect of Kan's earlier patch to probe the LBRs at boot time. Normally when the LBRs are disabled cycles:pp is disabled too. So for example cycles:pp doesn't work. However this is not needed with PEBSv2 and later (Haswell) because it does not need LBRs to correct the IP-off-by-one. So add an extra check for PEBSv2 that also allows :pp Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] Cc: Arnaldo Carvalho de Melo <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent e708d7a commit 03de874

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/perf_event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ int x86_pmu_hw_config(struct perf_event *event)
387387
precise++;
388388

389389
/* Support for IP fixup */
390-
if (x86_pmu.lbr_nr)
390+
if (x86_pmu.lbr_nr || x86_pmu.intel_cap.pebs_format >= 2)
391391
precise++;
392392
}
393393

0 commit comments

Comments
 (0)