summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-07-12 21:25:24 +0000
committerjhb <jhb@FreeBSD.org>2006-07-12 21:25:24 +0000
commitdf5fe093b16e23340080adbd217dbf424b9356fb (patch)
treecc7dc32f521d35bb464fd0741eefd335a0b651d6 /sys/kern
parenta72b0bcd7fd4baed9952beefc6398b3d79c789d9 (diff)
downloadFreeBSD-src-df5fe093b16e23340080adbd217dbf424b9356fb.zip
FreeBSD-src-df5fe093b16e23340080adbd217dbf424b9356fb.tar.gz
Honor db_pager_quit in 'show threadchain', 'show allchains', and
'show lockchain'. This is especially helpful for the first 2 as a threadchain could get stuck in an infinite loop during a mutex deadlock.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_turnstile.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c
index 2c3e34b..1ef19b8 100644
--- a/sys/kern/subr_turnstile.c
+++ b/sys/kern/subr_turnstile.c
@@ -1046,7 +1046,7 @@ print_threadchain(struct thread *td, const char *prefix)
* Follow the chain. We keep walking as long as the thread is
* blocked on a turnstile that has an owner.
*/
- for (;;) {
+ while (!db_pager_quit) {
db_printf("%sthread %d (pid %d, %s) ", prefix, td->td_tid,
td->td_proc->p_pid, td->td_name[0] != '\0' ? td->td_name :
td->td_proc->p_comm);
@@ -1110,6 +1110,8 @@ DB_SHOW_COMMAND(allchains, db_show_allchains)
db_printf("chain %d:\n", i++);
print_threadchain(td, " ");
}
+ if (db_pager_quit)
+ return;
}
}
}
@@ -1122,6 +1124,8 @@ print_waiter(struct thread *td, int indent)
struct turnstile *ts;
int i;
+ if (db_pager_quit)
+ return;
for (i = 0; i < indent; i++)
db_printf(" ");
print_thread(td, "thread ");
@@ -1137,6 +1141,8 @@ print_waiters(struct turnstile *ts, int indent)
struct thread *td;
int i;
+ if (db_pager_quit)
+ return;
lock = ts->ts_lockobj;
class = LOCK_CLASS(lock);
for (i = 0; i < indent; i++)
OpenPOWER on IntegriCloud