From 9eefcf316159b161b2c6e5143a8991bcb7e63711 Mon Sep 17 00:00:00 2001 From: kmacy Date: Sat, 11 Nov 2006 03:18:07 +0000 Subject: 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 --- sys/sys/lock.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/sys/lock.h') diff --git a/sys/sys/lock.h b/sys/sys/lock.h index b10b54a..9ca9376 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 #else #define LOCK_DEBUG 0 -- cgit v1.1