Skip to contentSkip to conversation

iio: add configuration option for debug support

DISCUSSION Greg KH 2 participants 2 messages Aug 5, 2013 IIO

lore
Share & tools
lore

Greg KH

author
#0 lore raw
Quoted 30 lines · Otavio Salvador
---
 drivers/iio/Kconfig  | 7 +++++++
 drivers/iio/Makefile | 2 ++
 2 files changed, 9 insertions(+)
drivers/iio/Kconfig +7 -0
index 524380c..b682f6f 100644
@@ -12,6 +12,13 @@ menuconfig IIO
 
 if IIO
 
+config IIO_DEBUG
+	boolean "Debug support for Industrial I/O"
+	depends on DEBUG_KERNEL
+	help
+	  Say "yes" to enable debug messaging (like dev_dbg and pr_debug)
+	  support in Industrial I/O subsystem and drivers.
+
 config IIO_BUFFER
 	bool "Enable buffer support within IIO"
 	help
drivers/iio/Makefile +0 -0
index 7a3866c..6e43e5b 100644

drivers/iio/Makefile line 5

Quoted 4 lines
drivers/iio/Makefile +1 -0
@@ -2,6 +2,8 @@
 # Makefile for the industrial I/O core.
 #
 
+ccflags-$(CONFIG_IIO_DEBUG) := -DDEBUG

No, please don't do this. I'm going to revert this patch, as iio, and the whole rest of the kernel, should be relying on the dynamic debug code. Don't force a user to rebuild their kernel to enable/disable debug stuff, that doesn't work well, if at all.

As it is, dev_dbg and pr_debug work just fine with dynamic debugging, no need to explicitly make a new Kconfig option and set the DEBUG flag on at all.

thanks,

greg k-h

#1 lore raw
Quoted 41 lines · Greg KH
Quoted 30 lines · Otavio Salvador
---
 drivers/iio/Kconfig  | 7 +++++++
 drivers/iio/Makefile | 2 ++
 2 files changed, 9 insertions(+)
drivers/iio/Kconfig +7 -0
index 524380c..b682f6f 100644
@@ -12,6 +12,13 @@ menuconfig IIO
 
 if IIO
 
+config IIO_DEBUG
+     boolean "Debug support for Industrial I/O"
+     depends on DEBUG_KERNEL
+     help
+       Say "yes" to enable debug messaging (like dev_dbg and pr_debug)
+       support in Industrial I/O subsystem and drivers.
+
 config IIO_BUFFER
      bool "Enable buffer support within IIO"
      help
drivers/iio/Makefile +0 -0
index 7a3866c..6e43e5b 100644

drivers/iio/Makefile line 5

Quoted 4 lines
drivers/iio/Makefile +1 -0
@@ -2,6 +2,8 @@
 # Makefile for the industrial I/O core.
 #
 
+ccflags-$(CONFIG_IIO_DEBUG) := -DDEBUG

No, please don't do this. I'm going to revert this patch, as iio, and the whole rest of the kernel, should be relying on the dynamic debug code. Don't force a user to rebuild their kernel to enable/disable debug stuff, that doesn't work well, if at all.

Quoted 3 lines

As it is, dev_dbg and pr_debug work just fine with dynamic debugging, no need to explicitly make a new Kconfig option and set the DEBUG flag on at all.

Thanks for the guidance Greg. Sorry for the hassle.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750