aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sx.h
diff options
context:
space:
mode:
authorStacey Son <sson@FreeBSD.org>2009-05-26 20:28:22 +0000
committerStacey Son <sson@FreeBSD.org>2009-05-26 20:28:22 +0000
commita5aedd68b4eb5bb0cafdc51eb8f325c32543ad9a (patch)
treeb7873baadff878509f8c7b930ddeeaa84074e546 /sys/sys/sx.h
parente8cdb7739f0b50ae5650edc6207d6617770442f7 (diff)
downloadsrc-a5aedd68b4eb5bb0cafdc51eb8f325c32543ad9a.tar.gz
src-a5aedd68b4eb5bb0cafdc51eb8f325c32543ad9a.zip
Add the OpenSolaris dtrace lockstat provider. The lockstat provider
adds probes for mutexes, reader/writer and shared/exclusive locks to gather contention statistics and other locking information for dtrace scripts, the lockstat(1M) command and other potential consumers. Reviewed by: attilio jhb jb Approved by: gnn (mentor)
Notes
Notes: svn path=/head/; revision=192853
Diffstat (limited to 'sys/sys/sx.h')
-rw-r--r--sys/sys/sx.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/sys/sx.h b/sys/sys/sx.h
index d3b2b2db4454..e050bab1525c 100644
--- a/sys/sys/sx.h
+++ b/sys/sys/sx.h
@@ -38,6 +38,7 @@
#ifdef _KERNEL
#include <sys/pcpu.h>
#include <sys/lock_profile.h>
+#include <sys/lockstat.h>
#include <machine/atomic.h>
#endif
@@ -152,9 +153,9 @@ __sx_xlock(struct sx *sx, struct thread *td, int opts, const char *file,
if (!atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid))
error = _sx_xlock_hard(sx, tid, opts, file, line);
- else
- lock_profile_obtain_lock_success(&sx->lock_object, 0, 0, file,
- line);
+ else
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_XLOCK_ACQUIRE,
+ sx, 0, 0, file, line);
return (error);
}
@@ -180,8 +181,8 @@ __sx_slock(struct sx *sx, int opts, const char *file, int line)
!atomic_cmpset_acq_ptr(&sx->sx_lock, x, x + SX_ONE_SHARER))
error = _sx_slock_hard(sx, opts, file, line);
else
- lock_profile_obtain_lock_success(&sx->lock_object, 0, 0, file,
- line);
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_SLOCK_ACQUIRE, sx, 0,
+ 0, file, line);
return (error);
}