@@ -100,6 +100,9 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
int i = 0;
int retval = 0;
+ printk(KERN_ERR "kobject_uevent_env: [%s] %p\n",
+ kobject_name(kobj), kobj);
+
pr_debug("kobject: '%s' (%p): %s\n",
kobject_name(kobj), kobj, __func__);
@@ -109,8 +112,8 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
top_kobj = top_kobj->parent;
if (!top_kobj->kset) {
- pr_debug("kobject: '%s' (%p): %s: attempted to send uevent "
- "without kset!\n", kobject_name(kobj), kobj,
+ printk(KERN_ERR "kobject: '%s' (%p): %s: attempted to send uevent "
+ "without kset!\n", kobject_name(kobj), kobj,
__func__);
return -EINVAL;
}
@@ -118,12 +121,14 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
kset = top_kobj->kset;
uevent_ops = kset->uevent_ops;
+ printk(KERN_ERR "kobject_uevent_env: Checking uevent_ops->filter\n");
+
/* skip the event, if the filter returns zero. */
if (uevent_ops && uevent_ops->filter)
if (!uevent_ops->filter(kset, kobj)) {
- pr_debug("kobject: '%s' (%p): %s: filter function "
- "caused the event to drop!\n",
- kobject_name(kobj), kobj, __func__);
+ printk(KERN_ERR "kobject: '%s' (%p): %s: filter function "
+ "caused the event to drop!\n",
+ kobject_name(kobj), kobj, __func__);
return 0;
}
@@ -133,16 +138,20 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
else
subsystem = kobject_name(&kset->kobj);
if (!subsystem) {
- pr_debug("kobject: '%s' (%p): %s: unset subsystem caused the "
- "event to drop!\n", kobject_name(kobj), kobj,
- __func__);
+ printk(KERN_ERR "kobject: '%s' (%p): %s: unset subsystem caused the "
+ "event to drop!\n", kobject_name(kobj), kobj,
+ __func__);
return 0;
}
+ printk(KERN_ERR "kobject_uevent_env: Allocating and filling env buffer.\n");
+
/* environment buffer */
env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL);
- if (!env)
+ if (!env) {
+ printk(KERN_ERR "kobject_uevent_env: env kzalloc() failed\n");
return -ENOMEM;
+ }
/* complete object path */
devpath = kobject_get_path(kobj, GFP_KERNEL);
@@ -171,6 +180,8 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
}
}
+ printk(KERN_ERR "kobject_uevent_env: Checking uevent_ops->uevent\n");
+
/* let the kset specific function add its stuff */
if (uevent_ops && uevent_ops->uevent) {
retval = uevent_ops->uevent(kset, kobj, env);
@@ -207,6 +218,8 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
struct sk_buff *skb;
size_t len;
+ printk(KERN_ERR "kobject_uevent_env: Sending netlink msg\n");
+
/* allocate message with the maximum possible size */
len = strlen(action_string) + strlen(devpath) + 2;
skb = alloc_skb(len + env->buflen, GFP_KERNEL);
@@ -234,6 +247,9 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
if (uevent_helper[0]) {
char *argv [3];
+ printk(KERN_ERR "kobject_uevent_env: Invoking uevent_helper[%s]\n",
+ uevent_helper);
+
argv [0] = uevent_helper;
argv [1] = (char *)subsystem;
argv [2] = NULL;
@@ -250,6 +266,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
}
exit:
+ printk(KERN_ERR "kobject_uevent_env: At 'exit', retval=%d\n", retval);
kfree(devpath);
kfree(env);
return retval;