aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/dynamic_debug.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 84d103c474e4..44ce66bdb211 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -450,6 +450,19 @@ static int ddebug_exec_query(char *query_string)
450 return 0; 450 return 0;
451} 451}
452 452
453static __initdata char ddebug_setup_string[1024];
454static __init int ddebug_setup_query(char *str)
455{
456 if (strlen(str) >= 1024) {
457 pr_warning("ddebug boot param string too large\n");
458 return 0;
459 }
460 strcpy(ddebug_setup_string, str);
461 return 1;
462}
463
464__setup("ddebug_query=", ddebug_setup_query);
465
453/* 466/*
454 * File_ops->write method for <debugfs>/dynamic_debug/conrol. Gathers the 467 * File_ops->write method for <debugfs>/dynamic_debug/conrol. Gathers the
455 * command text from userspace, parses and executes it. 468 * command text from userspace, parses and executes it.
@@ -769,6 +782,18 @@ static int __init dynamic_debug_init(void)
769 } 782 }
770 ret = ddebug_add_module(iter_start, n, modname); 783 ret = ddebug_add_module(iter_start, n, modname);
771 } 784 }
785
786 /* ddebug_query boot param got passed -> set it up */
787 if (ddebug_setup_string[0] != '\0') {
788 ret = ddebug_exec_query(ddebug_setup_string);
789 if (ret)
790 pr_warning("Invalid ddebug boot param %s",
791 ddebug_setup_string);
792 else
793 pr_info("ddebug initialized with string %s",
794 ddebug_setup_string);
795 }
796
772out_free: 797out_free:
773 if (ret) { 798 if (ret) {
774 ddebug_remove_all_tables(); 799 ddebug_remove_all_tables();