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

From: Peter Zijlstra
Date: Wed May 12 2021 - 10:09:07 EST


On Wed, May 12, 2021 at 09:32:02AM -0400, Steven Rostedt wrote:
> On Wed, 12 May 2021 14:37:12 +0200
> Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> > 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!
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> Reviewed-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
> Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> Tested-by: Marco Elver <elver@xxxxxxxxxx>
>
> That's embarrassing :-p

Thing is, if you look at the list copy:

https://lore.kernel.org/lkml/20200821085348.782688941@xxxxxxxxxxxxx/

things were okay. I suspect there was a conflict at some point and
resolution got it backwards because the hunks are so similar and I never
noticed :/