Revert wchan functionality. Add 'mwchan' to supply new duel mutex/msleep
functionality and make it the default. With additional improvements by: Mark Peek <mp@FreeBSD.org>
This commit is contained in:
parent
a48e6c8736
commit
d9a5f8900a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91028
@ -77,5 +77,6 @@ void uname(KINFO *, VARENT *);
|
||||
int s_uname(KINFO *);
|
||||
void vsize(KINFO *, VARENT *);
|
||||
void wchan(KINFO *, VARENT *);
|
||||
void mwchan(KINFO *, VARENT *);
|
||||
void lattr(KINFO *, VARENT *);
|
||||
__END_DECLS
|
||||
|
@ -119,6 +119,7 @@ static VAR var[] = {
|
||||
LONG, "ld", 0},
|
||||
{"mtxname", "MUTEX", NULL, LJUST, mtxname, NULL, 6, 0, CHAR, NULL,
|
||||
0},
|
||||
{"mwchan", "MWCHAN", NULL, LJUST, mwchan, NULL, 6, 0, CHAR, NULL, 0},
|
||||
{"ni", "", "nice", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"nice", "NI", NULL, 0, kvar, NULL, 2, KOFF(ki_nice), CHAR, "d",
|
||||
0},
|
||||
|
@ -401,6 +401,24 @@ wchan(KINFO *k, VARENT *ve)
|
||||
{
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
if (k->ki_p->ki_wchan) {
|
||||
if (k->ki_p->ki_wmesg[0] != 0)
|
||||
(void)printf("%-*.*s", v->width, v->width,
|
||||
k->ki_p->ki_wmesg);
|
||||
else
|
||||
(void)printf("%-*lx", v->width,
|
||||
(long)k->ki_p->ki_wchan);
|
||||
} else {
|
||||
(void)printf("%-*s", v->width, "-");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
mwchan(KINFO *k, VARENT *ve)
|
||||
{
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
if (k->ki_p->ki_wchan) {
|
||||
if (k->ki_p->ki_wmesg[0] != 0)
|
||||
@ -410,7 +428,12 @@ wchan(KINFO *k, VARENT *ve)
|
||||
(void)printf("%-*lx", v->width,
|
||||
(long)k->ki_p->ki_wchan);
|
||||
} else if (k->ki_p->ki_kiflag & KI_MTXBLOCK) {
|
||||
(void)printf("%-*.*s", v->width, v->width, k->ki_p->ki_mtxname);
|
||||
if (k->ki_p->ki_mtxname[0]) {
|
||||
(void)printf("%-*.*s", v->width, v->width,
|
||||
k->ki_p->ki_mtxname);
|
||||
} else {
|
||||
(void)printf("%-*s", v->width, "???");
|
||||
}
|
||||
} else {
|
||||
(void)printf("%-*s", v->width, "-");
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ user, pid, ppid, pgid, jobc, state, tt, time and command.
|
||||
List the set of available keywords.
|
||||
.It Fl l
|
||||
Display information associated with the following keywords:
|
||||
uid, pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time
|
||||
uid, pid, ppid, cpu, pri, nice, vsz, rss, mwchan, state, tt, time
|
||||
and command.
|
||||
.It Fl M
|
||||
Extract values associated with the name list from the specified core
|
||||
@ -234,6 +234,10 @@ that the process is currently blocked on.
|
||||
If the name is invalid or unknown, then
|
||||
.Dq ???\&
|
||||
is displayed.
|
||||
.It mwchan
|
||||
The event name if the process is blocked normally, or the mutex name if
|
||||
the process is blocked on a mutex. See the wchan and mtxname keywords
|
||||
for details.
|
||||
.It nice
|
||||
The process scheduling increment (see
|
||||
.Xr setpriority 2 ) .
|
||||
@ -393,6 +397,8 @@ total messages sent (writes on pipes/sockets)
|
||||
.It mtxname
|
||||
.Xr mutex 9
|
||||
currently blocked on (as a symbolic name)
|
||||
.It mwchan
|
||||
wait channel or mutex currently blocked on
|
||||
.It nice
|
||||
nice value (alias ni)
|
||||
.It nivcsw
|
||||
|
@ -103,7 +103,7 @@ static uid_t *getuids(const char *, int *);
|
||||
|
||||
static char dfmt[] = "pid tt state time command";
|
||||
static char jfmt[] = "user pid ppid pgid jobc state tt time command";
|
||||
static char lfmt[] = "uid pid ppid cpu pri nice vsz rss wchan state tt time command";
|
||||
static char lfmt[] = "uid pid ppid cpu pri nice vsz rss mwchan state tt time command";
|
||||
static char o1[] = "pid";
|
||||
static char o2[] = "tt state time command";
|
||||
static char ufmt[] = "user pid %cpu %mem vsz rss tt state start time command";
|
||||
|
Loading…
Reference in New Issue
Block a user