summaryrefslogtreecommitdiffstats
path: root/sys/sys/mutex.h
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2015-07-19 22:14:09 +0000
committermarkj <markj@FreeBSD.org>2015-07-19 22:14:09 +0000
commitfb4cb70b7d3b8771f051726851f280a5684263db (patch)
treef4dbaff3eee7463b0bc4a1e309dee981d6aaba59 /sys/sys/mutex.h
parent34ac7bd4d308634de1d2248b083ab98fc3d7ad28 (diff)
downloadFreeBSD-src-fb4cb70b7d3b8771f051726851f280a5684263db.zip
FreeBSD-src-fb4cb70b7d3b8771f051726851f280a5684263db.tar.gz
Implement the lockstat provider using SDT(9) instead of the custom provider
in lockstat.ko. This means that lockstat probes now have typed arguments and will utilize SDT probe hot-patching support when it arrives. Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D2993
Diffstat (limited to 'sys/sys/mutex.h')
-rw-r--r--sys/sys/mutex.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h
index ec0c241..a9ec072 100644
--- a/sys/sys/mutex.h
+++ b/sys/sys/mutex.h
@@ -188,8 +188,8 @@ void thread_lock_flags_(struct thread *, int, const char *, int);
if (!_mtx_obtain_lock((mp), _tid)) \
_mtx_lock_sleep((mp), _tid, (opts), (file), (line)); \
else \
- LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_LOCK_ACQUIRE, \
- mp, 0, 0, (file), (line)); \
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, \
+ mp, 0, 0, file, line); \
} while (0)
/*
@@ -209,8 +209,8 @@ void thread_lock_flags_(struct thread *, int, const char *, int);
else \
_mtx_lock_spin((mp), _tid, (opts), (file), (line)); \
} else \
- LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_SPIN_LOCK_ACQUIRE, \
- mp, 0, 0, (file), (line)); \
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, \
+ mp, 0, 0, file, line); \
} while (0)
#else /* SMP */
#define __mtx_lock_spin(mp, tid, opts, file, line) do { \
@@ -231,8 +231,7 @@ void thread_lock_flags_(struct thread *, int, const char *, int);
uintptr_t _tid = (uintptr_t)(tid); \
\
if ((mp)->mtx_recurse == 0) \
- LOCKSTAT_PROFILE_RELEASE_LOCK(LS_MTX_UNLOCK_RELEASE, \
- (mp)); \
+ LOCKSTAT_PROFILE_RELEASE_LOCK(adaptive__release, mp); \
if (!_mtx_release_lock((mp), _tid)) \
_mtx_unlock_sleep((mp), (opts), (file), (line)); \
} while (0)
@@ -252,21 +251,19 @@ void thread_lock_flags_(struct thread *, int, const char *, int);
if (mtx_recursed((mp))) \
(mp)->mtx_recurse--; \
else { \
- LOCKSTAT_PROFILE_RELEASE_LOCK(LS_MTX_SPIN_UNLOCK_RELEASE, \
- mp); \
+ LOCKSTAT_PROFILE_RELEASE_LOCK(spin__release, mp); \
_mtx_release_lock_quick((mp)); \
- } \
- spinlock_exit(); \
+ } \
+ spinlock_exit(); \
} while (0)
#else /* SMP */
#define __mtx_unlock_spin(mp) do { \
if (mtx_recursed((mp))) \
(mp)->mtx_recurse--; \
else { \
- LOCKSTAT_PROFILE_RELEASE_LOCK(LS_MTX_SPIN_UNLOCK_RELEASE, \
- mp); \
+ LOCKSTAT_PROFILE_RELEASE_LOCK(spin__release, mp); \
(mp)->mtx_lock = MTX_UNOWNED; \
- } \
+ } \
spinlock_exit(); \
} while (0)
#endif /* SMP */
OpenPOWER on IntegriCloud