summaryrefslogtreecommitdiffstats
path: root/usr.bin/procstat/procstat.c
diff options
context:
space:
mode:
authortrociny <trociny@FreeBSD.org>2011-11-24 20:54:06 +0000
committertrociny <trociny@FreeBSD.org>2011-11-24 20:54:06 +0000
commitded9c6c8464d184f0fd51877af4a60b0bcc8856a (patch)
treebab28aa6449da49aab280d6dc6bb56458b5de698 /usr.bin/procstat/procstat.c
parent7ca3e358b8342d88dd86344c3718956001de1f49 (diff)
downloadFreeBSD-src-ded9c6c8464d184f0fd51877af4a60b0bcc8856a.zip
FreeBSD-src-ded9c6c8464d184f0fd51877af4a60b0bcc8856a.tar.gz
usr.bin/procstat
Add -l flag to display resource limits. PR: bin/161257 Reviewed by: kib MFC after: 2 weeks
Diffstat (limited to 'usr.bin/procstat/procstat.c')
-rw-r--r--usr.bin/procstat/procstat.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.bin/procstat/procstat.c b/usr.bin/procstat/procstat.c
index 680325b..b0cee6b 100644
--- a/usr.bin/procstat/procstat.c
+++ b/usr.bin/procstat/procstat.c
@@ -39,8 +39,8 @@
#include "procstat.h"
-static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, sflag, tflag;
-static int vflag, xflag;
+static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, sflag;
+static int tflag, vflag, xflag;
int hflag, nflag, Cflag;
static void
@@ -50,7 +50,7 @@ usage(void)
fprintf(stderr, "usage: procstat [-h] [-C] [-M core] [-N system] "
"[-w interval] \n");
fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | "
- "-s | -t | -v | -x] [-a | pid ...]\n");
+ "-l | -s | -t | -v | -x] [-a | pid ...]\n");
exit(EX_USAGE);
}
@@ -72,6 +72,8 @@ procstat(struct procstat *prstat, struct kinfo_proc *kipp)
procstat_threads_sigs(prstat, kipp);
else if (kflag)
procstat_kstack(kipp, kflag);
+ else if (lflag)
+ procstat_rlimit(kipp);
else if (sflag)
procstat_cred(kipp);
else if (tflag)
@@ -123,7 +125,7 @@ main(int argc, char *argv[])
interval = 0;
memf = nlistf = NULL;
- while ((ch = getopt(argc, argv, "CN:M:abcefijkhstvw:x")) != -1) {
+ while ((ch = getopt(argc, argv, "CN:M:abcefijklhstvw:x")) != -1) {
switch (ch) {
case 'C':
Cflag++;
@@ -167,6 +169,10 @@ main(int argc, char *argv[])
kflag++;
break;
+ case 'l':
+ lflag++;
+ break;
+
case 'n':
nflag++;
break;
@@ -210,8 +216,8 @@ main(int argc, char *argv[])
argv += optind;
/* We require that either 0 or 1 mode flags be set. */
- tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + sflag + tflag +
- vflag + xflag;
+ tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + lflag + sflag +
+ tflag + vflag + xflag;
if (!(tmp == 0 || tmp == 1))
usage();
OpenPOWER on IntegriCloud