timers: Provide a better debugobjects hint for delayed works
authorStephen Boyd <swboyd@chromium.org>
Wed, 11 May 2022 20:19:51 +0000 (13:19 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 14 May 2022 15:40:36 +0000 (17:40 +0200)
commit317f29c14d0cca09952f1022491454b23455ebcb
treebe0402a03f063579714e5f6a82786dbf5b5beef1
parentf4b62e1e1137507268c2c63dc4e6da279dc58e9f
timers: Provide a better debugobjects hint for delayed works

With debugobjects enabled the timer hint for freeing of active timers
embedded inside delayed works is always the same, i.e. the hint is
delayed_work_timer_fn, even though the function the delayed work is going
to run can be wildly different depending on what work was queued.  Enabling
workqueue debugobjects doesn't help either because the delayed work isn't
considered active until it is actually queued to run on a workqueue. If the
work is freed while the timer is pending the work isn't considered active
so there is no information from workqueue debugobjects.

Special case delayed works in the timer debugobjects hint logic so that the
delayed work function is returned instead of the delayed_work_timer_fn.
This will help to understand which delayed work was pending that got
freed.

Apply the same treatment for kthread_delayed_work because it follows the
same pattern.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220511201951.42408-1-swboyd@chromium.org
kernel/time/timer.c