diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-12-10 20:55:43 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-12-10 20:55:43 +0000 |
commit | 8bc41fcc02ff4a03b29c2a776d0866b0030bcdc2 (patch) | |
tree | d45a0b2693d7dfd7613ff915d2c1cc46c6ca0e8d /usr.bin/procstat/procstat_args.c | |
parent | 95c502771082069b023dca6ea4367751107e3d52 (diff) | |
download | FreeBSD-src-8bc41fcc02ff4a03b29c2a776d0866b0030bcdc2.zip FreeBSD-src-8bc41fcc02ff4a03b29c2a776d0866b0030bcdc2.tar.gz |
Add 'COMM' column to a few more output modes of procstat(1). The only
one it's missing from is the VM display, where there's really not room,
and the file output display is looking quite cramped.
Diffstat (limited to 'usr.bin/procstat/procstat_args.c')
-rw-r--r-- | usr.bin/procstat/procstat_args.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/procstat/procstat_args.c b/usr.bin/procstat/procstat_args.c index f4a27a0..84da1d8 100644 --- a/usr.bin/procstat/procstat_args.c +++ b/usr.bin/procstat/procstat_args.c @@ -28,6 +28,7 @@ #include <sys/types.h> #include <sys/sysctl.h> +#include <sys/user.h> #include <err.h> #include <errno.h> @@ -48,7 +49,7 @@ procstat_args(pid_t pid, struct kinfo_proc *kipp) char *cp; if (!hflag) - printf("%5s %-70s\n", "PID", "ARGS"); + printf("%5s %-16s %-53s\n", "PID", "COMM", "ARGS"); name[0] = CTL_KERN; name[1] = KERN_PROC; @@ -68,6 +69,7 @@ procstat_args(pid_t pid, struct kinfo_proc *kipp) } printf("%5d ", pid); + printf("%-16s ", kipp->ki_comm); for (cp = args; cp < args + len; cp += strlen(cp) + 1) printf("%s%s", cp != args ? " " : "", cp); printf("\n"); |