summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorBrian Behlendorf <behlendorf1@llnl.gov>2010-08-26 18:44:12 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2010-08-31 20:41:50 +0000
commit47d0ed1e6f8a8ee67492ec63173a27df8e4ca059 (patch)
tree79cdf11f400a672b7a5b664067c6e14e4b418129 /module
parent2eadf037f5ae2735bcbc61e3bb2974c6d3235b8e (diff)
Diffstat (limited to 'module')
-rw-r--r--module/zfs/include/sys/zfs_debug.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/module/zfs/include/sys/zfs_debug.h b/module/zfs/include/sys/zfs_debug.h
index 50ecf9b36249..f08d7cd2bc8e 100644
--- a/module/zfs/include/sys/zfs_debug.h
+++ b/module/zfs/include/sys/zfs_debug.h
@@ -54,11 +54,24 @@ extern int zfs_flags;
#define ZFS_DEBUG_MODIFY 0x0010
#ifdef ZFS_DEBUG
+#if defined(_KERNEL) && defined(HAVE_SPL)
+/*
+ * Log ZFS debug messages as the spl SS_USER1 subsystem.
+ */
+#include <spl-debug.h>
+
+#ifdef SS_DEBUG_SUBSYS
+#undef SS_DEBUG_SUBSYS
+#endif
+#define SS_DEBUG_SUBSYS SS_USER1
+#define dprintf(...) SDEBUG_LIMIT(SD_DPRINTF, __VA_ARGS__)
+#else
extern void __dprintf(const char *file, const char *func,
int line, const char *fmt, ...);
#define dprintf(...) \
if (zfs_flags & ZFS_DEBUG_DPRINTF) \
__dprintf(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#endif /* _KERNEL && HAVE_SPL */
#else
#define dprintf(...) ((void)0)
#endif /* ZFS_DEBUG */