Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Aug 2021 19:45:44 GMT
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 428624130abf - main - Fix lockstat:::thread-spin dtrace probe with LOCK_PROFILING
Message-ID:  <202108021945.172Jjinc044955@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by vangyzen:

URL: https://cgit.FreeBSD.org/src/commit/?id=428624130abfc225b479a09a3060d0939569b1ea

commit 428624130abfc225b479a09a3060d0939569b1ea
Author:     Eric van Gyzen <vangyzen@FreeBSD.org>
AuthorDate: 2021-08-02 18:54:57 +0000
Commit:     Eric van Gyzen <vangyzen@FreeBSD.org>
CommitDate: 2021-08-02 19:44:23 +0000

    Fix lockstat:::thread-spin dtrace probe with LOCK_PROFILING
    
    The spinning start time is missing from the calculation due to a
    misplaced #endif.  Return the #endif where it's supposed to be.
    
    Submitted by:   Alexander Alexeev <aalexeev@isilon.com>
    Reviewed by:    bdrewery, mjg
    MFC after:      1 week
    Sponsored by:   Dell EMC Isilon
    Differential Revision: https://reviews.freebsd.org/D31384
---
 sys/kern/kern_mutex.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index d9db69e2ac09..a85420e62c7a 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -895,6 +895,8 @@ thread_lock_flags_(struct thread *td, int opts, const char *file, int line)
 	doing_lockprof = 1;
 #elif defined(KDTRACE_HOOKS)
 	doing_lockprof = lockstat_enabled;
+#endif
+#ifdef KDTRACE_HOOKS
 	if (__predict_false(doing_lockprof))
 		spin_time -= lockstat_nsecs(&td->td_lock->lock_object);
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108021945.172Jjinc044955>