subr_lock.c (227309) | subr_lock.c (228424) |
---|---|
1/*- 2 * Copyright (c) 2006 John Baldwin <jhb@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 --- 19 unchanged lines hidden (view full) --- 28 */ 29 30/* 31 * This module holds the global variables and functions used to maintain 32 * lock_object structures. 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006 John Baldwin <jhb@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 --- 19 unchanged lines hidden (view full) --- 28 */ 29 30/* 31 * This module holds the global variables and functions used to maintain 32 * lock_object structures. 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/kern/subr_lock.c 227309 2011-11-07 15:43:11Z ed $"); | 36__FBSDID("$FreeBSD: head/sys/kern/subr_lock.c 228424 2011-12-11 21:02:01Z avg $"); |
37 38#include "opt_ddb.h" 39#include "opt_mprof.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/kernel.h> 44#include <sys/ktr.h> --- 482 unchanged lines hidden (view full) --- 527void 528lock_profile_obtain_lock_success(struct lock_object *lo, int contested, 529 uint64_t waittime, const char *file, int line) 530{ 531 static int lock_prof_count; 532 struct lock_profile_object *l; 533 int spin; 534 | 37 38#include "opt_ddb.h" 39#include "opt_mprof.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/kernel.h> 44#include <sys/ktr.h> --- 482 unchanged lines hidden (view full) --- 527void 528lock_profile_obtain_lock_success(struct lock_object *lo, int contested, 529 uint64_t waittime, const char *file, int line) 530{ 531 static int lock_prof_count; 532 struct lock_profile_object *l; 533 int spin; 534 |
535 if (SCHEDULER_STOPPED()) 536 return; 537 |
|
535 /* don't reset the timer when/if recursing */ 536 if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) 537 return; 538 if (lock_prof_skipcount && 539 (++lock_prof_count % lock_prof_skipcount) != 0) 540 return; 541 spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; 542 if (spin && lock_prof_skipspin == 1) --- 48 unchanged lines hidden (view full) --- 591{ 592 struct lock_profile_object *l; 593 struct lock_prof_type *type; 594 struct lock_prof *lp; 595 uint64_t curtime, holdtime; 596 struct lpohead *head; 597 int spin; 598 | 538 /* don't reset the timer when/if recursing */ 539 if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) 540 return; 541 if (lock_prof_skipcount && 542 (++lock_prof_count % lock_prof_skipcount) != 0) 543 return; 544 spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; 545 if (spin && lock_prof_skipspin == 1) --- 48 unchanged lines hidden (view full) --- 594{ 595 struct lock_profile_object *l; 596 struct lock_prof_type *type; 597 struct lock_prof *lp; 598 uint64_t curtime, holdtime; 599 struct lpohead *head; 600 int spin; 601 |
602 if (SCHEDULER_STOPPED()) 603 return; |
|
599 if (lo->lo_flags & LO_NOPROFILE) 600 return; 601 spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; 602 head = &curthread->td_lprof[spin]; 603 if (LIST_FIRST(head) == NULL) 604 return; 605 critical_enter(); 606 /* Recheck enabled now that we're in a critical section. */ --- 58 unchanged lines hidden --- | 604 if (lo->lo_flags & LO_NOPROFILE) 605 return; 606 spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; 607 head = &curthread->td_lprof[spin]; 608 if (LIST_FIRST(head) == NULL) 609 return; 610 critical_enter(); 611 /* Recheck enabled now that we're in a critical section. */ --- 58 unchanged lines hidden --- |