git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Illumos #1936: add support for "-t <datatype>" argument to zfs get
[zfs.git]
/
include
/
sys
/
zfs_debug.h
diff --git
a/include/sys/zfs_debug.h
b/include/sys/zfs_debug.h
index
f08d7cd
..
591d0df
100644
(file)
--- a/
include/sys/zfs_debug.h
+++ b/
include/sys/zfs_debug.h
@@
-25,10
+25,6
@@
#ifndef _SYS_ZFS_DEBUG_H
#define _SYS_ZFS_DEBUG_H
#ifndef _SYS_ZFS_DEBUG_H
#define _SYS_ZFS_DEBUG_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifndef TRUE
#define TRUE 1
#endif
#ifndef TRUE
#define TRUE 1
#endif
@@
-38,14
+34,14
@@
extern "C" {
#endif
/*
#endif
/*
- * ZFS debugging
+ * ZFS debugging
- Always enabled for user space builds.
*/
*/
-
-#if defined(DEBUG) || !defined(_KERNEL)
+#if !defined(ZFS_DEBUG) && !defined(_KERNEL)
#define ZFS_DEBUG
#endif
extern int zfs_flags;
#define ZFS_DEBUG
#endif
extern int zfs_flags;
+extern int zfs_recover;
#define ZFS_DEBUG_DPRINTF 0x0001
#define ZFS_DEBUG_DBUF_VERIFY 0x0002
#define ZFS_DEBUG_DPRINTF 0x0001
#define ZFS_DEBUG_DBUF_VERIFY 0x0002
@@
-53,43
+49,33
@@
extern int zfs_flags;
#define ZFS_DEBUG_SNAPNAMES 0x0008
#define ZFS_DEBUG_MODIFY 0x0010
#define ZFS_DEBUG_SNAPNAMES 0x0008
#define ZFS_DEBUG_MODIFY 0x0010
-#ifdef ZFS_DEBUG
-#if defined(_KERNEL) && defined(HAVE_SPL)
/*
/*
- * Log ZFS debug messages as the spl SS_USER1 subsystem.
+ * Always log zfs debug messages to the spl debug subsystem as SS_USER1.
+ * When the SPL is configured with debugging enabled these messages will
+ * appear in the internal spl debug log, otherwise they are a no-op.
*/
*/
+#if defined(_KERNEL)
+
#include <spl-debug.h>
#include <spl-debug.h>
+#define dprintf(...) \
+ if (zfs_flags & ZFS_DEBUG_DPRINTF) \
+ __SDEBUG(NULL, SS_USER1, SD_DPRINTF, __VA_ARGS__)
-#ifdef SS_DEBUG_SUBSYS
-#undef SS_DEBUG_SUBSYS
-#endif
-#define SS_DEBUG_SUBSYS SS_USER1
-#define dprintf(...) SDEBUG_LIMIT(SD_DPRINTF, __VA_ARGS__)
+/*
+ * When zfs is running is user space the debugging is always enabled.
+ * The messages will be printed using the __dprintf() function and
+ * filtered based on the zfs_flags variable.
+ */
#else
#else
-extern void __dprintf(const char *file, const char *func,
- int line, const char *fmt, ...);
-#define dprintf(...) \
- if (zfs_flags & ZFS_DEBUG_DPRINTF) \
+#define dprintf(...) \
+ if (zfs_flags & ZFS_DEBUG_DPRINTF) \
__dprintf(__FILE__, __func__, __LINE__, __VA_ARGS__)
__dprintf(__FILE__, __func__, __LINE__, __VA_ARGS__)
-#endif /* _KERNEL && HAVE_SPL */
-#else
-#define dprintf(...) ((void)0)
-#endif /* ZFS_DEBUG */
-
-extern void zfs_panic_recover(const char *fmt, ...);
-typedef struct zfs_dbgmsg {
- list_node_t zdm_node;
- time_t zdm_timestamp;
- char zdm_msg[1]; /* variable length allocation */
-} zfs_dbgmsg_t;
+#endif /* _KERNEL */
-extern void zfs_dbgmsg_init(void);
-extern void zfs_dbgmsg_fini(void);
-extern void zfs_dbgmsg(const char *fmt, ...);
-
-#ifdef __cplusplus
-}
-#endif
+void zfs_panic_recover(const char *fmt, ...);
+#define zfs_dbgmsg(...) dprintf(__VA_ARGS__)
+void zfs_dbgmsg_init(void);
+void zfs_dbgmsg_fini(void);
#endif /* _SYS_ZFS_DEBUG_H */
#endif /* _SYS_ZFS_DEBUG_H */