diff options
| author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-05-10 14:52:07 -0400 |
|---|---|---|
| committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-05-10 16:50:41 -0400 |
| commit | 020abf03cd659388f94cb328e1e1df0656e0d7ff (patch) | |
| tree | 40d05011708ad1b4a05928d167eb120420581aa6 /include/linux/dynamic_debug.h | |
| parent | 0ff8fbc61727c926883eec381fbd3d32d1fab504 (diff) | |
| parent | 693d92a1bbc9e42681c42ed190bd42b636ca876f (diff) | |
Merge tag 'v2.6.39-rc7'
in order to pull in changes in drivers/media/dvb/firewire/ and
sound/firewire/.
Diffstat (limited to 'include/linux/dynamic_debug.h')
| -rw-r--r-- | include/linux/dynamic_debug.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index a90b3892074a..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,36 +46,28 @@ 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 | __label__ do_printk; \ | ||
| 48 | __label__ out; \ | ||
| 49 | static struct _ddebug descriptor \ | 53 | static struct _ddebug descriptor \ |
| 50 | __used \ | 54 | __used \ |
| 51 | __attribute__((section("__verbose"), aligned(8))) = \ | 55 | __attribute__((section("__verbose"), aligned(8))) = \ |
| 52 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ | 56 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ |
| 53 | _DPRINTK_FLAGS_DEFAULT }; \ | 57 | _DPRINTK_FLAGS_DEFAULT }; \ |
| 54 | JUMP_LABEL(&descriptor.enabled, do_printk); \ | 58 | if (unlikely(descriptor.enabled)) \ |
| 55 | goto out; \ | 59 | __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \ |
| 56 | do_printk: \ | ||
| 57 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ | ||
| 58 | out: ; \ | ||
| 59 | } while (0) | 60 | } while (0) |
| 60 | 61 | ||
| 61 | 62 | ||
| 62 | #define dynamic_dev_dbg(dev, fmt, ...) do { \ | 63 | #define dynamic_dev_dbg(dev, fmt, ...) do { \ |
| 63 | __label__ do_printk; \ | ||
| 64 | __label__ out; \ | ||
| 65 | static struct _ddebug descriptor \ | 64 | static struct _ddebug descriptor \ |
| 66 | __used \ | 65 | __used \ |
| 67 | __attribute__((section("__verbose"), aligned(8))) = \ | 66 | __attribute__((section("__verbose"), aligned(8))) = \ |
| 68 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ | 67 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ |
| 69 | _DPRINTK_FLAGS_DEFAULT }; \ | 68 | _DPRINTK_FLAGS_DEFAULT }; \ |
| 70 | JUMP_LABEL(&descriptor.enabled, do_printk); \ | 69 | if (unlikely(descriptor.enabled)) \ |
| 71 | goto out; \ | 70 | dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ |
| 72 | do_printk: \ | ||
| 73 | dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ | ||
| 74 | out: ; \ | ||
| 75 | } while (0) | 71 | } while (0) |
| 76 | 72 | ||
| 77 | #else | 73 | #else |
