summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-01-24 05:32:01 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-01-24 05:32:01 +0000
commitdf408d31a55d4a1ba2549af27cd554ef2c82dd0c (patch)
tree349b0e2931c3a3daf3680cfacd322c56a8c63b36
parentf22a3ad25cf9f609601ab24a3e1a6fc403872188 (diff)
Display process group in "ps /w" since they got removed from "ps /n".
While here fix the formating of /w /o and /a. ok guenther@
-rw-r--r--share/man/man4/ddb.44
-rw-r--r--sys/kern/kern_proc.c20
2 files changed, 13 insertions, 11 deletions
diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4
index 163ded5f1ef..dc667b20088 100644
--- a/share/man/man4/ddb.4
+++ b/share/man/man4/ddb.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ddb.4,v 1.84 2017/01/24 04:50:48 mpi Exp $
+.\" $OpenBSD: ddb.4,v 1.85 2017/01/24 05:32:00 mpi Exp $
.\" $NetBSD: ddb.4,v 1.5 1994/11/30 16:22:09 jtc Exp $
.\"
.\" Mach Operating System
@@ -849,7 +849,7 @@ Shows non-idle threads that were on CPU when ddb was entered.
Information printed includes thread ID, process ID, UID, process flags,
thread flags, current CPU, and command name.
.It Cm /w
-Shows each thread's ID, command, system call emulation,
+Shows each thread's ID, command, process group,
wait channel address, and wait channel message.
.El
.\" --------------------
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 206874a5979..c7ef304b31c 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_proc.c,v 1.74 2017/01/24 04:50:48 mpi Exp $ */
+/* $OpenBSD: kern_proc.c,v 1.75 2017/01/24 05:32:00 mpi Exp $ */
/* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */
/*
@@ -467,7 +467,7 @@ db_show_all_procs(db_expr_t addr, int haddr, db_expr_t count, char *modif)
switch (*mode) {
case 'a':
- db_printf(" TID %-10s %18s %18s %18s\n",
+ db_printf(" TID %-9s %18s %18s %18s\n",
"COMMAND", "STRUCT PROC *", "UAREA *", "VMSPACE/VM_MAP");
break;
case 'n':
@@ -475,12 +475,12 @@ db_show_all_procs(db_expr_t addr, int haddr, db_expr_t count, char *modif)
"TID", "PPID", "UID", "FLAGS", "WAIT", "COMMAND");
break;
case 'w':
- db_printf(" TID %-16s %-8s %18s %s\n",
- "COMMAND", "EMUL", "WAIT-CHANNEL", "WAIT-MSG");
+ db_printf(" TID %-15s %-5s %18s %s\n",
+ "COMMAND", "PGRP", "WAIT-CHANNEL", "WAIT-MSG");
break;
case 'o':
skipzomb = 1;
- db_printf(" TID %5s %5s %10s %10s %3s %-31s\n",
+ db_printf(" TID %5s %5s %10s %10s %3s %-30s\n",
"PID", "UID", "PRFLAGS", "PFLAGS", "CPU", "COMMAND");
break;
}
@@ -509,7 +509,7 @@ db_show_all_procs(db_expr_t addr, int haddr, db_expr_t count, char *modif)
switch (*mode) {
case 'a':
- db_printf("%-10.10s %18p %18p %18p\n",
+ db_printf("%-9.9s %18p %18p %18p\n",
pr->ps_comm, p, p->p_addr, p->p_vmspace);
break;
@@ -524,9 +524,11 @@ db_show_all_procs(db_expr_t addr, int haddr, db_expr_t count, char *modif)
break;
case 'w':
- db_printf("%-16s %-8s %18p %s\n", pr->ps_comm,
- pr->ps_emul->e_name, p->p_wchan,
- (p->p_wchan && p->p_wmesg) ?
+ db_printf("%-15s %-5d %18p %s\n",
+ pr->ps_comm, (pr->ps_pgrp ?
+ pr->ps_pgrp->pg_id : -1),
+ p->p_wchan,
+ (p->p_wchan && p->p_wmesg) ?
p->p_wmesg : "");
break;