summaryrefslogtreecommitdiffstats
path: root/sys/sys/lock.h
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-12-02 22:34:47 +0000
committerattilio <attilio@FreeBSD.org>2013-12-02 22:34:47 +0000
commitb07191879f76139f3566e59eff6486140b735878 (patch)
tree98cb33d360b17393e49c674384b0c432ab1591e9 /sys/sys/lock.h
parent23959fb966a47efaa57b50c709a012e99439e601 (diff)
downloadFreeBSD-src-b07191879f76139f3566e59eff6486140b735878.zip
FreeBSD-src-b07191879f76139f3566e59eff6486140b735878.tar.gz
Right now LOCK_DEBUG is enabled if KTR is on.
This is to support LOCK_LOG_* functionality effectively in debugging environments but it is overkill because really LOCK_DEBUG should be on only if (KTR_COMPILE & KTR_LOCK) is true. Fix this by applying the correct logic. In this process, move the KTR classes to its own header to reduce namespace pollution. Sponsored by: EMC / Isilon storage division Reviewed by: jhb
Diffstat (limited to 'sys/sys/lock.h')
-rw-r--r--sys/sys/lock.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index 58343b5..4ff0e79 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -34,6 +34,7 @@
#include <sys/queue.h>
#include <sys/_lock.h>
+#include <sys/ktr_class.h>
struct lock_list_entry;
struct thread;
@@ -123,7 +124,7 @@ struct lock_class {
* calling conventions for this debugging code in modules so that modules can
* work with both debug and non-debug kernels.
*/
-#if defined(KLD_MODULE) || defined(WITNESS) || defined(INVARIANTS) || defined(INVARIANT_SUPPORT) || defined(KTR) || defined(LOCK_PROFILING)
+#if defined(KLD_MODULE) || defined(WITNESS) || defined(INVARIANTS) || defined(INVARIANT_SUPPORT) || defined(LOCK_PROFILING) || (defined(KTR) && (KTR_COMPILE & KTR_LOCK))
#define LOCK_DEBUG 1
#else
#define LOCK_DEBUG 0
OpenPOWER on IntegriCloud