diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2011-03-17 03:44:08 -0400 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-17 03:44:08 -0400 |
| commit | 1d2a1959fe534279cf37aba20b08c24c20840e52 (patch) | |
| tree | 67c0b9aa7fe22a44bf0b4af88947799203eb8f67 /include/linux/dynamic_debug.h | |
| parent | 5a79ce76e9bb8f4b2cd8106ee36d15ee05013bcf (diff) | |
| parent | 054cfaacf88865bff1dd58d305443d5d6c068a08 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into sh-latest
Diffstat (limited to 'include/linux/dynamic_debug.h')
| -rw-r--r-- | include/linux/dynamic_debug.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 1c70028f81f9..0c9653f11c18 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
| @@ -31,6 +31,10 @@ struct _ddebug { | |||
| 31 | * writes commands to <debugfs>/dynamic_debug/control | 31 | * writes commands to <debugfs>/dynamic_debug/control |
| 32 | */ | 32 | */ |
| 33 | #define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */ | 33 | #define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */ |
| 34 | #define _DPRINTK_FLAGS_INCL_MODNAME (1<<1) | ||
| 35 | #define _DPRINTK_FLAGS_INCL_FUNCNAME (1<<2) | ||
| 36 | #define _DPRINTK_FLAGS_INCL_LINENO (1<<3) | ||
| 37 | #define _DPRINTK_FLAGS_INCL_TID (1<<4) | ||
| 34 | #define _DPRINTK_FLAGS_DEFAULT 0 | 38 | #define _DPRINTK_FLAGS_DEFAULT 0 |
| 35 | unsigned int flags:8; | 39 | unsigned int flags:8; |
| 36 | char enabled; | 40 | char enabled; |
| @@ -42,6 +46,8 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n, | |||
| 42 | 46 | ||
| 43 | #if defined(CONFIG_DYNAMIC_DEBUG) | 47 | #if defined(CONFIG_DYNAMIC_DEBUG) |
| 44 | extern int ddebug_remove_module(const char *mod_name); | 48 | extern int ddebug_remove_module(const char *mod_name); |
| 49 | extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...) | ||
| 50 | __attribute__ ((format (printf, 2, 3))); | ||
| 45 | 51 | ||
| 46 | #define dynamic_pr_debug(fmt, ...) do { \ | 52 | #define dynamic_pr_debug(fmt, ...) do { \ |
| 47 | static struct _ddebug descriptor \ | 53 | static struct _ddebug descriptor \ |
| @@ -50,7 +56,7 @@ extern int ddebug_remove_module(const char *mod_name); | |||
| 50 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ | 56 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ |
| 51 | _DPRINTK_FLAGS_DEFAULT }; \ | 57 | _DPRINTK_FLAGS_DEFAULT }; \ |
| 52 | if (unlikely(descriptor.enabled)) \ | 58 | if (unlikely(descriptor.enabled)) \ |
| 53 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ | 59 | __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \ |
| 54 | } while (0) | 60 | } while (0) |
| 55 | 61 | ||
| 56 | 62 | ||
