summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_ps.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-10-20 03:22:23 +0000
committerjhb <jhb@FreeBSD.org>2001-10-20 03:22:23 +0000
commit8ceded814ab0034367a46a7c847a70fb4cb45b2e (patch)
treebbb4c23a3548e3e52d7e62e7be2b94b06af42d3e /sys/ddb/db_ps.c
parent60a8e7b108b9c306d1e884e73d6836c508fabd79 (diff)
downloadFreeBSD-src-8ceded814ab0034367a46a7c847a70fb4cb45b2e.zip
FreeBSD-src-8ceded814ab0034367a46a7c847a70fb4cb45b2e.tar.gz
Make the flag field in the ps output one char wider to account for recent
growth in the number of flags used. Also, if a thread is blocked on a mutex, print the mutex name in the wait channel column.
Diffstat (limited to 'sys/ddb/db_ps.c')
-rw-r--r--sys/ddb/db_ps.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c
index 50f6f19..ccc8eb8 100644
--- a/sys/ddb/db_ps.c
+++ b/sys/ddb/db_ps.c
@@ -51,6 +51,7 @@ db_ps(dummy1, dummy2, dummy3, dummy4)
int np;
int nl = 0;
volatile struct proc *p, *pp;
+ volatile struct thread *td;
np = nprocs;
@@ -59,7 +60,7 @@ db_ps(dummy1, dummy2, dummy3, dummy4)
else
p = &proc0;
- db_printf(" pid proc addr uid ppid pgrp flag stat wmesg wchan cmd\n");
+ db_printf(" pid proc addr uid ppid pgrp flag stat wmesg wchan cmd\n");
while (--np >= 0) {
/*
* XXX just take 20 for now...
@@ -93,12 +94,11 @@ db_ps(dummy1, dummy2, dummy3, dummy4)
if (pp == NULL)
pp = p;
- db_printf("%5d %8p %8p %4d %5d %5d %06x %d",
+ db_printf("%5d %8p %8p %4d %5d %5d %07x %d",
p->p_pid, (volatile void *)p, (void *)p->p_uarea,
p->p_ucred ? p->p_ucred->cr_ruid : 0, pp->p_pid,
p->p_pgrp ? p->p_pgrp->pg_id : 0, p->p_flag, p->p_stat);
if (p->p_flag & P_KSES) {
- struct thread *td;
db_printf("(threaded) %s\n", p->p_comm);
FOREACH_THREAD_IN_PROC(p, td) {
db_printf( ". . . . . . . "
@@ -106,14 +106,21 @@ db_ps(dummy1, dummy2, dummy3, dummy4)
if (td->td_wchan) {
db_printf("%6s %8p", td->td_wmesg,
(void *)td->td_wchan);
+ } else if (p->p_stat == SMTX) {
+ db_printf("%6s %8p", td->td_mtxname,
+ (void *)td->td_blocked);
} else {
db_printf("--not blocked--");
}
}
} else {
- if (p->p_thread.td_wchan) {
- db_printf(" %6s %8p", p->p_thread.td_wmesg,
- (void *)p->p_thread.td_wchan);
+ td = &p->p_thread;
+ if (td->td_wchan) {
+ db_printf(" %6s %8p", td->td_wmesg,
+ (void *)td->td_wchan);
+ } else if (p->p_stat == SMTX) {
+ db_printf(" %6s %8p", td->td_mtxname,
+ (void *)td->td_blocked);
} else {
db_printf(" ");
}
OpenPOWER on IntegriCloud