aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/zfs_debug.h
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2013-10-08 22:37:38 -0400
committerBrian Behlendorf <[email protected]>2013-10-29 15:06:18 -0700
commit495b25a91a8f29aeec9e2965752a1fc9b9569583 (patch)
treef6fb85574dd97f587f627eecb7cfef1da5678353 /include/sys/zfs_debug.h
parent632a242e8352f0a4684f41286a288689f97e504b (diff)
Add missing code to zfs_debug.{c,h}
This is required to make Illumos 3962 merge. Signed-off-by: Richard Yao <[email protected]>
Diffstat (limited to 'include/sys/zfs_debug.h')
-rw-r--r--include/sys/zfs_debug.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/include/sys/zfs_debug.h b/include/sys/zfs_debug.h
index 7632d7420..41e8c08a1 100644
--- a/include/sys/zfs_debug.h
+++ b/include/sys/zfs_debug.h
@@ -20,11 +20,16 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
*/
#ifndef _SYS_ZFS_DEBUG_H
#define _SYS_ZFS_DEBUG_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef TRUE
#define TRUE 1
#endif
@@ -36,6 +41,7 @@
/*
* ZFS debugging - Always enabled for user space builds.
*/
+
#if !defined(ZFS_DEBUG) && !defined(_KERNEL)
#define ZFS_DEBUG
#endif
@@ -75,9 +81,28 @@ extern int zfs_recover;
#endif /* _KERNEL */
-void zfs_panic_recover(const char *fmt, ...);
-#define zfs_dbgmsg(...) dprintf(__VA_ARGS__)
-void zfs_dbgmsg_init(void);
-void zfs_dbgmsg_fini(void);
+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;
+
+extern void zfs_dbgmsg_init(void);
+extern void zfs_dbgmsg_fini(void);
+#if defined(_KERNEL) && defined(__linux__)
+#define zfs_dbgmsg(...) dprintf(__VA_ARGS__)
+#else
+extern void zfs_dbgmsg(const char *fmt, ...);
+#endif
+
+#ifndef _KERNEL
+extern int dprintf_find_string(const char *string);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
#endif /* _SYS_ZFS_DEBUG_H */