Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

locking/lockdep: Correct calling tracepoints

The commit eb1f00237aca ("lockdep,trace: Expose tracepoints") reverses
tracepoints for lock_contended() and lock_acquired(), thus the ftrace
log shows the wrong locking sequence that "acquired" event is prior to
"contended" event:

<idle>-0 [001] d.s3 20803.501685: lock_acquire: 0000000008b91ab4 &sg_policy->update_lock
<idle>-0 [001] d.s3 20803.501686: lock_acquired: 0000000008b91ab4 &sg_policy->update_lock
<idle>-0 [001] d.s3 20803.501689: lock_contended: 0000000008b91ab4 &sg_policy->update_lock
<idle>-0 [001] d.s3 20803.501690: lock_release: 0000000008b91ab4 &sg_policy->update_lock

This patch fixes calling tracepoints for lock_contended() and
lock_acquired().

Fixes: eb1f00237aca ("lockdep,trace: Expose tracepoints")
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210512120937.90211-1-leo.yan@linaro.org

authored by

Leo Yan and committed by
Peter Zijlstra
89e70d5c d07f6ca9

+2 -2
+2 -2
kernel/locking/lockdep.c
··· 5736 { 5737 unsigned long flags; 5738 5739 - trace_lock_acquired(lock, ip); 5740 5741 if (unlikely(!lock_stat || !lockdep_enabled())) 5742 return; ··· 5754 { 5755 unsigned long flags; 5756 5757 - trace_lock_contended(lock, ip); 5758 5759 if (unlikely(!lock_stat || !lockdep_enabled())) 5760 return;
··· 5736 { 5737 unsigned long flags; 5738 5739 + trace_lock_contended(lock, ip); 5740 5741 if (unlikely(!lock_stat || !lockdep_enabled())) 5742 return; ··· 5754 { 5755 unsigned long flags; 5756 5757 + trace_lock_acquired(lock, ip); 5758 5759 if (unlikely(!lock_stat || !lockdep_enabled())) 5760 return;