kern_lock.c (189788) | kern_lock.c (189846) |
---|---|
1/*- 2 * Copyright (c) 2008 Attilio Rao <attilio@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 26 * DAMAGE. 27 */ 28 29#include "opt_ddb.h" 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008 Attilio Rao <attilio@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 26 * DAMAGE. 27 */ 28 29#include "opt_ddb.h" 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/kern/kern_lock.c 189788 2009-03-14 11:43:02Z jeff $"); | 32__FBSDID("$FreeBSD: head/sys/kern/kern_lock.c 189846 2009-03-15 08:03:54Z jeff $"); |
33 34#include <sys/param.h> 35#include <sys/ktr.h> 36#include <sys/lock.h> 37#include <sys/lock_profile.h> 38#include <sys/lockmgr.h> 39#include <sys/mutex.h> 40#include <sys/proc.h> --- 287 unchanged lines hidden (view full) --- 328 lock_destroy(&lk->lock_object); 329} 330 331int 332__lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, 333 const char *wmesg, int pri, int timo, const char *file, int line) 334{ 335 GIANT_DECLARE; | 33 34#include <sys/param.h> 35#include <sys/ktr.h> 36#include <sys/lock.h> 37#include <sys/lock_profile.h> 38#include <sys/lockmgr.h> 39#include <sys/mutex.h> 40#include <sys/proc.h> --- 287 unchanged lines hidden (view full) --- 328 lock_destroy(&lk->lock_object); 329} 330 331int 332__lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, 333 const char *wmesg, int pri, int timo, const char *file, int line) 334{ 335 GIANT_DECLARE; |
336 uint64_t waittime; | |
337 struct lock_class *class; 338 const char *iwmesg; 339 uintptr_t tid, v, x; 340 u_int op; | 336 struct lock_class *class; 337 const char *iwmesg; 338 uintptr_t tid, v, x; 339 u_int op; |
341 int contested, error, ipri, itimo, queue, wakeup_swapper; | 340 int error, ipri, itimo, queue, wakeup_swapper; 341#ifdef LOCK_PROFILING 342 uint64_t waittime = 0; 343 int contested = 0; 344#endif |
342 | 345 |
343 contested = 0; | |
344 error = 0; | 346 error = 0; |
345 waittime = 0; | |
346 tid = (uintptr_t)curthread; 347 op = (flags & LK_TYPE_MASK); 348 iwmesg = (wmesg == LK_WMESG_DEFAULT) ? lk->lock_object.lo_name : wmesg; 349 ipri = (pri == LK_PRIO_DEFAULT) ? lk->lk_pri : pri; 350 itimo = (timo == LK_TIMO_DEFAULT) ? lk->lk_timo : timo; 351 352 MPASS((flags & ~LK_TOTAL_MASK) == 0); 353 KASSERT((op & (op - 1)) == 0, --- 726 unchanged lines hidden --- | 347 tid = (uintptr_t)curthread; 348 op = (flags & LK_TYPE_MASK); 349 iwmesg = (wmesg == LK_WMESG_DEFAULT) ? lk->lock_object.lo_name : wmesg; 350 ipri = (pri == LK_PRIO_DEFAULT) ? lk->lk_pri : pri; 351 itimo = (timo == LK_TIMO_DEFAULT) ? lk->lk_timo : timo; 352 353 MPASS((flags & ~LK_TOTAL_MASK) == 0); 354 KASSERT((op & (op - 1)) == 0, --- 726 unchanged lines hidden --- |