Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/subr_sleepqueue.c
Show First 20 Lines • Show All 1,135 Lines • ▼ Show 20 Lines | |||||
sleepq_sbuf_print_stacks(struct sbuf *sb, void *wchan, int queue, | sleepq_sbuf_print_stacks(struct sbuf *sb, void *wchan, int queue, | ||||
int *count_stacks_printed) | int *count_stacks_printed) | ||||
{ | { | ||||
struct thread *td, *td_next; | struct thread *td, *td_next; | ||||
struct sleepqueue *sq; | struct sleepqueue *sq; | ||||
struct stack **st; | struct stack **st; | ||||
struct sbuf **td_infos; | struct sbuf **td_infos; | ||||
int i, stack_idx, error, stacks_to_allocate; | int i, stack_idx, error, stacks_to_allocate; | ||||
bool finished, partial_print; | bool finished; | ||||
error = 0; | error = 0; | ||||
finished = false; | finished = false; | ||||
partial_print = false; | |||||
KASSERT(wchan != NULL, ("%s: invalid NULL wait channel", __func__)); | KASSERT(wchan != NULL, ("%s: invalid NULL wait channel", __func__)); | ||||
MPASS((queue >= 0) && (queue < NR_SLEEPQS)); | MPASS((queue >= 0) && (queue < NR_SLEEPQS)); | ||||
stacks_to_allocate = 10; | stacks_to_allocate = 10; | ||||
for (i = 0; i < 3 && !finished ; i++) { | for (i = 0; i < 3 && !finished ; i++) { | ||||
/* We cannot malloc while holding the queue's spinlock, so | /* We cannot malloc while holding the queue's spinlock, so | ||||
* we do our mallocs now, and hope it is enough. If it | * we do our mallocs now, and hope it is enough. If it | ||||
▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines |