aboutsummaryrefslogtreecommitdiff
path: root/bin/ps/print.c
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/ps/print.c
parent6580291ba42cbd933db8f3ac06be1e3dfb89d992 (diff)
downloadsrc-fd5f30bf38259747b7053f2d33c30b412b395a03.tar.gz
src-fd5f30bf38259747b7053f2d33c30b412b395a03.zip
Introduce a 'mtxname' keyword that displays the current mutex that a
process is blocked on or '-'.
Notes
Notes: svn path=/head/; revision=69372
Diffstat (limited to 'bin/ps/print.c')
-rw-r--r--bin/ps/print.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 600a639b9214..9b1c913a86a4 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;