diff options
| author | Mikolaj Golub <trociny@FreeBSD.org> | 2012-02-02 18:17:49 +0000 |
|---|---|---|
| committer | Mikolaj Golub <trociny@FreeBSD.org> | 2012-02-02 18:17:49 +0000 |
| commit | a9c17fad1d0a30a8c2a6971c38a325b1c36bd1c6 (patch) | |
| tree | 57fddf06b59235d87746ef3e6d8bd342d87ce142 /usr.bin/procstat/procstat.c | |
| parent | a99e998ae06b3ce76fe6f27f5ee31aed734c2d54 (diff) | |
Notes
Diffstat (limited to 'usr.bin/procstat/procstat.c')
| -rw-r--r-- | usr.bin/procstat/procstat.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/usr.bin/procstat/procstat.c b/usr.bin/procstat/procstat.c index 97ff8792e58c..680325bee994 100644 --- a/usr.bin/procstat/procstat.c +++ b/usr.bin/procstat/procstat.c @@ -39,7 +39,8 @@ #include "procstat.h" -static int aflag, bflag, cflag, fflag, iflag, jflag, kflag, sflag, tflag, vflag; +static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, sflag, tflag; +static int vflag, xflag; int hflag, nflag, Cflag; static void @@ -47,8 +48,9 @@ usage(void) { fprintf(stderr, "usage: procstat [-h] [-C] [-M core] [-N system] " - "[-w interval] [-b | -c | -f | -i | -j | -k | -s | -t | -v]\n"); - fprintf(stderr, " [-a | pid ...]\n"); + "[-w interval] \n"); + fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " + "-s | -t | -v | -x] [-a | pid ...]\n"); exit(EX_USAGE); } @@ -60,6 +62,8 @@ procstat(struct procstat *prstat, struct kinfo_proc *kipp) procstat_bin(kipp); else if (cflag) procstat_args(kipp); + else if (eflag) + procstat_env(kipp); else if (fflag) procstat_files(prstat, kipp); else if (iflag) @@ -74,6 +78,8 @@ procstat(struct procstat *prstat, struct kinfo_proc *kipp) procstat_threads(kipp); else if (vflag) procstat_vm(kipp); + else if (xflag) + procstat_auxv(kipp); else procstat_basic(kipp); } @@ -117,7 +123,7 @@ main(int argc, char *argv[]) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "CN:M:abcfijkhstvw:")) != -1) { + while ((ch = getopt(argc, argv, "CN:M:abcefijkhstvw:x")) != -1) { switch (ch) { case 'C': Cflag++; @@ -141,6 +147,10 @@ main(int argc, char *argv[]) cflag++; break; + case 'e': + eflag++; + break; + case 'f': fflag++; break; @@ -186,6 +196,10 @@ main(int argc, char *argv[]) interval = l; break; + case 'x': + xflag++; + break; + case '?': default: usage(); @@ -196,7 +210,8 @@ main(int argc, char *argv[]) argv += optind; /* We require that either 0 or 1 mode flags be set. */ - tmp = bflag + cflag + fflag + (kflag ? 1 : 0) + sflag + tflag + vflag; + tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + sflag + tflag + + vflag + xflag; if (!(tmp == 0 || tmp == 1)) usage(); |
