Index: sys/kern/kern_rwlock.c =================================================================== --- sys/kern/kern_rwlock.c +++ sys/kern/kern_rwlock.c @@ -382,9 +382,6 @@ state = rw->rw_lock; #endif for (;;) { -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif /* * Handle the easy case. If no other thread has a write * lock, then try to bump up the count of read locks. Note @@ -413,6 +410,9 @@ } continue; } +#ifdef KDTRACE_HOOKS + spin_cnt++; +#endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif