From 2e978add60ff6fefcd2fe53a0d4ac30152be4378 Mon Sep 17 00:00:00 2001 From: alfred Date: Mon, 16 Aug 2004 07:51:22 +0000 Subject: This patch merges the sort fields for both pages, so you can (for example) view io stats while sorting by process size. Also adds voluntary and involuntary context-switch stats to the io page because there was lots of room. Submitted by: Dan Nelson dnelson at allantgroup.com --- contrib/top/commands.c | 2 +- contrib/top/top.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'contrib') diff --git a/contrib/top/commands.c b/contrib/top/commands.c index e594825..b79e19a 100644 --- a/contrib/top/commands.c +++ b/contrib/top/commands.c @@ -81,7 +81,7 @@ n or # - change number of processes to display\n", stdout); o - specify sort order (pri, size, res, cpu, time)\n", stdout); else fputs("\ -o - specify sort order (read, write, fault, total)\n", stdout); +o - specify sort order (vcsw, ivcsw, read, write, fault, total)\n", stdout); #endif fputs("\ r - renice a process\n\ diff --git a/contrib/top/top.c b/contrib/top/top.c index 7c5d09c..d3e1c56 100644 --- a/contrib/top/top.c +++ b/contrib/top/top.c @@ -95,8 +95,7 @@ char *kill_procs(); char *renice_procs(); #ifdef ORDER -extern int (*proc_compares[])(); -extern int (*io_compares[])(); +extern int (*compares[])(); #else extern int proc_compare(); extern int io_compare(); @@ -570,10 +569,7 @@ restart: get_system_info(&system_info); #ifdef ORDER - if (displaymode == DISP_CPU) - compare = proc_compares[order_index]; - else - compare = io_compares[order_index]; + compare = compares[order_index]; #else if (displaymode == DISP_CPU) compare = proc_compare; -- cgit v1.1