From: Rusty Russell <rusty@rustcorp.com.au>
To: jim.cromie@gmail.com, jbaron@redhat.com
Cc: greg@kroah.com, joe@perches.com, bart.vanassche@gmail.com,
linux-kernel@vger.kernel.org, Jim Cromie <jim.cromie@gmail.com>,
Thomas Renninger <trenn@suse.de>
Subject: Re: [PATCH 18/25] dynamic_debug: Introduce global fake module param $module.dyndbg
Date: Wed, 07 Dec 2011 11:31:55 +1030 [thread overview]
Message-ID: <8739cxjit8.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1323198694-7186-19-git-send-email-jim.cromie@gmail.com>
On Tue, 6 Dec 2011 12:11:28 -0700, jim.cromie@gmail.com wrote:
> From: Jim Cromie <jim.cromie@gmail.com>
>
> Rework Thomas Renninger's $module.ddebug boot-time debugging feature,
> from https://lkml.org/lkml/2010/9/15/397
This worked out pretty neatly. Thanks!
A few questions from your patches:
> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> index 7e3c53a..b77f43b 100644
> --- a/include/linux/dynamic_debug.h
> +++ b/include/linux/dynamic_debug.h
> @@ -39,11 +39,16 @@ struct _ddebug {
> int ddebug_add_module(struct _ddebug *tab, unsigned int n,
> const char *modname);
>
> +struct kernel_param;
> +
> #if defined(CONFIG_DYNAMIC_DEBUG)
> extern int ddebug_remove_module(const char *mod_name);
> +
> extern __printf(2, 3)
> int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...);
struct kernel_param def belongs in future patch? And whitespace change
is kind of annoying.
> diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
> index 7939f63..91bd56a 100644
> --- a/include/linux/moduleparam.h
> +++ b/include/linux/moduleparam.h
> @@ -292,7 +292,7 @@ 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));
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.
> @@ -2893,7 +2893,8 @@ static struct module *load_module(void __user *umod,
> mutex_unlock(&module_mutex);
>
> /* Module is ready to execute: parsing args may do that. */
> - err = parse_args(mod->name, mod->args, mod->kp, mod->num_kp, NULL);
> + err = parse_args(mod->name, mod->args, mod->kp, mod->num_kp,
> + ddebug_dyndbg_param_cb);
> if (err < 0)
> goto unlink;
You have to
> @@ -510,8 +510,7 @@ asmlinkage void __init start_kernel(void)
> printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line);
> parse_early_param();
> parse_args("Booting kernel", static_command_line, __start___param,
> - __stop___param - __start___param,
> - &unknown_bootoption);
> + __stop___param - __start___param, &unknown_bootoption);
>
> jump_label_init();
Gratuitous whitespace change.
> +int ddebug_dyndbg_param_cb(char *param, char* val, const char* modname)
> +{
> + if (strcmp(param, "dyndbg")) {
> + pr_warn("bogus param %s=%s received for %s\n",
> + param, val, modname);
> + return -EINVAL;
> + }
This is already done in parse_args(); don't add a pr_warn here.
Thanks,
Rusty.
next prev parent reply other threads:[~2011-12-07 1:09 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 20:27 [patch 00/25] dynamic-debug enhancements Jim Cromie
2011-12-06 18:59 ` Jim Cromie
2011-12-06 19:11 ` [patch 00/24 ] dynamic debug enhancements: multi-queries during mod-init jim.cromie
2011-12-06 19:11 ` [PATCH 01/25] kernel/module.c: fix compile err, warnings under ifdef DEBUGP jim.cromie
2011-12-06 19:11 ` [PATCH 02/25] dynamic_debug: fix whitespace complaints from scripts/cleanfile jim.cromie
2011-12-06 19:11 ` [PATCH 03/25] dynamic_debug: drop enabled field from struct _ddebug, use _DPRINTK_FLAGS_PRINT jim.cromie
2011-12-06 19:11 ` [PATCH 04/25] dynamic_debug: make dynamic-debug supersede DEBUG ccflag jim.cromie
2011-12-06 19:11 ` [PATCH 05/25] dynamic_debug: change verbosity at runtime jim.cromie
2011-12-06 19:11 ` [PATCH 06/25] dynamic_debug: replace strcpy with strlcpy, in ddebug_setup_query() jim.cromie
2011-12-06 19:11 ` [PATCH 07/25] dynamic_debug: pr_err() call should not depend upon verbosity jim.cromie
2011-12-06 19:11 ` [PATCH 08/25] dynamic_debug: drop explicit !=NULL checks jim.cromie
2011-12-06 19:11 ` [PATCH 09/25] dynamic_debug: describe_flags with '=[pmflt_]*' jim.cromie
2011-12-06 19:11 ` [PATCH 10/25] dynamic_debug: tighten up error checking on debug queries jim.cromie
2011-12-06 19:11 ` [PATCH 11/25] dynamic_debug: early return if _ddebug table is empty jim.cromie
2011-12-06 19:11 ` [PATCH 12/25] dynamic_debug: reduce lineno field to a saner 18 bits jim.cromie
2011-12-06 19:11 ` [PATCH 13/25] dynamic_debug: chop off comments in ddebug_tokenize jim.cromie
2011-12-06 19:11 ` [PATCH 14/25] dynamic_debug: enlarge command/query write buffer jim.cromie
2011-12-06 19:11 ` [PATCH 15/25] dynamic_debug: add trim_prefix() to provide source-root relative paths jim.cromie
2011-12-06 19:11 ` [PATCH 16/25] dynamic_debug: factor vpr_info_dq out of ddebug_parse_query jim.cromie
2011-12-06 19:11 ` [PATCH 17/25] dynamic_debug: process multiple debug-queries on a line jim.cromie
2011-12-06 19:11 ` [PATCH 18/25] dynamic_debug: Introduce global fake module param $module.dyndbg jim.cromie
2011-12-07 1:01 ` Rusty Russell [this message]
2011-12-07 8:33 ` Jim Cromie
2011-12-07 10:59 ` Rusty Russell
2011-12-08 17:10 ` Jason Baron
2011-12-08 18:12 ` Jim Cromie
2011-12-06 19:11 ` [PATCH 19/25] pnp: if CONFIG_DYNAMIC_DEBUG, use pnp.dyndbg instead of pnp.debug jim.cromie
2011-12-06 19:11 ` [PATCH 20/25] dynamic_debug: add modname arg to exec_query callchain jim.cromie
2011-12-06 19:11 ` [PATCH 21/25] kernel/module: replace DEBUGP with pr_debug jim.cromie
2011-12-07 1:07 ` Rusty Russell
2011-12-08 15:41 ` Jason Baron
2011-12-08 18:17 ` Jim Cromie
2011-12-06 19:11 ` [PATCH 22/25] dynamic_debug: protect "dyndbg" fake module param name at compile-time jim.cromie
2011-12-06 19:11 ` [PATCH 23/25] dynamic_debug: update Documentation/kernel-parameters.txt, Kconfig.debug jim.cromie
2011-12-06 19:11 ` [PATCH 24/25] dynamic_debug: remove unneeded includes jim.cromie
2011-12-12 22:05 ` [patch 00/24 ] dynamic debug enhancements: multi-queries during mod-init Greg KH
[not found] ` <CAJfuBxzeKzmOCo00Ew8xAp9EmU0QZ3zjOkRcdEMzYrtx_b9+kA@mail.gmail.com>
2011-12-13 4:17 ` Jim Cromie
2011-12-13 4:25 ` Greg KH
2011-12-13 7:00 ` Jim Cromie
2011-12-13 7:44 ` Greg KH
2011-12-13 14:48 ` Jason Baron
2011-12-12 23:12 ` [patch 00/23] dynamic-debug enhancements Jim Cromie
-- strict thread matches above, loose matches on Subject: below --
2011-12-12 23:12 [PATCH 01/25] kernel/module.c: fix compile err, warnings under ifdef DEBUGP, switch to pr_debug jim.cromie
2011-12-12 23:12 ` [PATCH 18/25] dynamic_debug: Introduce global fake module param $module.dyndbg jim.cromie
2011-12-16 0:00 ` Rusty Russell
2011-12-17 5:10 ` Jim Cromie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8739cxjit8.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=bart.vanassche@gmail.com \
--cc=greg@kroah.com \
--cc=jbaron@redhat.com \
--cc=jim.cromie@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=trenn@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox