Date: Mon, 31 Jul 2017 00:59:28 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321744 - head/sys/kern Message-ID: <201707310059.v6V0xSU1040027@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Jul 31 00:59:28 2017 New Revision: 321744 URL: https://svnweb.freebsd.org/changeset/base/321744 Log: Correct the predicates on which lockstat:::{thread,spin}-spin fire. In particular, they should fire only if the lock was owned by another thread when we first attempted to acquire that lock. MFC after: 1 week Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Mon Jul 31 00:54:50 2017 (r321743) +++ head/sys/kern/kern_mutex.c Mon Jul 31 00:59:28 2017 (r321744) @@ -766,7 +766,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, contested, waittime, file, line); #ifdef KDTRACE_HOOKS - if (spin_time != 0) + if (lda.spin_cnt != 0) LOCKSTAT_RECORD1(spin__spin, m, spin_time); #endif } @@ -879,7 +879,7 @@ retry: LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, contested, waittime, file, line); #ifdef KDTRACE_HOOKS - if (spin_time != 0) + if (lda.spin_cnt != 0) LOCKSTAT_RECORD1(thread__spin, m, spin_time); #endif }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707310059.v6V0xSU1040027>