summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/isa/clock.c2
-rw-r--r--sys/kern/subr_lock.c2
-rw-r--r--sys/sys/lock_profile.h8
3 files changed, 7 insertions, 5 deletions
diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c
index 852cca1..0e5c8fc 100644
--- a/sys/amd64/isa/clock.c
+++ b/sys/amd64/isa/clock.c
@@ -565,7 +565,7 @@ void
i8254_init(void)
{
- mtx_init(&clock_lock, "clk", NULL, MTX_SPIN);
+ mtx_init(&clock_lock, "clk", NULL, MTX_SPIN | MTX_NOPROFILE);
set_timer_freq(timer_freq, hz);
}
diff --git a/sys/kern/subr_lock.c b/sys/kern/subr_lock.c
index f20f80e..33e2bdd 100644
--- a/sys/kern/subr_lock.c
+++ b/sys/kern/subr_lock.c
@@ -274,7 +274,7 @@ void _lock_profile_release_lock(struct lock_object *lo)
{
struct lock_profile_object *l = &lo->lo_profile_obj;
- if (l->lpo_acqtime && !(lo->lo_flags & LO_NOPROFILE)) {
+ if (l->lpo_acqtime) {
const char *unknown = "(unknown)";
u_int64_t acqtime, now, waittime;
struct lock_prof *mpp;
diff --git a/sys/sys/lock_profile.h b/sys/sys/lock_profile.h
index c39ece6..f2861ac 100644
--- a/sys/sys/lock_profile.h
+++ b/sys/sys/lock_profile.h
@@ -119,7 +119,8 @@ static inline void lock_profile_obtain_lock_failed(struct lock_object *lo, int *
{
struct lock_profile_object *l = &lo->lo_profile_obj;
- if (lock_prof_enable && *contested == 0) {
+ if (!(lo->lo_flags & LO_NOPROFILE) && lock_prof_enable &&
+ *contested == 0) {
*waittime = nanoseconds();
atomic_add_int(&l->lpo_contest_holding, 1);
*contested = 1;
@@ -130,7 +131,8 @@ static inline void lock_profile_obtain_lock_success(struct lock_object *lo, int
{
/* don't reset the timer when/if recursing */
- if (lock_prof_enable && lo->lo_profile_obj.lpo_acqtime == 0) {
+ if (!(lo->lo_flags & LO_NOPROFILE) && lock_prof_enable &&
+ lo->lo_profile_obj.lpo_acqtime == 0) {
#ifdef LOCK_PROFILING_FAST
if (contested == 0)
return;
@@ -142,7 +144,7 @@ static inline void lock_profile_release_lock(struct lock_object *lo)
{
struct lock_profile_object *l = &lo->lo_profile_obj;
- if (l->lpo_acqtime)
+ if (!(lo->lo_flags & LO_NOPROFILE) && l->lpo_acqtime)
_lock_profile_release_lock(lo);
}
OpenPOWER on IntegriCloud