aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dynamic_debug.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-08-11 14:36:21 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-22 21:23:04 -0400
commitcbc4663552ee476f57933920d782222d94878e7e (patch)
tree7fa60ec28e53114d239137b7cea65c66da15040c /include/linux/dynamic_debug.h
parent25b8a88c10770e8c3f14bf2e222691dc6e79de78 (diff)
dynamic_debug: Add __dynamic_dev_dbg
Unlike dynamic_pr_debug, dynamic uses of dev_dbg can not currently add task_pid/KBUILD_MODNAME/__func__/__LINE__ to selected debug output. Add a new function similar to dynamic_pr_debug to optionally emit these prefixes. Cc: Aloisio Almeida <aloisio.almeida@openbossa.org> Noticed-by: Aloisio Almeida <aloisio.almeida@openbossa.org> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/dynamic_debug.h')
-rw-r--r--include/linux/dynamic_debug.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index e747ecd48e1c..bdf15319944e 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -47,6 +47,13 @@ extern int ddebug_remove_module(const char *mod_name);
47extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...) 47extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
48 __attribute__ ((format (printf, 2, 3))); 48 __attribute__ ((format (printf, 2, 3)));
49 49
50struct device;
51
52extern int __dynamic_dev_dbg(struct _ddebug *descriptor,
53 const struct device *dev,
54 const char *fmt, ...)
55 __attribute__ ((format (printf, 3, 4)));
56
50#define dynamic_pr_debug(fmt, ...) do { \ 57#define dynamic_pr_debug(fmt, ...) do { \
51 static struct _ddebug descriptor \ 58 static struct _ddebug descriptor \
52 __used \ 59 __used \
@@ -57,7 +64,6 @@ extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
57 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \ 64 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \
58 } while (0) 65 } while (0)
59 66
60
61#define dynamic_dev_dbg(dev, fmt, ...) do { \ 67#define dynamic_dev_dbg(dev, fmt, ...) do { \
62 static struct _ddebug descriptor \ 68 static struct _ddebug descriptor \
63 __used \ 69 __used \
@@ -65,7 +71,7 @@ extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
65 { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ 71 { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \
66 _DPRINTK_FLAGS_DEFAULT }; \ 72 _DPRINTK_FLAGS_DEFAULT }; \
67 if (unlikely(descriptor.enabled)) \ 73 if (unlikely(descriptor.enabled)) \
68 dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ 74 __dynamic_dev_dbg(&descriptor, dev, fmt, ##__VA_ARGS__); \
69 } while (0) 75 } while (0)
70 76
71#else 77#else