mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH V2 1/1] perf/x86: filter branches for PEBS event
@ 2015-03-27 14:38 kan.liang
  2015-04-02 18:36 ` [tip:perf/core] perf/x86/intel: Filter " tip-bot for Kan Liang
  0 siblings, 1 reply; 2+ messages in thread
From: kan.liang @ 2015-03-27 14:38 UTC (permalink / raw)
  To: a.p.zijlstra; +Cc: eranian, andi, linux-kernel, Kan Liang

From: Kan Liang <kan.liang@intel.com>

For supporting Intel LBR branches filtering, Intel LBR sharing logic
mechanism is introduced from commit b36817e88630 ("perf/x86: Add Intel
LBR sharing logic"). It modifies __intel_shared_reg_get_constraints to
config lbr_sel, which is finally used to set LBR_SELECT.
However, the intel_shared_regs_constraints is called after
intel_pebs_constraints. The PEBS event will return immediately after
intel_pebs_constraints. So it's impossible to filter branches for PEBS
event.

This patch move intel_shared_regs_constraints ahead of
intel_pebs_constraints.
We can safely do that because the intel_shared_regs_constraints only
returns emptyconstraint if its rejecting the event, otherwise it returns
NULL such that we continue calling intel_pebs_constraints and
x86_get_event_constraint.

Signed-off-by: Kan Liang <kan.liang@intel.com>
---

Changes since V1:
 - Move all shared regs ahead of intel_pebs_constraints
 - Modify the description and quote Peter's comments.

 arch/x86/kernel/cpu/perf_event_intel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index 9f1dd18..83bee99 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -1635,11 +1635,11 @@ intel_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event
 	if (c)
 		return c;
 
-	c = intel_pebs_constraints(event);
+	c = intel_shared_regs_constraints(cpuc, event);
 	if (c)
 		return c;
 
-	c = intel_shared_regs_constraints(cpuc, event);
+	c = intel_pebs_constraints(event);
 	if (c)
 		return c;
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-02 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-27 14:38 [PATCH V2 1/1] perf/x86: filter branches for PEBS event kan.liang
2015-04-02 18:36 ` [tip:perf/core] perf/x86/intel: Filter " tip-bot for Kan Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®