Skip to contentSkip to conversation

: Debugging Feature Negotiation

PATCH In review Gerrit Renker 2 participants 2 messages Oct 3, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 14/14 : Debugging Feature Negotiation

[DCCP]: Debugging Feature Negotiation

Since all feature-negotiation processing now takes place in feat.c, functions for producing verbose debugging output can be concentrated there. A number of functions to print out values, entry records, and options are provided.

A new macro was defined to not always have the function name in the output line. I have refrained from naming it dccp_pr_debug_dog ...

---
 net/dccp/dccp.h    |    2 
 net/dccp/feat.c    |  151 +++++++++++++++++++++++++++++++++++++----------------
 net/dccp/feat.h    |   13 ----
 net/dccp/options.c |    4 -
 4 files changed, 109 insertions(+), 61 deletions(-)
net/dccp/dccp.h +2 -0
@@ -42,9 +42,11 @@
 extern int dccp_debug;
 #define dccp_pr_debug(format, a...)	  DCCP_PR_DEBUG(dccp_debug, format, ##a)
 #define dccp_pr_debug_cat(format, a...)   DCCP_PRINTK(dccp_debug, format, ##a)
+#define dccp_debug(fmt, a...)		  dccp_pr_debug_cat(KERN_DEBUG fmt, ##a)
 #else
 #define dccp_pr_debug(format, a...)
 #define dccp_pr_debug_cat(format, a...)
+#define dccp_debug(format, a...)
 #endif
 
 extern struct inet_hashinfo dccp_hashinfo;
net/dccp/feat.c +107 -44

202 lines not on this page · raw message

net/dccp/options.c +0 -4
@@ -484,10 +484,6 @@ int dccp_insert_fn_opt(struct sk_buff *s
 		*to++ = *val;
 	if (len)
 		memcpy(to, val, len);
-
-	dccp_pr_debug("%s(%s (%d), ...), length %d\n",
-		      dccp_feat_typename(type),
-		      dccp_feat_name(feat), feat, len);
 	return 0;
 }
 
net/dccp/feat.h +0 -13
@@ -97,19 +97,6 @@ extern int sysctl_dccp_feat_rx_ccid;
 extern int sysctl_dccp_feat_tx_ccid;
 extern int sysctl_dccp_feat_send_ndp_count;
 
-#ifdef CONFIG_IP_DCCP_DEBUG
-extern const char *dccp_feat_typename(const u8 type);
-extern const char *dccp_feat_name(const u8 feat);
-
-static inline void dccp_feat_debug(const u8 type, const u8 feat, const u8 val)
-{
-	dccp_pr_debug("%s(%s (%d), %d)\n", dccp_feat_typename(type),
-					   dccp_feat_name(feat), feat, val);
-}
-#else
-#define dccp_feat_debug(type, feat, val)
-#endif /* CONFIG_IP_DCCP_DEBUG */
-
 extern int  dccp_feat_init(struct sock *sk);
 extern void dccp_feat_initialise_sysctls(void);
 extern int  dccp_feat_register_change(struct sock *sk, u8 feat,
Acked-by on v1 14/14
#1 lore raw
Quoted 10 lines · Gerrit Renker

[DCCP]: Debugging Feature Negotiation

Since all feature-negotiation processing now takes place in feat.c, functions for producing verbose debugging output can be concentrated there. A number of functions to print out values, entry records, and options are provided.

A new macro was defined to not always have the function name in the output line. I have refrained from naming it dccp_pr_debug_dog ...