diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-03-07 03:58:33 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-03-08 10:10:38 -0500 |
commit | 997772884036e6e121de39322179989154437d9f (patch) | |
tree | 618ef63c45e16892ea26a99cafef6b0442e8eca1 /kernel/workqueue.c | |
parent | a5abba989deceb731047425812d268daf7536575 (diff) |
debugobjects: Add hint for better object identification
In complex subsystems like mac80211 structures can contain several
timers and work structs, so identifying a specific instance from the
call trace and object type output of debugobjects can be hard.
Allow the subsystems which support debugobjects to provide a hint
function. This function returns a pointer to a kernel address
(preferrably the objects callback function) which is printed along
with the debugobjects type.
Add hint methods for timer_list, work_struct and hrtimer.
[ tglx: Massaged changelog, made it compile ]
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
LKML-Reference: <20110307085809.GA9334@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index ee6578b578ad..b5fe4c00eb3c 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -316,6 +316,11 @@ static inline int __next_wq_cpu(int cpu, const struct cpumask *mask, | |||
316 | 316 | ||
317 | static struct debug_obj_descr work_debug_descr; | 317 | static struct debug_obj_descr work_debug_descr; |
318 | 318 | ||
319 | static void *work_debug_hint(void *addr) | ||
320 | { | ||
321 | return ((struct work_struct *) addr)->func; | ||
322 | } | ||
323 | |||
319 | /* | 324 | /* |
320 | * fixup_init is called when: | 325 | * fixup_init is called when: |
321 | * - an active object is initialized | 326 | * - an active object is initialized |
@@ -387,6 +392,7 @@ static int work_fixup_free(void *addr, enum debug_obj_state state) | |||
387 | 392 | ||
388 | static struct debug_obj_descr work_debug_descr = { | 393 | static struct debug_obj_descr work_debug_descr = { |
389 | .name = "work_struct", | 394 | .name = "work_struct", |
395 | .debug_hint = work_debug_hint, | ||
390 | .fixup_init = work_fixup_init, | 396 | .fixup_init = work_fixup_init, |
391 | .fixup_activate = work_fixup_activate, | 397 | .fixup_activate = work_fixup_activate, |
392 | .fixup_free = work_fixup_free, | 398 | .fixup_free = work_fixup_free, |