--- //depot/vendor/freebsd/src/sys/kern/subr_lock.c 2008/02/06 00:05:39 +++ //depot/user/attilio/attilio_schedlock/kern/subr_lock.c 2008/02/21 19:40:09 @@ -481,16 +481,18 @@ } void -lock_profile_obtain_lock_success(struct lock_object *lo, int contested, +_lock_profile_obtain_lock_success(struct lock_object *lo, int contested, uint64_t waittime, const char *file, int line) { static int lock_prof_count; struct lock_profile_object *l; int spin; - /* don't reset the timer when/if recursing */ - if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) - return; + /* + * This function assumes that lock_prof_enable and LO_NOPROFILE + * stopping conditions have been checked earlier. + * Also, it does not reset the timer when/if recursing. + */ if (lock_prof_skipcount && (++lock_prof_count % lock_prof_skipcount) != 0) return; @@ -512,7 +514,7 @@ } void -lock_profile_release_lock(struct lock_object *lo) +_lock_profile_release_lock(struct lock_object *lo) { struct lock_profile_object *l; struct lock_prof_type *type; @@ -521,8 +523,10 @@ struct lpohead *head; int spin; - if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) - return; + /* + * This function assumes that lock_prof_enable and LO_NOPROFILE + * stopping conditions have been checked earlier. + */ spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; head = &curthread->td_lprof[spin]; critical_enter(); --- //depot/vendor/freebsd/src/sys/sys/lock_profile.h 2007/12/16 06:12:46 +++ //depot/user/attilio/attilio_schedlock/sys/lock_profile.h 2008/02/21 19:40:09 @@ -45,9 +45,28 @@ extern int lock_prof_enable; -void lock_profile_obtain_lock_success(struct lock_object *lo, int contested, +void _lock_profile_obtain_lock_success(struct lock_object *lo, int contested, uint64_t waittime, const char *file, int line); -void lock_profile_release_lock(struct lock_object *lo); +void _lock_profile_release_lock(struct lock_object *lo); + +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 || (lo->lo_flags & LO_NOPROFILE)) + return; + _lock_profile_obtain_lock_success(lo, contested, waittime, file, line); +} + +static inline void +lock_profile_release_lock(struct lock_object *lo) +{ + + if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) + return; + _lock_profile_release_lock(lo); +} static inline void lock_profile_obtain_lock_failed(struct lock_object *lo, int *contested,