diff options
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 | ||