]> git.baikalelectronics.ru Git - kernel.git/commit
perf/x86/intel: Filter branches for PEBS event
authorKan Liang <kan.liang@intel.com>
Fri, 27 Mar 2015 14:38:25 +0000 (10:38 -0400)
committerIngo Molnar <mingo@kernel.org>
Thu, 2 Apr 2015 15:07:42 +0000 (17:07 +0200)
commitabc2bda355185e3bcea4c180e356fdfd996ee1c9
treeaea26f03b46302b2233fc037696bbef8680916cf
parenta3296cc3fe121ed08bf7bc320cc777bd8dc8009c
perf/x86/intel: Filter branches for PEBS event

For supporting Intel LBR branches filtering, Intel LBR sharing logic
mechanism is introduced from commit 8484a3930da9 ("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() function 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
events.

This patch moves intel_shared_regs_constraints() ahead of
intel_pebs_constraints().

We can safely do that because the intel_shared_regs_constraints() function
only returns empty constraint 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>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: eranian@google.com
Link: http://lkml.kernel.org/r/1427467105-9260-1-git-send-email-kan.liang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event_intel.c