summaryrefslogtreecommitdiffstats
path: root/usr.bin/top
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2014-05-17 02:39:20 +0000
committerbdrewery <bdrewery@FreeBSD.org>2014-05-17 02:39:20 +0000
commit7b44e09267defcf7c18d1b8ed0a8331d4a3a7bb7 (patch)
tree5f0484f8e2ab1b7233fdaff1b7511269ee368945 /usr.bin/top
parenta0f7dc4feb575b542dbe33a427e89503bbd17007 (diff)
downloadFreeBSD-src-7b44e09267defcf7c18d1b8ed0a8331d4a3a7bb7.zip
FreeBSD-src-7b44e09267defcf7c18d1b8ed0a8331d4a3a7bb7.tar.gz
MFC r265249,r265250,r265251:
- Add -J command/flag to filter by jail name/jid. This will automatically display the JID as well (the -j command/flag). - Add a hint for 'u' and 'J' command that '+' displays all. - Add J command to help.
Diffstat (limited to 'usr.bin/top')
-rw-r--r--usr.bin/top/Makefile4
-rw-r--r--usr.bin/top/machine.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/top/Makefile b/usr.bin/top/Makefile
index 864473f..de08724 100644
--- a/usr.bin/top/Makefile
+++ b/usr.bin/top/Makefile
@@ -21,8 +21,8 @@ WARNS?= 0
CFLAGS+= -D"Table_size=${TOP_TABLE_SIZE}"
.endif
-DPADD= ${LIBTERMCAP} ${LIBM} ${LIBKVM}
-LDADD= -ltermcap -lm -lkvm
+DPADD= ${LIBTERMCAP} ${LIBM} ${LIBKVM} ${LIBJAIL}
+LDADD= -ltermcap -lm -lkvm -ljail
CLEANFILES= sigdesc.h
SIGCONV_AWK= ${.CURDIR}/../../contrib/top/sigconv.awk
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 190ea26..78976e1 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -668,6 +668,7 @@ get_process_info(struct system_info *si, struct process_select *sel,
/* these are copied out of sel for speed */
int show_idle;
+ int show_jid;
int show_self;
int show_system;
int show_uid;
@@ -710,6 +711,7 @@ get_process_info(struct system_info *si, struct process_select *sel,
/* set up flags which define what we are going to select */
show_idle = sel->idle;
+ show_jid = sel->jid != -1;
show_self = sel->self == -1;
show_system = sel->system;
show_uid = sel->uid != -1;
@@ -764,6 +766,10 @@ get_process_info(struct system_info *si, struct process_select *sel,
/* skip processes that aren't doing I/O */
continue;
+ if (show_jid && pp->ki_jid != sel->jid)
+ /* skip proc. that don't belong to the selected JID */
+ continue;
+
if (show_uid && pp->ki_ruid != (uid_t)sel->uid)
/* skip proc. that don't belong to the selected UID */
continue;
OpenPOWER on IntegriCloud