path: root/sys/sys/lock.h
diff options
authorKip Macy <kmacy@FreeBSD.org>2006-11-11 03:18:07 +0000
committerKip Macy <kmacy@FreeBSD.org>2006-11-11 03:18:07 +0000
commit7c0435b93397740dfc0a916712ce03421b08d08a (patch)
treef43d5c4ecffd369fdc72c9807d30ffd296fd76f6 /sys/sys/lock.h
parent1cede0c9bd09db0c031c28ab29cdac914c5a1354 (diff)
MUTEX_PROFILING has been generalized to LOCK_PROFILING. We now profile
wait (time waited to acquire) and hold times for *all* kernel locks. If the architecture has a system synchronized TSC, the profiling code will use that - thereby minimizing profiling overhead. Large chunks of profiling code have been moved out of line, the overhead measured on the T1 for when it is compiled in but not enabled is < 1%. Approved by: scottl (standing in for mentor rwatson) Reviewed by: des and jhb
Notes: svn path=/head/; revision=164159
Diffstat (limited to 'sys/sys/lock.h')
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index b10b54abf2ae..9ca937612cff 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -69,6 +69,7 @@ struct lock_class {
#define LO_DUPOK 0x00400000 /* Don't check for duplicate acquires */
#define LO_ENROLLPEND 0x00800000 /* On the pending enroll list. */
#define LO_CLASSMASK 0x0f000000 /* Class index bitmask. */
+#define LO_NOPROFILE 0x10000000 /* Don't profile this lock */
* Lock classes are statically assigned an index into the gobal lock_classes
@@ -142,7 +143,7 @@ struct lock_list_entry {
* 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(MUTEX_PROFILING)
+#if defined(KLD_MODULE) || defined(WITNESS) || defined(INVARIANTS) || defined(INVARIANT_SUPPORT) || defined(KTR) || defined(LOCK_PROFILING)
#define LOCK_DEBUG 1
#define LOCK_DEBUG 0