skip call to _lock_profile_obtain_lock_success entirely if acquisition time is non-zero
(i.e. recursing or adding sharers)
This commit is contained in:
parent
832a21869c
commit
8289600ce7
@ -254,21 +254,18 @@ void _lock_profile_obtain_lock_success(struct lock_object *lo, int contested, ui
|
||||
{
|
||||
struct lock_profile_object *l = &lo->lo_profile_obj;
|
||||
|
||||
/* don't reset the timer when/if recursing */
|
||||
if (l->lpo_acqtime == 0) {
|
||||
lo->lo_profile_obj.lpo_contest_holding = 0;
|
||||
|
||||
if (contested)
|
||||
lo->lo_profile_obj.lpo_contest_locking++;
|
||||
lo->lo_profile_obj.lpo_contest_holding = 0;
|
||||
|
||||
l->lpo_filename = file;
|
||||
l->lpo_lineno = line;
|
||||
l->lpo_acqtime = nanoseconds();
|
||||
if (waittime && (l->lpo_acqtime > waittime))
|
||||
l->lpo_waittime = l->lpo_acqtime - waittime;
|
||||
else
|
||||
l->lpo_waittime = 0;
|
||||
}
|
||||
if (contested)
|
||||
lo->lo_profile_obj.lpo_contest_locking++;
|
||||
|
||||
l->lpo_filename = file;
|
||||
l->lpo_lineno = line;
|
||||
l->lpo_acqtime = nanoseconds();
|
||||
if (waittime && (l->lpo_acqtime > waittime))
|
||||
l->lpo_waittime = l->lpo_acqtime - waittime;
|
||||
else
|
||||
l->lpo_waittime = 0;
|
||||
}
|
||||
|
||||
void _lock_profile_release_lock(struct lock_object *lo)
|
||||
|
@ -129,12 +129,14 @@ 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) {
|
||||
|
||||
/* don't reset the timer when/if recursing */
|
||||
if (lock_prof_enable && lo->lo_profile_obj.lpo_acqtime == 0) {
|
||||
#ifdef LOCK_PROFILING_FAST
|
||||
if (contested == 0)
|
||||
return;
|
||||
#endif
|
||||
_lock_profile_obtain_lock_success(lo, contested, waittime, file, line);
|
||||
_lock_profile_obtain_lock_success(lo, contested, waittime, file, line);
|
||||
}
|
||||
}
|
||||
static inline void lock_profile_release_lock(struct lock_object *lo)
|
||||
|
Loading…
x
Reference in New Issue
Block a user