diff options
author | Fabien Thomas <fabient@FreeBSD.org> | 2012-03-28 20:58:30 +0000 |
---|---|---|
committer | Fabien Thomas <fabient@FreeBSD.org> | 2012-03-28 20:58:30 +0000 |
commit | f5f9340b9807d44d200658ba1bbbbbb57ab72e07 (patch) | |
tree | fadff08d26576c3d5c1cef9d47abd784602b237a /sys/kern/kern_rwlock.c | |
parent | 1faacf5d0925fb593d0d5a17dbd3b0d705bdd478 (diff) | |
download | src-test2-f5f9340b9807d44d200658ba1bbbbbb57ab72e07.tar.gz src-test2-f5f9340b9807d44d200658ba1bbbbbb57ab72e07.zip |
Notes
Diffstat (limited to 'sys/kern/kern_rwlock.c')
-rw-r--r-- | sys/kern/kern_rwlock.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index b571532b920b..c33704181287 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" #include "opt_no_adaptive_rwlocks.h" @@ -55,6 +56,11 @@ __FBSDID("$FreeBSD$"); #define ADAPTIVE_RWLOCKS #endif +#ifdef HWPMC_HOOKS +#include <sys/pmckern.h> +PMC_SOFT_DECLARE( , , lock, failed); +#endif + #ifdef ADAPTIVE_RWLOCKS static int rowner_retries = 10; static int rowner_loops = 10000; @@ -366,6 +372,9 @@ _rw_rlock(struct rwlock *rw, const char *file, int line) } continue; } +#ifdef HWPMC_HOOKS + PMC_SOFT_CALL( , , lock, failed); +#endif lock_profile_obtain_lock_failed(&rw->lock_object, &contested, &waittime); @@ -687,6 +696,9 @@ _rw_wlock_hard(struct rwlock *rw, uintptr_t tid, const char *file, int line) #ifdef KDTRACE_HOOKS spin_cnt++; #endif +#ifdef HWPMC_HOOKS + PMC_SOFT_CALL( , , lock, failed); +#endif lock_profile_obtain_lock_failed(&rw->lock_object, &contested, &waittime); #ifdef ADAPTIVE_RWLOCKS |