]> Git Repo - J-linux.git/commitdiff
kobject: align stacktrace levels to logging message
authorThomas Weißschuh <[email protected]>
Sat, 11 Mar 2023 03:14:47 +0000 (03:14 +0000)
committerGreg Kroah-Hartman <[email protected]>
Fri, 17 Mar 2023 14:15:23 +0000 (15:15 +0100)
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: Thomas Weißschuh <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
lib/kobject.c

index 09c81ffb8b33d5ea504c5dd900f575e57532fddb..f79a434e12316608fb5dd32a1197b0d85c584740 100644 (file)
@@ -340,7 +340,7 @@ void kobject_init(struct kobject *kobj, const struct kobj_type *ktype)
                /* do not error out as sometimes we can recover */
                pr_err("kobject (%p): tried to init an initialized object, something is seriously wrong.\n",
                       kobj);
-               dump_stack();
+               dump_stack_lvl(KERN_ERR);
        }
 
        kobject_init_internal(kobj);
@@ -349,7 +349,7 @@ void kobject_init(struct kobject *kobj, const struct kobj_type *ktype)
 
 error:
        pr_err("kobject (%p): %s\n", kobj, err_str);
-       dump_stack();
+       dump_stack_lvl(KERN_ERR);
 }
 EXPORT_SYMBOL(kobject_init);
 
@@ -413,7 +413,7 @@ int kobject_add(struct kobject *kobj, struct kobject *parent,
        if (!kobj->state_initialized) {
                pr_err("kobject '%s' (%p): tried to add an uninitialized object, something is seriously wrong.\n",
                       kobject_name(kobj), kobj);
-               dump_stack();
+               dump_stack_lvl(KERN_ERR);
                return -EINVAL;
        }
        va_start(args, fmt);
This page took 0.050203 seconds and 4 git commands to generate.