Skip to contentSkip to conversation

dm: add debug macro

PATCH In review Alasdair G Kergon 1 participant 1 message Sep 14, 2006

Subsystems (2)
lore
Share & tools
lore

Alasdair G Kergon

author maintainer
#0 lore raw

PATCH 16/25 dm: add debug macro

From: Bryn Reeves <[email protected]>

Add CONFIG_DM_DEBUG and DMDEBUG() macro.

drivers/md/Kconfig +8 -0
Index: linux-2.6.18-rc7/drivers/md/Kconfig
===================================================================
@@ -199,6 +199,14 @@ config BLK_DEV_DM
 
 	  If unsure, say N.
 
+config DM_DEBUG
+	boolean "Device mapper debugging support"
+	depends on BLK_DEV_DM && EXPERIMENTAL
+	---help---
+	  Enable this for messages that may help debug device-mapper problems.
+
+	  If unsure, say N.
+
 config DM_CRYPT
 	tristate "Crypt target support"
 	depends on BLK_DEV_DM && EXPERIMENTAL
drivers/md/dm.h +5 -0
Index: linux-2.6.18-rc7/drivers/md/dm.h
===================================================================
@@ -21,6 +21,11 @@
 #define DMERR(f, arg...) printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
 #define DMWARN(f, arg...) printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
 #define DMINFO(f, arg...) printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
+#ifdef CONFIG_DM_DEBUG
+#  define DMDEBUG(f, arg...) printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg)
+#else
+#  define DMDEBUG(f, arg...) do {} while (0)
+#endif
 
 #define DMEMIT(x...) sz += ((sz >= maxlen) ? \
 			  0 : scnprintf(result + sz, maxlen - sz, x))