summaryrefslogtreecommitdiffstats
path: root/sys/cddl/dev
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2013-08-06 15:51:56 +0000
committeravg <avg@FreeBSD.org>2013-08-06 15:51:56 +0000
commita07c9d34c39b8316691600e021968b318b087434 (patch)
tree43da06fcd1bc6c1b678d5db8fc0a0a2cfcf19f6e /sys/cddl/dev
parentcd60e1fa27e6b6272254aba34a77694d9954788c (diff)
downloadFreeBSD-src-a07c9d34c39b8316691600e021968b318b087434.zip
FreeBSD-src-a07c9d34c39b8316691600e021968b318b087434.tar.gz
opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG
Do this by forcing inclusion of sys/cddl/compat/opensolaris/sys/debug_compat.h via -include option into all source files from OpenSolaris. Note that this -include option must always be after -include opt_global.h. Additionally, remove forced definition of DEBUG for some modules and fix their build without DEBUG. Also, meaning of DEBUG was overloaded to enable WITNESS support for some OpenSolaris (primarily ZFS) locks. Now this overloading is removed and that use of DEBUG is replaced with a new option OPENSOLARIS_WITNESS. MFC after: 17 days
Diffstat (limited to 'sys/cddl/dev')
-rw-r--r--sys/cddl/dev/dtrace/dtrace_load.c2
-rw-r--r--sys/cddl/dev/dtrace/dtrace_unload.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/cddl/dev/dtrace/dtrace_load.c b/sys/cddl/dev/dtrace/dtrace_load.c
index 672945c..9c5681a 100644
--- a/sys/cddl/dev/dtrace/dtrace_load.c
+++ b/sys/cddl/dev/dtrace/dtrace_load.c
@@ -67,7 +67,9 @@ dtrace_load(void *dummy)
mutex_init(&dtrace_lock,"dtrace probe state", MUTEX_DEFAULT, NULL);
mutex_init(&dtrace_provider_lock,"dtrace provider state", MUTEX_DEFAULT, NULL);
mutex_init(&dtrace_meta_lock,"dtrace meta-provider state", MUTEX_DEFAULT, NULL);
+#ifdef DEBUG
mutex_init(&dtrace_errlock,"dtrace error lock", MUTEX_DEFAULT, NULL);
+#endif
mutex_enter(&dtrace_provider_lock);
mutex_enter(&dtrace_lock);
diff --git a/sys/cddl/dev/dtrace/dtrace_unload.c b/sys/cddl/dev/dtrace/dtrace_unload.c
index 2ebb52d..33d7c40 100644
--- a/sys/cddl/dev/dtrace/dtrace_unload.c
+++ b/sys/cddl/dev/dtrace/dtrace_unload.c
@@ -121,7 +121,9 @@ dtrace_unload()
mutex_destroy(&dtrace_meta_lock);
mutex_destroy(&dtrace_provider_lock);
mutex_destroy(&dtrace_lock);
+#ifdef DEBUG
mutex_destroy(&dtrace_errlock);
+#endif
/* Reset our hook for exceptions. */
dtrace_invop_uninit();
OpenPOWER on IntegriCloud