Skip to content

Commit 89e70d5

Browse files
Leo YanPeter Zijlstra
authored andcommitted
locking/lockdep: Correct calling tracepoints
The commit eb1f002 ("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: eb1f002 ("lockdep,trace: Expose tracepoints") Signed-off-by: Leo Yan <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent d07f6ca commit 89e70d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/locking/lockdep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5736,7 +5736,7 @@ void lock_contended(struct lockdep_map *lock, unsigned long ip)
57365736
{
57375737
unsigned long flags;
57385738

5739-
trace_lock_acquired(lock, ip);
5739+
trace_lock_contended(lock, ip);
57405740

57415741
if (unlikely(!lock_stat || !lockdep_enabled()))
57425742
return;
@@ -5754,7 +5754,7 @@ void lock_acquired(struct lockdep_map *lock, unsigned long ip)
57545754
{
57555755
unsigned long flags;
57565756

5757-
trace_lock_contended(lock, ip);
5757+
trace_lock_acquired(lock, ip);
57585758

57595759
if (unlikely(!lock_stat || !lockdep_enabled()))
57605760
return;

0 commit comments

Comments
 (0)