Commit feac18dd authored by Stephen Boyd's avatar Stephen Boyd Committed by Thomas Gleixner
Browse files

debugobjects: Be smarter about static objects

Make debugobjects use the return code from the fixup function. That
allows us better diagnostics in the activate check than relying on a
WARN_ON() in the object specific code.

[ Split out the debugobjects vs. the timer change ]
Signed-off-by: default avatarStephen Boyd <>
Cc: Christine Chan <>
Cc: John Stultz <>
Signed-off-by: default avatarAndrew Morton <>

Signed-off-by: default avatarThomas Gleixner <>
parent c5e0c782
......@@ -268,12 +268,16 @@ static void debug_print_object(struct debug_obj *obj, char *msg)
* Try to repair the damage, so we have a better chance to get useful
* debug output.
static void
static int
debug_object_fixup(int (*fixup)(void *addr, enum debug_obj_state state),
void * addr, enum debug_obj_state state)
int fixed = 0;
if (fixup)
debug_objects_fixups += fixup(addr, state);
fixed = fixup(addr, state);
debug_objects_fixups += fixed;
return fixed;
static void debug_object_is_on_stack(void *addr, int onstack)
......@@ -386,6 +390,9 @@ void debug_object_activate(void *addr, struct debug_obj_descr *descr)
struct debug_bucket *db;
struct debug_obj *obj;
unsigned long flags;
struct debug_obj o = { .object = addr,
.descr = descr };
if (!debug_objects_enabled)
......@@ -425,8 +432,9 @@ void debug_object_activate(void *addr, struct debug_obj_descr *descr)
* let the type specific code decide whether this is
* true or not.
debug_object_fixup(descr->fixup_activate, addr,
if (debug_object_fixup(descr->fixup_activate, addr,
debug_print_object(&o, "activate");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment