Guard the lockstat:::thread-spin probe with KDTRACE_HOOKS.

X-MFC-With:	r300103
This commit is contained in:
Mark Johnston 2016-05-18 03:23:07 +00:00
parent 156fbc14a0
commit 5002e19502
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=300104

View File

@ -714,8 +714,10 @@ thread_lock_flags_(struct thread *td, int opts, const char *file, int line)
LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file,
line);
WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line);
#ifdef KDTRACE_HOOKS
if (spin_time != 0)
LOCKSTAT_RECORD1(thread__spin, m, spin_time);
#endif
}
struct mtx *