summaryrefslogtreecommitdiff
path: root/mdmon.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-06-16 15:50:07 -0700
committerDan Williams <dan.j.williams@intel.com>2008-06-16 15:50:07 -0700
commit4e6e574a3e8eb2351ba1d850369630bf8879dfaf (patch)
treede7b753eaf5e22dff7e9232b2561e56eba510a49 /mdmon.h
parenta862209dc38f716db00365d5b5d3f24d3d0e6626 (diff)
mdmon: add debug print statements for profiling mdmon
for development only as console output can block leading to monitor deadlocks in low mem situations Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mdmon.h')
-rw-r--r--mdmon.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/mdmon.h b/mdmon.h
index 11320ef6..f1b6d76e 100644
--- a/mdmon.h
+++ b/mdmon.h
@@ -1,3 +1,10 @@
+#ifdef DEBUG
+#define dprintf(fmt, arg...) \
+ fprintf(stderr, fmt, ##arg)
+#else
+#define dprintf(fmt, arg...) \
+ ({ if (0) fprintf(stderr, fmt, ##arg); 0; })
+#endif
enum array_state { clear, inactive, suspended, readonly, read_auto,
clean, active, write_pending, active_idle, bad_word};