dyndbg: reverse module walk in cat control
authorJim Cromie <jim.cromie@gmail.com>
Sun, 4 Sep 2022 21:40:41 +0000 (15:40 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Sep 2022 14:58:23 +0000 (16:58 +0200)
/proc/dynamic_debug/control walks the prdbg catalog in "reverse",
fix this by adding new ddebug_tables to tail of list.

This puts init/main.c entries 1st, which looks more than coincidental.

no functional changes.

Acked-by: Jason Baron <jbaron@akamai.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Link: https://lore.kernel.org/r/20220904214134.408619-5-jim.cromie@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/dynamic_debug.c

index 8faf584f2f4b0f426743ff55d51e9bff43eabe2a..7fb99492c16f3a7cfc37787125718be7e9f93639 100644 (file)
@@ -970,7 +970,7 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n,
        dt->ddebugs = tab;
 
        mutex_lock(&ddebug_lock);
-       list_add(&dt->link, &ddebug_tables);
+       list_add_tail(&dt->link, &ddebug_tables);
        mutex_unlock(&ddebug_lock);
 
        vpr_info("%3u debug prints in module %s\n", n, dt->mod_name);