Skip to content

Commit 1133283

Browse files
jibarongregkh
authored andcommitted
Driver core: fix 'dynamic_debug' cmd line parameter
In testing 2.6.28-rc1, I found that passing 'dynamic_printk' on the command line didn't activate the debug code. The problem is that dynamic_printk_setup() (which activates the debugging) is being called before dynamic_printk_init() is called (which initializes infrastructure). Fix this by setting setting the state to 'DYNAMIC_ENABLED_ALL' in dynamic_printk_setup(), which will also cause all subsequent modules to have debugging automatically started, which is probably the behavior we want. Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 555ac64 commit 1133283

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎lib/dynamic_printk.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ static int __init dynamic_printk_init(void)
402402
iter->logical_modname,
403403
iter->flag_names, iter->hash, iter->hash2);
404404
}
405+
if (dynamic_enabled == DYNAMIC_ENABLED_ALL)
406+
set_all(true);
405407
return 0;
406408
}
407409
module_init(dynamic_printk_init);
@@ -411,7 +413,7 @@ static int __init dynamic_printk_setup(char *str)
411413
{
412414
if (str)
413415
return -ENOENT;
414-
set_all(true);
416+
dynamic_enabled = DYNAMIC_ENABLED_ALL;
415417
return 0;
416418
}
417419
/* Use early_param(), so we can get debug output as early as possible */

0 commit comments

Comments
 (0)