Commit cc1092019ce3d9b3e85a285b41e852ff94a6b590
Committed by
Linus Torvalds
1 parent
8560ed6fa8
Exists in
master
and in
7 other branches
[PATCH] dm: add debug macro
Add CONFIG_DM_DEBUG and DMDEBUG() macro. Signed-off-by: Bryn Reeves <breeves@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 2 changed files with 13 additions and 0 deletions Side-by-side Diff
drivers/md/Kconfig
... | ... | @@ -201,6 +201,14 @@ |
201 | 201 | |
202 | 202 | If unsure, say N. |
203 | 203 | |
204 | +config DM_DEBUG | |
205 | + boolean "Device mapper debugging support" | |
206 | + depends on BLK_DEV_DM && EXPERIMENTAL | |
207 | + ---help--- | |
208 | + Enable this for messages that may help debug device-mapper problems. | |
209 | + | |
210 | + If unsure, say N. | |
211 | + | |
204 | 212 | config DM_CRYPT |
205 | 213 | tristate "Crypt target support" |
206 | 214 | depends on BLK_DEV_DM && EXPERIMENTAL |
drivers/md/dm.h
... | ... | @@ -21,6 +21,11 @@ |
21 | 21 | #define DMERR(f, arg...) printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) |
22 | 22 | #define DMWARN(f, arg...) printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) |
23 | 23 | #define DMINFO(f, arg...) printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) |
24 | +#ifdef CONFIG_DM_DEBUG | |
25 | +# define DMDEBUG(f, arg...) printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) | |
26 | +#else | |
27 | +# define DMDEBUG(f, arg...) do {} while (0) | |
28 | +#endif | |
24 | 29 | |
25 | 30 | #define DMEMIT(x...) sz += ((sz >= maxlen) ? \ |
26 | 31 | 0 : scnprintf(result + sz, maxlen - sz, x)) |