From: Jason Baron <jbaron@redhat.com>
To: jim.cromie@gmail.com
Cc: greg@kroah.com, joe@perches.com, bart.vanassche@gmail.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 04/25] dynamic_debug: make dynamic-debug supersede DEBUG ccflag
Date: Wed, 30 Nov 2011 17:03:51 -0500 [thread overview]
Message-ID: <20111130220351.GC2500@redhat.com> (raw)
In-Reply-To: <1322683014-13285-5-git-send-email-jim.cromie@gmail.com>
On Wed, Nov 30, 2011 at 12:56:33PM -0700, jim.cromie@gmail.com wrote:
> From: Jim Cromie <jim.cromie@gmail.com>
>
> if CONFIG_DYNAMIC_DEBUG is defined, honor it over DEBUG, so that
> pr_debug()s are controllable, instead of always-on. When DEBUG is
> also defined, change _DPRINTK_FLAGS_DEFAULT to enable printing by
> default.
>
> Also adding _DPRINTK_FLAGS_INCL_MODNAME would be nice, but there are
> numerous cases of pr_debug(NAME ": ...), which would result in double
> printing of module-name. So defer this until things settle.
>
> CC: Joe Perches <joe@perches.com>
> Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
I think it's this patach that is causing a lot of "=p" when I boot up
using a 'make defconfig'. I'm a bit surprised at how many files have
'DEBUG' defined. Are we sure that we are setting the 'p' flag for the
same set of debug statements that would be set if CONFIG_DYNAMIC_DEBUG
were not set?
Also, it seems a bit strange to me, if I now enable all debug statements
and then clear everything (common pattern, I think), that I'm now
disabling stuff that was enabled by default.
Thanks,
-Jason
> ---
> include/linux/device.h | 8 ++++----
> include/linux/dynamic_debug.h | 4 ++++
> include/linux/netdevice.h | 8 ++++----
> include/linux/printk.h | 8 ++++----
> 4 files changed, 16 insertions(+), 12 deletions(-)
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 3136ede..c9468c1 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -872,14 +872,14 @@ int _dev_info(const struct device *dev, const char *fmt, ...)
>
> #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
>
> -#if defined(DEBUG)
> -#define dev_dbg(dev, format, arg...) \
> - dev_printk(KERN_DEBUG, dev, format, ##arg)
> -#elif defined(CONFIG_DYNAMIC_DEBUG)
> +#if defined(CONFIG_DYNAMIC_DEBUG)
> #define dev_dbg(dev, format, ...) \
> do { \
> dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
> } while (0)
> +#elif defined(DEBUG)
> +#define dev_dbg(dev, format, arg...) \
> + dev_printk(KERN_DEBUG, dev, format, ##arg)
> #else
> #define dev_dbg(dev, format, arg...) \
> ({ \
> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> index f71a6b04..29ea09a 100644
> --- a/include/linux/dynamic_debug.h
> +++ b/include/linux/dynamic_debug.h
> @@ -26,7 +26,11 @@ struct _ddebug {
> #define _DPRINTK_FLAGS_INCL_FUNCNAME (1<<2)
> #define _DPRINTK_FLAGS_INCL_LINENO (1<<3)
> #define _DPRINTK_FLAGS_INCL_TID (1<<4)
> +#if defined DEBUG
> +#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT
> +#else
> #define _DPRINTK_FLAGS_DEFAULT 0
> +#endif
> unsigned int flags:8;
> } __attribute__((aligned(8)));
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index cbeb586..f8b71a3c 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -2643,14 +2643,14 @@ int netdev_info(const struct net_device *dev, const char *format, ...);
> #define MODULE_ALIAS_NETDEV(device) \
> MODULE_ALIAS("netdev-" device)
>
> -#if defined(DEBUG)
> -#define netdev_dbg(__dev, format, args...) \
> - netdev_printk(KERN_DEBUG, __dev, format, ##args)
> -#elif defined(CONFIG_DYNAMIC_DEBUG)
> +#if defined(CONFIG_DYNAMIC_DEBUG)
> #define netdev_dbg(__dev, format, args...) \
> do { \
> dynamic_netdev_dbg(__dev, format, ##args); \
> } while (0)
> +#elif defined(DEBUG)
> +#define netdev_dbg(__dev, format, args...) \
> + netdev_printk(KERN_DEBUG, __dev, format, ##args)
> #else
> #define netdev_dbg(__dev, format, args...) \
> ({ \
> diff --git a/include/linux/printk.h b/include/linux/printk.h
> index f0e22f7..f9abd93 100644
> --- a/include/linux/printk.h
> +++ b/include/linux/printk.h
> @@ -180,13 +180,13 @@ extern void dump_stack(void) __cold;
> #endif
>
> /* If you are writing a driver, please use dev_dbg instead */
> -#if defined(DEBUG)
> -#define pr_debug(fmt, ...) \
> - printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> -#elif defined(CONFIG_DYNAMIC_DEBUG)
> +#if defined(CONFIG_DYNAMIC_DEBUG)
> /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
> #define pr_debug(fmt, ...) \
> dynamic_pr_debug(fmt, ##__VA_ARGS__)
> +#elif defined(DEBUG)
> +#define pr_debug(fmt, ...) \
> + printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> #else
> #define pr_debug(fmt, ...) \
> no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> --
> 1.7.7.3
>
next prev parent reply other threads:[~2011-11-30 22:03 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 19:56 [patch 00/25] dynamic-debug during module initialization jim.cromie
2011-11-30 19:56 ` [PATCH 01/25] kernel/module.c: fix compile err, warnings under ifdef DEBUGP jim.cromie
2011-11-30 19:56 ` [PATCH 02/25] dynamic_debug: fix whitespace complaints from scripts/cleanfile jim.cromie
2011-11-30 19:56 ` [PATCH 03/25] dynamic_debug: drop enabled field from struct _ddebug, use _DPRINTK_FLAGS_PRINT jim.cromie
2011-11-30 19:56 ` [PATCH 04/25] dynamic_debug: make dynamic-debug supersede DEBUG ccflag jim.cromie
2011-11-30 22:03 ` Jason Baron [this message]
2011-11-30 22:16 ` Joe Perches
2011-12-01 0:26 ` Jim Cromie
2011-11-30 19:56 ` [PATCH 05/25] dynamic_debug: change verbosity at runtime jim.cromie
2011-11-30 19:56 ` [PATCH 06/25] dynamic_debug: replace strcpy with strlcpy, in ddebug_setup_query() jim.cromie
2011-11-30 19:56 ` [PATCH 07/25] dynamic_debug: pr_err() call should not depend upon verbosity jim.cromie
2011-11-30 19:56 ` [PATCH 08/25] dynamic_debug: drop explicit !=NULL checks jim.cromie
2011-11-30 19:56 ` [PATCH 09/25] dynamic_debug: describe_flags with '=[pmflt_]*' jim.cromie
2011-11-30 19:56 ` [PATCH 10/25] dynamic_debug: tighten up error checking on debug queries jim.cromie
2011-11-30 19:56 ` [PATCH 11/25] dynamic_debug: early return if _ddebug table is empty jim.cromie
2011-11-30 19:56 ` [PATCH 12/25] dynamic_debug: reduce lineno field to a saner 18 bits jim.cromie
2011-11-30 19:56 ` [PATCH 13/25] dynamic_debug: chop off comments in ddebug_tokenize jim.cromie
2011-11-30 19:56 ` [PATCH 14/25] dynamic_debug: enlarge command/query write buffer jim.cromie
2011-11-30 19:56 ` [PATCH 15/25] dynamic_debug: add trim_prefix() to provide source-root relative paths jim.cromie
2011-11-30 19:56 ` [PATCH 16/25] dynamic_debug: factor vpr_info_dq out of ddebug_parse_query jim.cromie
2011-11-30 19:56 ` [PATCH 17/25] dynamic_debug: process multiple debug-queries on a line jim.cromie
2011-11-30 19:56 ` [PATCH 18/25] dynamic_debug: Introduce global fake module param module.ddebug jim.cromie
2011-12-01 2:19 ` Rusty Russell
2011-12-01 8:15 ` Jim Cromie
2011-12-02 0:50 ` Rusty Russell
2011-11-30 19:56 ` [PATCH 19/25] pnp: if CONFIG_DYNAMIC_DEBUG, use pnp.ddebug instead of pnp.debug jim.cromie
2011-12-01 11:15 ` Thomas Renninger
2011-12-05 5:42 ` Jim Cromie
2011-12-05 14:47 ` Thomas Renninger
2011-12-05 19:15 ` Jim Cromie
2011-12-05 21:44 ` Thomas Renninger
2011-11-30 19:56 ` [PATCH 20/25] dynamic_debug: rename ddebug param to dyndbg, plus minor tweaks jim.cromie
2011-11-30 19:56 ` [PATCH 21/25] dynamic_debug: handle $module.dyndbg="+mfp" boot-line args jim.cromie
2011-11-30 19:56 ` [PATCH 22/25] dynamic_debug: add modname arg to exec_query callchain jim.cromie
2011-11-30 19:56 ` [PATCH 23/25] dynamic_debug: allow wildcard modname in boot-line query jim.cromie
2011-11-30 19:56 ` [PATCH 24/25] kernel/module: replace DEBUGP with pr_debug jim.cromie
2011-11-30 19:56 ` [PATCH 25/25] dynamic_debug: protect "dyndbg" fake module param name at compile-time jim.cromie
2011-12-01 21:20 ` [patch 00/25] dynamic-debug during module initialization Jason Baron
2011-12-03 15:56 ` Jim Cromie
[not found] ` <201203051614.29457.trenn@suse.de>
[not found] ` <CAJfuBxw=kL5j2VNxXLqiY3ftY3n7MQnY5SkfB09Nscyw8Fh9Zw@mail.gmail.com>
[not found] ` <201203061002.57810.trenn@suse.de>
[not found] ` <20120306144754.GA2421@redhat.com>
2012-03-07 0:30 ` [PATCH 18/25] dynamic_debug: Introduce global fake module param module.ddebug Rusty Russell
-- strict thread matches above, loose matches on Subject: below --
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 04/25] dynamic_debug: make dynamic-debug supersede DEBUG ccflag jim.cromie
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 04/25] dynamic_debug: make dynamic-debug supersede DEBUG ccflag 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=20111130220351.GC2500@redhat.com \
--to=jbaron@redhat.com \
--cc=bart.vanassche@gmail.com \
--cc=greg@kroah.com \
--cc=jim.cromie@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/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