From 9f66fa2a4690a16da0dbaae2f44ddfc313802504 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 28 Nov 2007 23:49:41 -0800 Subject: kobject: clean up debugging messages The kobject debugging messages are a mess. This provides a unified message that makes them actually useful. The format for new kobject debug messages should be: kobject: 'KOBJECT_NAME' (ADDRESS): FUNCTION_NAME: message.\n Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- lib/kobject_uevent.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'lib/kobject_uevent.c') diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 5886147252d..51dc4d287ad 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -98,7 +98,8 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, int i = 0; int retval = 0; - pr_debug("%s\n", __FUNCTION__); + pr_debug("kobject: '%s' (%p): %s\n", + kobject_name(kobj), kobj, __FUNCTION__); /* search the kset we belong to */ top_kobj = kobj; @@ -106,7 +107,9 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, top_kobj = top_kobj->parent; if (!top_kobj->kset) { - pr_debug("kobject attempted to send uevent without kset!\n"); + pr_debug("kobject: '%s' (%p): %s: attempted to send uevent " + "without kset!\n", kobject_name(kobj), kobj, + __FUNCTION__); return -EINVAL; } @@ -116,7 +119,9 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, /* skip the event, if the filter returns zero. */ if (uevent_ops && uevent_ops->filter) if (!uevent_ops->filter(kset, kobj)) { - pr_debug("kobject filter function caused the event to drop!\n"); + pr_debug("kobject: '%s' (%p): %s: filter function " + "caused the event to drop!\n", + kobject_name(kobj), kobj, __FUNCTION__); return 0; } @@ -126,7 +131,9 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, else subsystem = kobject_name(&kset->kobj); if (!subsystem) { - pr_debug("unset subsystem caused the event to drop!\n"); + pr_debug("kobject: '%s' (%p): %s: unset subsystem caused the " + "event to drop!\n", kobject_name(kobj), kobj, + __FUNCTION__); return 0; } @@ -166,8 +173,9 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, if (uevent_ops && uevent_ops->uevent) { retval = uevent_ops->uevent(kset, kobj, env); if (retval) { - pr_debug ("%s - uevent() returned %d\n", - __FUNCTION__, retval); + pr_debug("kobject: '%s' (%p): %s: uevent() returned " + "%d\n", kobject_name(kobj), kobj, + __FUNCTION__, retval); goto exit; } } -- cgit v1.2.3