summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-08-13 07:35:07 +0000
committerharti <harti@FreeBSD.org>2003-08-13 07:35:07 +0000
commita45a05930d2b1f9bcc8f3fc5ae4028249691198e (patch)
tree50b15bec1993a515aeafe2b43ad02820a92668ca /bin/ps
parentb3803c0021191a72670403627446abb1eba1ccf9 (diff)
downloadFreeBSD-src-a45a05930d2b1f9bcc8f3fc5ae4028249691198e.zip
FreeBSD-src-a45a05930d2b1f9bcc8f3fc5ae4028249691198e.tar.gz
Implement the nwchan keyword that has been in the man page, but was
not implemented. This is just handy if you want to ddb the address some process is waiting on.
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/extern.h1
-rw-r--r--bin/ps/keyword.c1
-rw-r--r--bin/ps/print.c13
3 files changed, 15 insertions, 0 deletions
diff --git a/bin/ps/extern.h b/bin/ps/extern.h
index 54747a2..2ce5e45 100644
--- a/bin/ps/extern.h
+++ b/bin/ps/extern.h
@@ -63,6 +63,7 @@ void lstarted(KINFO *, VARENT *);
void maxrss(KINFO *, VARENT *);
void lockname(KINFO *, VARENT *);
void mwchan(KINFO *, VARENT *);
+void nwchan(KINFO *, VARENT *);
void pagein(KINFO *, VARENT *);
void parsefmt(const char *, int);
void pcpu(KINFO *, VARENT *);
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index d893d0f..918feca 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -127,6 +127,7 @@ static VAR var[] = {
LONG, "ld", 0},
{"nvcsw", "NVCSW", NULL, USER, rvar, NULL, 5, ROFF(ru_nvcsw),
LONG, "ld", 0},
+ {"nwchan", "NWCHAN", NULL, LJUST, nwchan, NULL, 8, 0, CHAR, NULL, 0},
{"oublk", "OUBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_oublock),
LONG, "ld", 0},
{"oublock", "", "oublk", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 7700491..7e0f816 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -457,6 +457,19 @@ wchan(KINFO *k, VARENT *ve)
}
void
+nwchan(KINFO *k, VARENT *ve)
+{
+ VAR *v;
+
+ v = ve->var;
+ if (k->ki_p->ki_wchan) {
+ (void)printf("%0*lx", v->width,
+ (long)k->ki_p->ki_wchan);
+ } else
+ (void)printf("%-*s", v->width, "-");
+}
+
+void
mwchan(KINFO *k, VARENT *ve)
{
VAR *v;
OpenPOWER on IntegriCloud