Re: [PATCH 18/25] dynamic_debug: Introduce global fake module param $module.dyndbg

From: Rusty Russell
Date: Wed Dec 07 2011 - 18:36:15 EST


On Wed, 7 Dec 2011 01:33:45 -0700, Jim Cromie <jim.cromie@xxxxxxxxx> wrote:
> On Tue, Dec 6, 2011 at 6:01 PM, Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
> > This worked out pretty neatly. ÂThanks!
>
> It did. Almost like you planned it.

I do get lucky sometimes...

> >> - Â Â Â Â Â Â Â Â Â int (*unknown)(char *param, char *val));
> >> + Â Â Â Â Â Â Â Â Â int (*unknown)(char *param, char *val, const char *modname));
> >
> > Do you really want the modname here, or a struct module? ÂI wonder if we
> > should make this a standard opaque void *. ÂOf course, we'd have to
> > modify parse_args callers, but you're abusing "name" arg here a bit
> > anyway.
> >
>
> I thought about the possible abuse, but then saw existing uses:
>
> linux-2.6]$ grep parse_args init/main.c
> parse_args("early options", cmdline, NULL, 0, do_early_param);
> parse_args("Booting kernel", static_command_line, __start___param,
>
> "Booting kernel" isnt quite a name either.
>
> wrt using a struct module arg, Id prefer not.
> what I need is the name, so that the ddebug-queries being passed
> can leave out the module name and thus be shorter and less redundant

But from the module you can get the name. It's just that having a
cb/void* pair is pretty standard practice. Still, it's a line ball, and
I'm not unhappy enough to change it until we need it.

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/