[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1213204329-10973-5-git-send-email-juliusv@google.com>
Date: Wed, 11 Jun 2008 19:11:47 +0200
From: "Julius R. Volz" <juliusv@...gle.com>
To: lvs-devel@...r.kernel.org, netdev@...r.kernel.org
Cc: horms@...ge.net.au, davem@...emloft.net, vbusam@...gle.com,
"Julius R. Volz" <juliusv@...gle.com>
Subject: [PATCH 04/26] IPVS: Add address family specific debugging macros.
Define debugging/error logging macros that only do something for a
specific address family. Avoids ugly conditionals in code using these
debugging macros.
Signed-off-by: Julius R. Volz <juliusv@...gle.com>
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index b7b181e..349a746 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -287,6 +287,24 @@ struct ip_vs_daemon_user {
#include <linux/net.h>
extern int ip_vs_get_debug_level(void);
+#define IP_VS_DBG_V4(af, level, msg...) \
+ do { \
+ if (af == AF_INET \
+ && level <= ip_vs_get_debug_level()) \
+ printk(KERN_DEBUG "IPVS: " msg); \
+ } while (0)
+
+#ifdef CONFIG_IP_VS_IPV6
+#define IP_VS_DBG_V6(af, level, msg...) \
+ do { \
+ if (af == AF_INET6 \
+ && level <= ip_vs_get_debug_level()) \
+ printk(KERN_DEBUG "IPVS: " msg); \
+ } while (0)
+#else
+#define IP_VS_DBG_V6(af, level, msg...) do {} while (0)
+#endif
+
#define IP_VS_DBG(level, msg...) \
do { \
if (level <= ip_vs_get_debug_level()) \
@@ -309,6 +327,8 @@ extern int ip_vs_get_debug_level(void);
pp->debug_packet(pp, skb, ofs, msg); \
} while (0)
#else /* NO DEBUGGING at ALL */
+#define IP_VS_DBG_V4(af, level, msg...) do {} while (0)
+#define IP_VS_DBG_V6(af, level, msg...) do {} while (0)
#define IP_VS_DBG(level, msg...) do {} while (0)
#define IP_VS_DBG_RL(msg...) do {} while (0)
#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) do {} while (0)
@@ -316,6 +336,20 @@ extern int ip_vs_get_debug_level(void);
#endif
#define IP_VS_BUG() BUG()
+#define IP_VS_ERR_V4(af, msg...) \
+ do { \
+ if (af == AF_INET) \
+ printk(KERN_ERR "IPVS: " msg); \
+ } while (0)
+#ifdef CONFIG_IP_VS_IPV6
+#define IP_VS_ERR_V6(af, msg...) \
+do { \
+ if (af == AF_INET6) \
+ printk(KERN_ERR "IPVS: " msg); \
+ } while (0)
+#else
+#define IP_VS_ERR_V6(af, msg...) do {} while (0)
+#endif
#define IP_VS_ERR(msg...) printk(KERN_ERR "IPVS: " msg)
#define IP_VS_INFO(msg...) printk(KERN_INFO "IPVS: " msg)
#define IP_VS_WARNING(msg...) \
--
1.5.3.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists