diff options
author | Bart Van Assche <bvanassche@acm.org> | 2011-01-23 11:17:24 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-03 18:39:16 -0500 |
commit | 8ba6ebf583f12da32036fc0f003ab4043e54692e (patch) | |
tree | 8fdd980d30fea50722b28fb5d782236174b2d188 /include/linux/dynamic_debug.h | |
parent | 9b99b7f84ea520d2ecaf816bde247a1ad07e454e (diff) |
Dynamic debug: Add more flags
Add flags that allow the user to specify via debugfs whether or not the
module name, function name, line number and/or thread ID have to be
included in the printed message.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Greg Banks <gnb@fmeh.org>
Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 | ||