Skip to contentSkip to conversation

net/dccp: always log debug messages when CONFIG_DEBUG is set

RFC PATCH New Gerrit Renker 1 participant 1 message Sep 30, 2006 Networking

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 net/dccp: always log debug messages when CONFIG_DEBUG is set

This disables the integer (module) parameter dccp_debug which is used to toggle debugging messages when configured with CONFIG_IP_DCCP_DEBUG.

Justification: Not possible to toggle debug mode when dccp is statically
compiled into the kernel; also when user forgets to explicitly load all modules and module loading is triggered by socket create function, debug is off; in summary, it makes debugging much faster to use.

--

 ackvec.c |    3 ---
 dccp.h   |    9 +++------
 proto.c  |    8 --------
 3 files changed, 3 insertions(+), 17 deletions(-)
net/dccp/ackvec.c +0 -3
index c0cb709..01345df 100644
@@ -322,9 +322,6 @@ out_duplicate:
 #ifdef CONFIG_IP_DCCP_DEBUG
 void dccp_ackvector_print(const u64 ackno, const unsigned char *vector, int len)
 {
-	if (!dccp_debug)
-		return;
-
 	printk("ACK vector len=%d, ackno=%llu |", len,
 	       (unsigned long long)ackno);
 
net/dccp/dccp.h +3 -6
index 9f00dd8..8aa2697 100644
@@ -21,12 +21,9 @@ #include "ackvec.h"
 #ifdef CONFIG_IP_DCCP_DEBUG
 extern int dccp_debug;
 
-#define dccp_pr_debug(format, a...) \
-	do { if (dccp_debug) \
-		printk(KERN_DEBUG "%s: " format, __FUNCTION__ , ##a); \
-	} while (0)
-#define dccp_pr_debug_cat(format, a...) do { if (dccp_debug) \
-					     printk(format, ##a); } while (0)
+#define dccp_pr_debug(format, a...)     do { printk(KERN_DEBUG "%s: " format,\
+					     __FUNCTION__ , ##a); } while (0)
+#define dccp_pr_debug_cat(format, a...) do { printk(format, ##a); } while (0)
 #else
 #define dccp_pr_debug(format, a...)
 #define dccp_pr_debug_cat(format, a...)
net/dccp/proto.c +0 -8
index 2adfcd4..ffea66a 100644
@@ -949,14 +949,6 @@ static int thash_entries;
 module_param(thash_entries, int, 0444);
 MODULE_PARM_DESC(thash_entries, "Number of ehash buckets");
 
-#ifdef CONFIG_IP_DCCP_DEBUG
-int dccp_debug;
-module_param(dccp_debug, int, 0444);
-MODULE_PARM_DESC(dccp_debug, "Enable debug messages");
-
-EXPORT_SYMBOL_GPL(dccp_debug);
-#endif
-
 static int __init dccp_init(void)
 {
 	unsigned long goal;