summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-10-02 20:33:52 +0000
committerjhb <jhb@FreeBSD.org>2002-10-02 20:33:52 +0000
commitb79961de9543536d9734d8686e54a65c7f3cafab (patch)
treefd16f0ff58f4e919bd04b0c16cd0fdeb36340496
parent8c9a393a0433c7cc2ee90541164cdcb927fa5bdb (diff)
downloadFreeBSD-src-b79961de9543536d9734d8686e54a65c7f3cafab.zip
FreeBSD-src-b79961de9543536d9734d8686e54a65c7f3cafab.tar.gz
Catch up to SMTX -> SLOCK changes.
-rw-r--r--bin/ps/extern.h2
-rw-r--r--bin/ps/keyword.c2
-rw-r--r--bin/ps/print.c18
-rw-r--r--bin/ps/ps.125
-rw-r--r--lib/libkvm/kvm_proc.c14
-rw-r--r--usr.bin/top/machine.c10
6 files changed, 34 insertions, 37 deletions
diff --git a/bin/ps/extern.h b/bin/ps/extern.h
index 4c55025..c113462 100644
--- a/bin/ps/extern.h
+++ b/bin/ps/extern.h
@@ -59,7 +59,7 @@ void logname(KINFO *, VARENT *);
void longtname(KINFO *, VARENT *);
void lstarted(KINFO *, VARENT *);
void maxrss(KINFO *, VARENT *);
-void mtxname(KINFO *, VARENT *);
+void lockname(KINFO *, VARENT *);
void mwchan(KINFO *, VARENT *);
void pagein(KINFO *, VARENT *);
void parsefmt(const char *);
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 1ab9253..b0a1917 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -110,7 +110,7 @@ static VAR var[] = {
LONG, "ld", 0},
{"msgsnd", "MSGSND", NULL, USER, rvar, NULL, 4, ROFF(ru_msgsnd),
LONG, "ld", 0},
- {"mtxname", "MUTEX", NULL, LJUST, mtxname, NULL, 6, 0, CHAR, NULL,
+ {"lockname", "LOCK", NULL, LJUST, lockname, 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},
diff --git a/bin/ps/print.c b/bin/ps/print.c
index d0c43ee..3fd367a 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -227,8 +227,8 @@ state(KINFO *k, VARENT *ve)
*cp = 'W';
break;
- case SMTX:
- *cp = 'M';
+ case SLOCK:
+ *cp = 'L';
break;
case SZOMB:
@@ -420,15 +420,15 @@ lstarted(KINFO *k, VARENT *ve)
}
void
-mtxname(KINFO *k, VARENT *ve)
+lockname(KINFO *k, VARENT *ve)
{
VAR *v;
v = ve->var;
- if (k->ki_p->ki_kiflag & KI_MTXBLOCK) {
- if (k->ki_p->ki_mtxname[0] != 0)
+ if (k->ki_p->ki_kiflag & KI_LOCKBLOCK) {
+ if (k->ki_p->ki_lockname[0] != 0)
(void)printf("%-*.*s", v->width, v->width,
- k->ki_p->ki_mtxname);
+ k->ki_p->ki_lockname);
else
(void)printf("%-*s", v->width, "???");
} else
@@ -466,10 +466,10 @@ mwchan(KINFO *k, VARENT *ve)
else
(void)printf("%-*lx", v->width,
(long)k->ki_p->ki_wchan);
- } else if (k->ki_p->ki_kiflag & KI_MTXBLOCK) {
- if (k->ki_p->ki_mtxname[0]) {
+ } else if (k->ki_p->ki_kiflag & KI_LOCKBLOCK) {
+ if (k->ki_p->ki_lockname[0]) {
(void)printf("%-*.*s", v->width, v->width,
- k->ki_p->ki_mtxname);
+ k->ki_p->ki_lockname);
} else {
(void)printf("%-*s", v->width, "???");
}
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index 3f290e6..be4960c 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -191,7 +191,7 @@ will display information.
.Pp
A complete list of the available keywords are listed below.
Some of these keywords are further specified as follows:
-.Bl -tag -width mtxname
+.Bl -tag -width lockname
.It %cpu
The cpu utilization of the process; this is a decaying average over up to
a minute of previous (real) time.
@@ -232,17 +232,15 @@ The exact time the command started, using the ``%c'' format described in
.Xr strftime 3 .
.It lvl
The LOMAC level of the process.
-.It mtxname
-The name of the
-.Xr mutex 9
-that the process is currently blocked on.
+.It lockname
+The name of the lock 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
+The event name if the process is blocked normally, or the lock name if
+the process is blocked on a lock.
+See the wchan and lockname keywords
for details.
.It nice
The process scheduling increment (see
@@ -272,8 +270,8 @@ Marks a process which is in
.Xr jail 2 .
The hostname of the prison can be found in
.Ql Li /proc/<pid>/status .
-.It M
-Marks a process that is waiting to acquire a mutex.
+.It L
+Marks a process that is waiting to acquire a lock.
.It R
Marks a runnable process.
.It S
@@ -408,11 +406,10 @@ total page reclaims
total messages received (reads from pipes/sockets)
.It msgsnd
total messages sent (writes on pipes/sockets)
-.It mtxname
-.Xr mutex 9
-currently blocked on (as a symbolic name)
+.It lockname
+lock currently blocked on (as a symbolic name)
.It mwchan
-wait channel or mutex currently blocked on
+wait channel or lock currently blocked on
.It nice
nice value (alias ni)
.It nivcsw
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index f8ca7f3..95b09d1 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -317,12 +317,12 @@ nopgrp:
}
if ((proc.p_state != PRS_ZOMBIE) &&
(mtd.td_blocked != 0)) {
- kp->ki_kiflag |= KI_MTXBLOCK;
- if (mtd.td_mtxname)
+ kp->ki_kiflag |= KI_LOCKBLOCK;
+ if (mtd.td_lockname)
(void)kvm_read(kd,
- (u_long)mtd.td_mtxname,
- kp->ki_mtxname, MTXNAMELEN);
- kp->ki_mtxname[MTXNAMELEN] = 0;
+ (u_long)mtd.td_lockname,
+ kp->ki_lockname, LOCKNAMELEN);
+ kp->ki_lockname[LOCKNAMELEN] = 0;
}
bintime2timeval(&proc.p_runtime, &tv);
kp->ki_runtime = (u_int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
@@ -349,8 +349,8 @@ nopgrp:
} else if (
TD_IS_SLEEPING(&mtd)) {
kp->ki_stat = SSLEEP;
- } else if (TD_ON_MUTEX(&mtd)) {
- kp->ki_stat = SMTX;
+ } else if (TD_ON_LOCK(&mtd)) {
+ kp->ki_stat = SLOCK;
} else {
kp->ki_stat = SWAIT;
}
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index c507925f..980b08c 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -114,7 +114,7 @@ static char up_header[] =
char *state_abbrev[] =
{
- "", "START", "RUN\0\0\0", "SLEEP", "STOP", "ZOMB", "WAIT", "MUTEX"
+ "", "START", "RUN\0\0\0", "SLEEP", "STOP", "ZOMB", "WAIT", "LOCK"
};
@@ -143,7 +143,7 @@ static long cp_diff[CPUSTATES];
int process_states[8];
char *procstatenames[] = {
"", " starting, ", " running, ", " sleeping, ", " stopped, ",
- " zombie, ", " waiting, ", " mutex, ",
+ " zombie, ", " waiting, ", " lock, ",
NULL
};
@@ -533,9 +533,9 @@ char *(*get_userid)();
else
strcpy(status, "RUN");
break;
- case SMTX:
- if (pp->ki_kiflag & KI_MTXBLOCK) {
- sprintf(status, "*%.6s", pp->ki_mtxname);
+ case SLOCK:
+ if (pp->ki_kiflag & KI_LOCKBLOCK) {
+ sprintf(status, "*%.6s", pp->ki_lockname);
break;
}
/* fall through */
OpenPOWER on IntegriCloud