Commit 64414da2 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Greg Kroah-Hartman

kobject: align stacktrace levels to logging message

Without an explicit level the stacktraces are printed at a default
level.
If this level does not match the one from the logging level it may
happen that the stacktrace is shown without the message or vice versa.

Both these cases are confusing, so make sure the user always sees both,
the message and the stacktrace.
Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20230311-kobject-warning-v1-2-1ebba4f71fb5@weissschuh.netSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 98406333
...@@ -340,7 +340,7 @@ void kobject_init(struct kobject *kobj, const struct kobj_type *ktype) ...@@ -340,7 +340,7 @@ void kobject_init(struct kobject *kobj, const struct kobj_type *ktype)
/* do not error out as sometimes we can recover */ /* do not error out as sometimes we can recover */
pr_err("kobject (%p): tried to init an initialized object, something is seriously wrong.\n", pr_err("kobject (%p): tried to init an initialized object, something is seriously wrong.\n",
kobj); kobj);
dump_stack(); dump_stack_lvl(KERN_ERR);
} }
kobject_init_internal(kobj); kobject_init_internal(kobj);
...@@ -349,7 +349,7 @@ void kobject_init(struct kobject *kobj, const struct kobj_type *ktype) ...@@ -349,7 +349,7 @@ void kobject_init(struct kobject *kobj, const struct kobj_type *ktype)
error: error:
pr_err("kobject (%p): %s\n", kobj, err_str); pr_err("kobject (%p): %s\n", kobj, err_str);
dump_stack(); dump_stack_lvl(KERN_ERR);
} }
EXPORT_SYMBOL(kobject_init); EXPORT_SYMBOL(kobject_init);
...@@ -413,7 +413,7 @@ int kobject_add(struct kobject *kobj, struct kobject *parent, ...@@ -413,7 +413,7 @@ int kobject_add(struct kobject *kobj, struct kobject *parent,
if (!kobj->state_initialized) { if (!kobj->state_initialized) {
pr_err("kobject '%s' (%p): tried to add an uninitialized object, something is seriously wrong.\n", pr_err("kobject '%s' (%p): tried to add an uninitialized object, something is seriously wrong.\n",
kobject_name(kobj), kobj); kobject_name(kobj), kobj);
dump_stack(); dump_stack_lvl(KERN_ERR);
return -EINVAL; return -EINVAL;
} }
va_start(args, fmt); va_start(args, fmt);
......
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