[Pvfs2-cvs] commit by vilayann in pvfs2/src/common/gossip: gossip.h
CVS commit program
cvs at parl.clemson.edu
Thu Aug 10 15:02:22 EDT 2006
Update of /anoncvs/pvfs2/src/common/gossip
In directory parlweb1:/tmp/cvs-serv12929/src/common/gossip
Modified Files:
gossip.h
Log Message:
Gossip'ized kmod as well so that we dont have 2 separate calls to printing diagnostics.
gossip for the kmod is fairly primitive and is handled simply by means of a macro in gossip.h.
Replaced and removed pvfs2_print and pvfs2_error with gossip_debug.
Edited quickstart to include comments on the new kmod debug parameters as well.
Index: gossip.h
===================================================================
RCS file: /anoncvs/pvfs2/src/common/gossip/gossip.h,v
diff -p -u -r1.16 -r1.17
--- gossip.h 5 Jun 2006 22:52:50 -0000 1.16
+++ gossip.h 10 Aug 2006 19:02:22 -0000 1.17
@@ -20,8 +20,10 @@
#ifndef __GOSSIP_H
#define __GOSSIP_H
+#ifndef __KERNEL__
#include <stdint.h>
#include "syslog.h"
+#endif
#include "pvfs2-config.h"
/********************************************************************
@@ -39,6 +41,34 @@ enum gossip_logstamp
};
#define GOSSIP_LOGSTAMP_DEFAULT GOSSIP_LOGSTAMP_USEC
+/* Keep a simplified version for the kmod */
+#ifdef __KERNEL__
+
+#ifdef GOSSIP_DISABLE_DEBUG
+#define gossip_debug(mask, format, f...) do {} while(0)
+#else
+extern int gossip_debug_mask;
+
+/* try to avoid function call overhead by checking masks in macro */
+#define gossip_debug(mask, format, f...) \
+do { \
+ if (gossip_debug_mask & mask) \
+ { \
+ printk(format, ##f); \
+ } \
+} while(0)
+#endif /* GOSSIP_DISABLE_DEBUG */
+
+/* do file and line number printouts w/ the GNU preprocessor */
+#define gossip_ldebug(mask, format, f...) \
+do { \
+ gossip_debug(mask, "%s: " format, __func__ , ##f); \
+} while(0)
+
+#define gossip_err printk
+
+#else
+
int gossip_enable_syslog(
int priority);
int gossip_enable_stderr(
@@ -154,6 +184,8 @@ int gossip_err(
#define gossip_lerr gossip_err
#endif /* __GNUC__ */
+
+#endif /* __KERNEL__ */
#endif /* __GOSSIP_H */
More information about the Pvfs2-cvs
mailing list