Commit b32ed7f5 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

perf/x86/intel: Add lockdep assert

Lockdep is very good at finding incorrect IRQ state while locking and
is far better at telling us if we hold a lock than the _is_locked()
API. It also generates less code for !DEBUG kernels.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 1c565833
...@@ -1926,7 +1926,6 @@ intel_start_scheduling(struct cpu_hw_events *cpuc) ...@@ -1926,7 +1926,6 @@ intel_start_scheduling(struct cpu_hw_events *cpuc)
* in stop_event_scheduling() * in stop_event_scheduling()
* makes scheduling appear as a transaction * makes scheduling appear as a transaction
*/ */
WARN_ON_ONCE(!irqs_disabled());
raw_spin_lock(&excl_cntrs->lock); raw_spin_lock(&excl_cntrs->lock);
/* /*
...@@ -2208,7 +2207,7 @@ static void intel_commit_scheduling(struct cpu_hw_events *cpuc, int idx, int cnt ...@@ -2208,7 +2207,7 @@ static void intel_commit_scheduling(struct cpu_hw_events *cpuc, int idx, int cnt
xl = &excl_cntrs->states[tid]; xl = &excl_cntrs->states[tid];
WARN_ON_ONCE(!raw_spin_is_locked(&excl_cntrs->lock)); lockdep_assert_held(&excl_cntrs->lock);
if (cntr >= 0) { if (cntr >= 0) {
if (c->flags & PERF_X86_EVENT_EXCL) if (c->flags & PERF_X86_EVENT_EXCL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment