diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2011-12-19 17:11:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-24 15:46:44 -0500 |
commit | b558c96ffa53f4b3dd52b774e4fb7a52982ab52b (patch) | |
tree | c178b95b2f1bb9e146d4f33f287ab37c2dab119a /include/linux/printk.h | |
parent | 87e6f968339bcdda56b39572c7e63331192296a0 (diff) |
dynamic_debug: make dynamic-debug supersede DEBUG ccflag
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: David Miller <davem@davemloft.net>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/printk.h')
-rw-r--r-- | include/linux/printk.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h index f0e22f75143f..f9abd9357a0c 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -180,13 +180,13 @@ extern void dump_stack(void) __cold; | |||
180 | #endif | 180 | #endif |
181 | 181 | ||
182 | /* If you are writing a driver, please use dev_dbg instead */ | 182 | /* If you are writing a driver, please use dev_dbg instead */ |
183 | #if defined(DEBUG) | 183 | #if defined(CONFIG_DYNAMIC_DEBUG) |
184 | #define pr_debug(fmt, ...) \ | ||
185 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
186 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
187 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | 184 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ |
188 | #define pr_debug(fmt, ...) \ | 185 | #define pr_debug(fmt, ...) \ |
189 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | 186 | dynamic_pr_debug(fmt, ##__VA_ARGS__) |
187 | #elif defined(DEBUG) | ||
188 | #define pr_debug(fmt, ...) \ | ||
189 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
190 | #else | 190 | #else |
191 | #define pr_debug(fmt, ...) \ | 191 | #define pr_debug(fmt, ...) \ |
192 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | 192 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |