Re: [PATCH 18/25] dynamic_debug: Introduce global fake module param $module.dyndbg
From: Rusty Russell
Date: Thu Dec 15 2011 - 22:57:39 EST
On Mon, 12 Dec 2011 16:12:44 -0700, jim.cromie@xxxxxxxxx wrote:
> From: Jim Cromie <jim.cromie@xxxxxxxxx>
>
> Rework Thomas Renninger's $module.ddebug boot-time debugging feature,
> from https://lkml.org/lkml/2010/9/15/397
OK, this looks cleaner!
> @@ -292,7 +292,8 @@ extern int parse_args(const char *name,
> char *args,
> const struct kernel_param *params,
> unsigned num,
> - int (*unknown)(char *param, char *val));
> + int (*unknown)(char *param, char *val,
> + const char *modname));
s/modname/doing/ here, since it's a generic callback.
> -static int __init unknown_bootoption(char *param, char *val)
> +static int __init unknown_bootoption(char *param, char *val,
> + const char *modname)
> {
s/modname/doing/ (or /s/modname/unused/).
> /* Change NUL term back to "=", to make "param" the whole string. */
> if (val) {
> @@ -387,7 +388,7 @@ static noinline void __init_refok rest_init(void)
> }
>
> /* Check for early params. */
> -static int __init do_early_param(char *param, char *val)
> +static int __init do_early_param(char *param, char *val, const char *modname)
> {
Same as above.
> diff --git a/kernel/params.c b/kernel/params.c
> index 9240664..4c39c0e 100644
> --- a/kernel/params.c
> +++ b/kernel/params.c
> @@ -86,9 +86,11 @@ bool parameq(const char *a, const char *b)
>
> static int parse_one(char *param,
> char *val,
> + const char *doing,
> const struct kernel_param *params,
> unsigned num_params,
> - int (*handle_unknown)(char *param, char *val))
> + int (*handle_unknown)(char *param, char *val,
> + const char *modname))
> {
s/modname/doing/ here too, makes it clear.
> /* Args looks like "foo=bar,bar2 baz=fuz wiz". */
> -int parse_args(const char *name,
> +int parse_args(const char *doing, /* modname, Booting kernel, early options */
> char *args,
> const struct kernel_param *params,
> unsigned num,
> - int (*unknown)(char *param, char *val))
> + int (*unknown)(char *param, char *val, const char *modname))
> {
... again....
> +/* find & process .dyndbg params (prefixed by modname) in cmdline */
> +static __init void ddebug_boot_parse_args(void)
> +{
OK, I don't get why you are doing your own parsing for builtins?
Can't you call something from init/main.c:unknown_bootoption()?
If that's too early, I have a patch we're working on which adds
parameter parsing to each initlevel.
Thanks,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/