diff options
-rw-r--r-- | sys/sys/lock.h | 1 | ||||
-rw-r--r-- | sys/sys/lock_profile.h | 15 |
2 files changed, 6 insertions, 10 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h index 1c9940c..6d35ce5 100644 --- a/sys/sys/lock.h +++ b/sys/sys/lock.h @@ -79,7 +79,6 @@ struct lock_class { #define LO_ENROLLPEND 0x00800000 /* On the pending enroll list. */ #define LO_CLASSMASK 0x0f000000 /* Class index bitmask. */ #define LO_NOPROFILE 0x10000000 /* Don't profile this lock */ -#define LO_CONTESTED 0x20000000 /* Lock was contested */ /* * Lock classes are statically assigned an index into the gobal lock_classes diff --git a/sys/sys/lock_profile.h b/sys/sys/lock_profile.h index 4b1dc50..91f3032 100644 --- a/sys/sys/lock_profile.h +++ b/sys/sys/lock_profile.h @@ -122,7 +122,6 @@ static inline void lock_profile_obtain_lock_failed(struct lock_object *lo, int * if (lock_prof_enable && *contested == 0) { *waittime = nanoseconds(); - lo->lo_flags |= LO_CONTESTED; atomic_add_int(&l->lpo_contest_holding, 1); *contested = 1; } @@ -131,21 +130,19 @@ static inline void lock_profile_obtain_lock_failed(struct lock_object *lo, int * static inline void lock_profile_obtain_lock_success(struct lock_object *lo, int contested, uint64_t waittime, const char *file, int line) { if (lock_prof_enable) { +#ifdef LOCK_PROFILING_FAST + if (contested == 0) + return; +#endif _lock_profile_obtain_lock_success(lo, contested, waittime, file, line); } } - static inline void lock_profile_release_lock(struct lock_object *lo) { struct lock_profile_object *l = &lo->lo_profile_obj; -#ifdef LOCK_PROFILING_FAST - if((lo->lo_flags & LO_CONTESTED) == 0) - return; -#endif - if (lock_prof_enable || l->lpo_acqtime) { - lo->lo_flags &= ~LO_CONTESTED; + + if (l->lpo_acqtime) _lock_profile_release_lock(lo); - } } #else /* !LOCK_PROFILING */ |