summaryrefslogtreecommitdiff
path: root/arch/x86/events/intel/lbr.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-08-17 11:50:48 +0300
committerIngo Molnar <mingo@kernel.org>2017-08-17 11:50:48 +0300
commit2257e268b1154966c5b0141b23695db1043ff39d (patch)
treedae4b032afb9872568cf7921b39d30c79a6c3fee /arch/x86/events/intel/lbr.c
parent27aac20574110abfd594175a668dc58b23b2b14a (diff)
parentac9a40905a610fb02086a37b11ff4bf046825a88 (diff)
downloadlinux-2257e268b1154966c5b0141b23695db1043ff39d.tar.xz
Merge branch 'linus' into x86/boot, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/events/intel/lbr.c')
-rw-r--r--arch/x86/events/intel/lbr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
index eb261656a320..955457a30197 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -380,8 +380,12 @@ static void __intel_pmu_lbr_save(struct x86_perf_task_context *task_ctx)
void intel_pmu_lbr_sched_task(struct perf_event_context *ctx, bool sched_in)
{
+ struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
struct x86_perf_task_context *task_ctx;
+ if (!cpuc->lbr_users)
+ return;
+
/*
* If LBR callstack feature is enabled and the stack was saved when
* the task was scheduled out, restore the stack. Otherwise flush