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.
This commit is contained in:
harti 2003-08-13 07:35:07 +00:00
parent b3803c0021
commit a45a05930d
3 changed files with 15 additions and 0 deletions

View File

@ -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 *);

View File

@ -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},

View File

@ -456,6 +456,19 @@ wchan(KINFO *k, VARENT *ve)
(void)printf("%-*s", v->width, "-");
}
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)
{