Re: [PATCH] locking/lockdep: Correct calling tracepoints

From: Peter Zijlstra
Date: Wed May 12 2021 - 08:37:45 EST


On Wed, May 12, 2021 at 08:09:37PM +0800, Leo Yan wrote:
> 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@xxxxxxxxxx>

No idea how that happened, curious. Thanks for fixing though!