Skip to contentSkip to conversation

vb2: use pr_info instead of pr_debug

RFC PATCH In review Hans Verkuil 2 participants 2 messages Aug 8, 2014 – Aug 18, 2014 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 vb2: use pr_info instead of pr_debug

Modern kernels enable dynamic printk support, which is fine, except when it is combined with a debug module option. Enabling debug in videobuf2-core now produces no debugging unless it is also enabled through the dynamic printk support in debugfs.

Either use a debug module option + pr_info, or use pr_debug without a debug module option. In this case the fact that you can set various debug levels is very useful, so I believe that for videobuf2-core.c we should use pr_info.

The mix of the two is very confusing: I've spent too much time already trying to figure out why I am not seeing any debug output in the kernel log when I do:

echo 1 >/sys/modules/videobuf2_core/parameters/debug

drivers/media/v4l2-core/videobuf2-core.c +1 -1
index 0e3d927..0b59735 100644
@@ -36,7 +36,7 @@ module_param(debug, int, 0644);
 #define dprintk(level, fmt, arg...)					      \
 	do {								      \
 		if (debug >= level)					      \
-			pr_debug("vb2: %s: " fmt, __func__, ## arg); \
+			pr_info("vb2: %s: " fmt, __func__, ## arg); \
 	} while (0)
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 8 lines · Hans Verkuil

Modern kernels enable dynamic printk support, which is fine, except when it is combined with a debug module option. Enabling debug in videobuf2-core now produces no debugging unless it is also enabled through the dynamic printk support in debugfs.

Either use a debug module option + pr_info, or use pr_debug without a debug module option. In this case the fact that you can set various debug levels is very useful, so I believe that for videobuf2-core.c we should use pr_info.

Quoted 6 lines

The mix of the two is very confusing: I've spent too much time already trying to figure out why I am not seeing any debug output in the kernel log when I do:

echo 1 >/sys/modules/videobuf2_core/parameters/debug

Quoted 6 lines
drivers/media/v4l2-core/videobuf2-core.c +0 -0
index 0e3d927..0b59735 100644

drivers/media/v4l2-core/videobuf2-core.c module_param(debug, int, 0644); · line 42

Quoted 8 lines
drivers/media/v4l2-core/videobuf2-core.c +1 -1
@@ -36,7 +36,7 @@ module_param(debug, int, 0644);
  #define dprintk(level, fmt, arg...)					      \
  	do {								      \
  		if (debug >= level)					      \
-			pr_debug("vb2: %s: " fmt, __func__, ## arg); \
+			pr_info("vb2: %s: " fmt, __func__, ## arg); \
  	} while (0)
 
  #ifdef CONFIG_VIDEO_ADV_DEBUG

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland