[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-feac18dda25134005909e7770c77464e65608bd8@git.kernel.org>
Date: Mon, 28 Nov 2011 06:18:54 -0800
From: tip-bot for Stephen Boyd <sboyd@...eaurora.org>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
sboyd@...eaurora.org, john.stultz@...aro.org,
akpm@...ux-foundation.org, cschan@...eaurora.org,
tglx@...utronix.de
Subject: [tip:core/debugobjects] debugobjects: Be smarter about static objects
Commit-ID: feac18dda25134005909e7770c77464e65608bd8
Gitweb: http://git.kernel.org/tip/feac18dda25134005909e7770c77464e65608bd8
Author: Stephen Boyd <sboyd@...eaurora.org>
AuthorDate: Mon, 7 Nov 2011 19:48:26 -0800
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 23 Nov 2011 18:49:22 +0100
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.
[ tglx@...utronix.de: Split out the debugobjects vs. the timer change ]
Signed-off-by: Stephen Boyd <sboyd@...eaurora.org>
Cc: Christine Chan <cschan@...eaurora.org>
Cc: John Stultz <john.stultz@...aro.org>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Link: http://lkml.kernel.org/r/1320724108-20788-2-git-send-email-sboyd@codeaurora.org
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
lib/debugobjects.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index a78b7c6..b7a5305 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -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,
+ .state = ODEBUG_STATE_NOTAVAILABLE,
+ .descr = descr };
if (!debug_objects_enabled)
return;
@@ -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,
- ODEBUG_STATE_NOTAVAILABLE);
+ if (debug_object_fixup(descr->fixup_activate, addr,
+ ODEBUG_STATE_NOTAVAILABLE))
+ debug_print_object(&o, "activate");
}
/**
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists