summaryrefslogtreecommitdiffstats
path: root/contrib/top/top.c
diff options
context:
space:
mode:
authorkeramida <keramida@FreeBSD.org>2005-04-14 15:02:03 +0000
committerkeramida <keramida@FreeBSD.org>2005-04-14 15:02:03 +0000
commiteae5910982acd983a47a3d98046dc0af087d9862 (patch)
tree11b507e6e5e0f2b5c5a4050db800007183192c9d /contrib/top/top.c
parentbee55215dc537762c0e3a6da98437e58d60dd31f (diff)
downloadFreeBSD-src-eae5910982acd983a47a3d98046dc0af087d9862.zip
FreeBSD-src-eae5910982acd983a47a3d98046dc0af087d9862.tar.gz
- Add a THR column to the process listing, that shows the number of
threads a process has. The THR column is disabled and disappears when 'H' is hit, because then every thread gets its own output line. - Allow sorting processes by "threads". Approved by: davidxu Inspired by: Jiawei Ye <leafy7382@gmail.com>
Diffstat (limited to 'contrib/top/top.c')
-rw-r--r--contrib/top/top.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/top/top.c b/contrib/top/top.c
index d3e1c56..2f7fa2f 100644
--- a/contrib/top/top.c
+++ b/contrib/top/top.c
@@ -84,6 +84,7 @@ void quit();
static int max_topn; /* maximum displayable processes */
/* miscellaneous things */
+struct process_select ps;
char *myname = "top";
jmp_buf jmp_int;
@@ -179,7 +180,6 @@ char *argv[];
char *iptr;
char no_command = 1;
struct timeval timeout;
- struct process_select ps;
#ifdef ORDER
char *order_name = NULL;
int order_index = 0;
@@ -987,8 +987,10 @@ restart:
case CMD_thrtog:
ps.thread = !ps.thread;
new_message(MT_standout | MT_delayed,
- " %sisplaying threads.",
- ps.thread ? "D" : "Not d");
+ "Displaying threads %s",
+ ps.thread ? "separately" : "as a count");
+ header_text = format_header(uname_field);
+ reset_display();
putchar('\r');
break;
case CMD_viewtog:
OpenPOWER on IntegriCloud