From 3f06c53f99f8c6add6e65cf9b82cc8cef227a771 Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Fri, 27 Apr 2012 14:30:37 -0600 Subject: [PATCH] --- yaml --- r: 304054 b: refs/heads/master c: 6ab676e96422f33a873006096f928feeded7ce3b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/lib/dynamic_debug.c | 36 ++++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index f77f61abac92..fb43d03810d1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f0b919d967284313be4a767ba92ab5a88cb27410 +refs/heads/master: 6ab676e96422f33a873006096f928feeded7ce3b diff --git a/trunk/lib/dynamic_debug.c b/trunk/lib/dynamic_debug.c index 09f2cda88058..3b06f926d5b8 100644 --- a/trunk/lib/dynamic_debug.c +++ b/trunk/lib/dynamic_debug.c @@ -862,39 +862,43 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n, } EXPORT_SYMBOL_GPL(ddebug_add_module); -/* handle both dyndbg=".." and $module.dyndbg=".." params at boot */ -static int ddebug_dyndbg_boot_param_cb(char *param, char *val, - const char *unused) +/* helper for ddebug_dyndbg_(boot|module)_param_cb */ +static int ddebug_dyndbg_param_cb(char *param, char *val, + const char *modname, int on_err) { - const char *modname = NULL; char *sep; sep = strchr(param, '.'); if (sep) { + /* needed only for ddebug_dyndbg_boot_param_cb */ *sep = '\0'; modname = param; param = sep + 1; } if (strcmp(param, "dyndbg")) - return 0; /* skip all other params w/o error */ - - vpr_info("module: %s %s=\"%s\"\n", modname, param, val); + return on_err; /* determined by caller */ ddebug_exec_queries(val ? val : "+p"); return 0; /* query failure shouldnt stop module load */ } -/* handle dyndbg args to modprobe */ -int ddebug_dyndbg_module_param_cb(char *param, char *val, const char *doing) +/* handle both dyndbg and $module.dyndbg params at boot */ +static int ddebug_dyndbg_boot_param_cb(char *param, char *val, + const char *unused) { - if (strcmp(param, "dyndbg")) - return -ENOENT; - - vpr_info("module: %s %s=\"%s\"\n", doing, param, val); - - ddebug_exec_queries((val ? val : "+p")); + vpr_info("%s=\"%s\"\n", param, val); + return ddebug_dyndbg_param_cb(param, val, NULL, 0); +} - return 0; /* query failure shouldnt stop module load */ +/* + * modprobe foo finds foo.params in boot-args, strips "foo.", and + * passes them to load_module(). This callback gets unknown params, + * processes dyndbg params, rejects others. + */ +int ddebug_dyndbg_module_param_cb(char *param, char *val, const char *module) +{ + vpr_info("module: %s %s=\"%s\"\n", module, param, val); + return ddebug_dyndbg_param_cb(param, val, module, -ENOENT); } static void ddebug_table_free(struct ddebug_table *dt)