aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>2014-05-22 03:20:09 -0400
committerIngo Molnar <mingo@kernel.org>2014-06-05 06:30:23 -0400
commit37548914fbfcd56e1955a9b7e55dc3b84a3e9e25 (patch)
treeccaa221565a51dcc802d0e1e24fe7bdc246760c5 /arch/x86
parent0fffa5df4cf3e22be4f40f6698ab9e49f3ffd6fa (diff)
perf/x86: Add conditional branch filtering support
This patch adds conditional branch filtering support, enabling it for PERF_SAMPLE_BRANCH_COND in perf branch stack sampling framework by utilizing an available software filter X86_BR_JCC. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Reviewed-by: Stephane Eranian <eranian@google.com> Reviewed-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: mpe@ellerman.id.au Cc: benh@kernel.crashing.org Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/1400743210-32289-3-git-send-email-khandual@linux.vnet.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_lbr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c
index d82d155aca8c..9dd2459a4c73 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c
@@ -384,6 +384,9 @@ static void intel_pmu_setup_sw_lbr_filter(struct perf_event *event)
384 if (br_type & PERF_SAMPLE_BRANCH_NO_TX) 384 if (br_type & PERF_SAMPLE_BRANCH_NO_TX)
385 mask |= X86_BR_NO_TX; 385 mask |= X86_BR_NO_TX;
386 386
387 if (br_type & PERF_SAMPLE_BRANCH_COND)
388 mask |= X86_BR_JCC;
389
387 /* 390 /*
388 * stash actual user request into reg, it may 391 * stash actual user request into reg, it may
389 * be used by fixup code for some CPU 392 * be used by fixup code for some CPU
@@ -678,6 +681,7 @@ static const int nhm_lbr_sel_map[PERF_SAMPLE_BRANCH_MAX] = {
678 * NHM/WSM erratum: must include IND_JMP to capture IND_CALL 681 * NHM/WSM erratum: must include IND_JMP to capture IND_CALL
679 */ 682 */
680 [PERF_SAMPLE_BRANCH_IND_CALL] = LBR_IND_CALL | LBR_IND_JMP, 683 [PERF_SAMPLE_BRANCH_IND_CALL] = LBR_IND_CALL | LBR_IND_JMP,
684 [PERF_SAMPLE_BRANCH_COND] = LBR_JCC,
681}; 685};
682 686
683static const int snb_lbr_sel_map[PERF_SAMPLE_BRANCH_MAX] = { 687static const int snb_lbr_sel_map[PERF_SAMPLE_BRANCH_MAX] = {
@@ -689,6 +693,7 @@ static const int snb_lbr_sel_map[PERF_SAMPLE_BRANCH_MAX] = {
689 [PERF_SAMPLE_BRANCH_ANY_CALL] = LBR_REL_CALL | LBR_IND_CALL 693 [PERF_SAMPLE_BRANCH_ANY_CALL] = LBR_REL_CALL | LBR_IND_CALL
690 | LBR_FAR, 694 | LBR_FAR,
691 [PERF_SAMPLE_BRANCH_IND_CALL] = LBR_IND_CALL, 695 [PERF_SAMPLE_BRANCH_IND_CALL] = LBR_IND_CALL,
696 [PERF_SAMPLE_BRANCH_COND] = LBR_JCC,
692}; 697};
693 698
694/* core */ 699/* core */