aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2000-11-29 21:09:21 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2000-11-29 21:09:21 +0000
commitfd5f30bf38259747b7053f2d33c30b412b395a03 (patch)
treeafb8f16a2c0191a30acc6ff63f9635b7f017bb3d /bin
parent6580291ba42cbd933db8f3ac06be1e3dfb89d992 (diff)
Notes
Diffstat (limited to 'bin')
-rw-r--r--bin/ps/extern.h1
-rw-r--r--bin/ps/keyword.c1
-rw-r--r--bin/ps/print.c18
3 files changed, 20 insertions, 0 deletions
diff --git a/bin/ps/extern.h b/bin/ps/extern.h
index a14390dc1d1fb..d184edacd8434 100644
--- a/bin/ps/extern.h
+++ b/bin/ps/extern.h
@@ -57,6 +57,7 @@ void logname __P((KINFO *, VARENT *));
void longtname __P((KINFO *, VARENT *));
void lstarted __P((KINFO *, VARENT *));
void maxrss __P((KINFO *, VARENT *));
+void mtxname __P((KINFO *, VARENT *));
void nlisterr __P((struct nlist *));
void p_rssize __P((KINFO *, VARENT *));
void pagein __P((KINFO *, VARENT *));
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index cbabd978c7840..de87d40dca250 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -112,6 +112,7 @@ VAR var[] = {
NULL, USER, rvar, NULL, 4, ROFF(ru_majflt), LONG, "ld"},
{"minflt", "MINFLT",
NULL, USER, rvar, NULL, 4, ROFF(ru_minflt), LONG, "ld"},
+ {"mtxname", "MUTEX", NULL, LJUST, mtxname, NULL, 6},
{"msgrcv", "MSGRCV",
NULL, USER, rvar, NULL, 4, ROFF(ru_msgrcv), LONG, "ld"},
{"msgsnd", "MSGSND",
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 600a639b92148..9b1c913a86a4a 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -394,6 +394,24 @@ lstarted(k, ve)
}
void
+mtxname(k, ve)
+ KINFO *k;
+ VARENT *ve;
+{
+ VAR *v;
+
+ v = ve->var;
+ if (KI_PROC(k)->p_blocked) {
+ if (KI_PROC(k)->p_mtxname)
+ (void)printf("%-*.*s", v->width, v->width,
+ KI_EPROC(k)->e_mtxname);
+ else
+ (void)printf("%-*s", v->width, "???");
+ } else
+ (void)printf("%-*s", v->width, "-");
+}
+
+void
wchan(k, ve)
KINFO *k;
VARENT *ve;