Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_witness.c
Context not available. | |||||
* it to the pending_locks list. If it is not too early, then enroll | * it to the pending_locks list. If it is not too early, then enroll | ||||
* the lock now. | * the lock now. | ||||
*/ | */ | ||||
if (witness_watch < 1 || panicstr != NULL || | if (witness_watch < 1 || KERNEL_PANICKED() || | ||||
(lock->lo_flags & LO_WITNESS) == 0) | (lock->lo_flags & LO_WITNESS) == 0) | ||||
lock->lo_witness = NULL; | lock->lo_witness = NULL; | ||||
else if (witness_cold) { | else if (witness_cold) { | ||||
Context not available. | |||||
witness_defineorder(struct lock_object *lock1, struct lock_object *lock2) | witness_defineorder(struct lock_object *lock1, struct lock_object *lock2) | ||||
{ | { | ||||
if (witness_watch == -1 || panicstr != NULL) | if (witness_watch == -1 || KERNEL_PANICKED()) | ||||
return (0); | return (0); | ||||
/* Require locks that witness knows about. */ | /* Require locks that witness knows about. */ | ||||
Context not available. | |||||
int i, j; | int i, j; | ||||
if (witness_cold || witness_watch < 1 || lock->lo_witness == NULL || | if (witness_cold || witness_watch < 1 || lock->lo_witness == NULL || | ||||
panicstr != NULL) | KERNEL_PANICKED()) | ||||
return; | return; | ||||
w = lock->lo_witness; | w = lock->lo_witness; | ||||
Context not available. | |||||
struct thread *td; | struct thread *td; | ||||
if (witness_cold || witness_watch == -1 || lock->lo_witness == NULL || | if (witness_cold || witness_watch == -1 || lock->lo_witness == NULL || | ||||
panicstr != NULL) | KERNEL_PANICKED()) | ||||
return; | return; | ||||
w = lock->lo_witness; | w = lock->lo_witness; | ||||
td = curthread; | td = curthread; | ||||
Context not available. | |||||
struct lock_class *class; | struct lock_class *class; | ||||
KASSERT(witness_cold == 0, ("%s: witness_cold", __func__)); | KASSERT(witness_cold == 0, ("%s: witness_cold", __func__)); | ||||
if (lock->lo_witness == NULL || witness_watch == -1 || panicstr != NULL) | if (lock->lo_witness == NULL || witness_watch == -1 || KERNEL_PANICKED()) | ||||
return; | return; | ||||
class = LOCK_CLASS(lock); | class = LOCK_CLASS(lock); | ||||
if (witness_watch) { | if (witness_watch) { | ||||
Context not available. | |||||
struct lock_class *class; | struct lock_class *class; | ||||
KASSERT(witness_cold == 0, ("%s: witness_cold", __func__)); | KASSERT(witness_cold == 0, ("%s: witness_cold", __func__)); | ||||
if (lock->lo_witness == NULL || witness_watch == -1 || panicstr != NULL) | if (lock->lo_witness == NULL || witness_watch == -1 || KERNEL_PANICKED()) | ||||
return; | return; | ||||
class = LOCK_CLASS(lock); | class = LOCK_CLASS(lock); | ||||
if (witness_watch) { | if (witness_watch) { | ||||
Context not available. | |||||
register_t s; | register_t s; | ||||
int i, j; | int i, j; | ||||
if (witness_cold || lock->lo_witness == NULL || panicstr != NULL) | if (witness_cold || lock->lo_witness == NULL || KERNEL_PANICKED()) | ||||
return; | return; | ||||
td = curthread; | td = curthread; | ||||
class = LOCK_CLASS(lock); | class = LOCK_CLASS(lock); | ||||
Context not available. | |||||
int i, n; | int i, n; | ||||
lle = td->td_sleeplocks; | lle = td->td_sleeplocks; | ||||
if (lle == NULL || panicstr != NULL) | if (lle == NULL || KERNEL_PANICKED()) | ||||
return; | return; | ||||
if (lle->ll_count != 0) { | if (lle->ll_count != 0) { | ||||
for (n = 0; lle != NULL; lle = lle->ll_next) | for (n = 0; lle != NULL; lle = lle->ll_next) | ||||
Context not available. | |||||
va_list ap; | va_list ap; | ||||
int i, n; | int i, n; | ||||
if (witness_cold || witness_watch < 1 || panicstr != NULL) | if (witness_cold || witness_watch < 1 || KERNEL_PANICKED()) | ||||
return (0); | return (0); | ||||
n = 0; | n = 0; | ||||
td = curthread; | td = curthread; | ||||
Context not available. | |||||
MPASS(description != NULL); | MPASS(description != NULL); | ||||
if (witness_watch == -1 || panicstr != NULL) | if (witness_watch == -1 || KERNEL_PANICKED()) | ||||
return (NULL); | return (NULL); | ||||
if ((lock_class->lc_flags & LC_SPINLOCK)) { | if ((lock_class->lc_flags & LC_SPINLOCK)) { | ||||
if (witness_skipspin) | if (witness_skipspin) | ||||
Context not available. | |||||
if (SCHEDULER_STOPPED()) | if (SCHEDULER_STOPPED()) | ||||
return; | return; | ||||
KASSERT(witness_cold == 0, ("%s: witness_cold", __func__)); | KASSERT(witness_cold == 0, ("%s: witness_cold", __func__)); | ||||
if (lock->lo_witness == NULL || witness_watch == -1 || panicstr != NULL) | if (lock->lo_witness == NULL || witness_watch == -1 || KERNEL_PANICKED()) | ||||
return; | return; | ||||
class = LOCK_CLASS(lock); | class = LOCK_CLASS(lock); | ||||
if (class->lc_flags & LC_SLEEPLOCK) | if (class->lc_flags & LC_SLEEPLOCK) | ||||
Context not available. | |||||
if (SCHEDULER_STOPPED()) | if (SCHEDULER_STOPPED()) | ||||
return; | return; | ||||
KASSERT(witness_cold == 0, ("%s: witness_cold", __func__)); | KASSERT(witness_cold == 0, ("%s: witness_cold", __func__)); | ||||
if (lock->lo_witness == NULL || witness_watch == -1 || panicstr != NULL) | if (lock->lo_witness == NULL || witness_watch == -1 || KERNEL_PANICKED()) | ||||
return; | return; | ||||
class = LOCK_CLASS(lock); | class = LOCK_CLASS(lock); | ||||
if (class->lc_flags & LC_SLEEPLOCK) | if (class->lc_flags & LC_SLEEPLOCK) | ||||
Context not available. | |||||
struct lock_instance *instance; | struct lock_instance *instance; | ||||
struct lock_class *class; | struct lock_class *class; | ||||
if (lock->lo_witness == NULL || witness_watch < 1 || panicstr != NULL) | if (lock->lo_witness == NULL || witness_watch < 1 || KERNEL_PANICKED()) | ||||
return; | return; | ||||
class = LOCK_CLASS(lock); | class = LOCK_CLASS(lock); | ||||
if ((class->lc_flags & LC_SLEEPLOCK) != 0) | if ((class->lc_flags & LC_SLEEPLOCK) != 0) | ||||
Context not available. | |||||
struct lock_instance *instance; | struct lock_instance *instance; | ||||
struct lock_class *class; | struct lock_class *class; | ||||
if (lock->lo_witness == NULL || witness_watch == -1 || panicstr != NULL) | if (lock->lo_witness == NULL || witness_watch == -1 || KERNEL_PANICKED()) | ||||
return; | return; | ||||
class = LOCK_CLASS(lock); | class = LOCK_CLASS(lock); | ||||
if (class->lc_flags & LC_SLEEPLOCK) | if (class->lc_flags & LC_SLEEPLOCK) | ||||
Context not available. |