diff options
author | Denys Vlasenko | 2011-01-25 12:48:47 +0100 |
---|---|---|
committer | Denys Vlasenko | 2011-01-25 12:48:47 +0100 |
commit | 9aa599dc9dc076f6fa6e4312e4750a703cf16450 (patch) | |
tree | e5eba850b0f6cb53dc7077237ee640be98160cce /procps | |
parent | 9b3b9790b32d440eb89af5edda70a66b1829e861 (diff) | |
download | busybox-9aa599dc9dc076f6fa6e4312e4750a703cf16450.zip busybox-9aa599dc9dc076f6fa6e4312e4750a703cf16450.tar.gz |
top: replace %MEM with %VSZ in header text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps')
-rw-r--r-- | procps/top.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/procps/top.c b/procps/top.c index d7cc9af..ee65551 100644 --- a/procps/top.c +++ b/procps/top.c @@ -19,9 +19,9 @@ * * Sept 2008: Vineet Gupta <vineet.gupta@arc.com> * Added Support for reporting SMP Information - * - CPU where Process was last seen running + * - CPU where process was last seen running * (to see effect of sched_setaffinity() etc) - * - CPU Time Split (idle/IO/wait etc) PER CPU + * - CPU time split (idle/IO/wait etc) per CPU * * Copyright (c) 1992 Branko Lankester * Copyright (c) 1992 Roger Binns @@ -30,14 +30,24 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ -/* Howto snapshot /proc for debugging top problems: +/* How to snapshot /proc for debugging top problems: * for f in /proc/[0-9]*""/stat; do * n=${f#/proc/} * n=${n%/stat}_stat * cp $f $n * done - * cp /proc/stat /proc/meminfo . + * cp /proc/stat /proc/meminfo /proc/loadavg . * top -bn1 >top.out + * + * ...and how to run top on it on another machine: + * rm -rf proc; mkdir proc + * for f in [0-9]*_stat; do + * p=${f%_stat} + * mkdir -p proc/$p + * cp $f proc/$p/stat + * done + * cp stat meminfo loadavg proc + * chroot . ./top -bn1 >top1.out */ #include "libbb.h" @@ -528,7 +538,7 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width) /* what info of the processes is shown */ printf(OPT_BATCH_MODE ? "%.*s" : "\033[7m%.*s\033[0m", scr_width, - " PID PPID USER STAT VSZ %MEM" + " PID PPID USER STAT VSZ %VSZ" IF_FEATURE_TOP_SMP_PROCESS(" CPU") IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(" %CPU") " COMMAND"); @@ -546,7 +556,7 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width) # define FMT "%4u%%" #endif /* - * MEM% = s->vsz/MemTotal + * %VSZ = s->vsz/MemTotal */ pmem_shift = BITS_PER_INT-11; pmem_scale = UPSCALE*(1U<<(BITS_PER_INT-11)) / total_memory; @@ -606,7 +616,7 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width) sprintf(vsz_str_buf, "%6ldm", s->vsz/1024); else sprintf(vsz_str_buf, "%7ld", s->vsz); - /* PID PPID USER STAT VSZ %MEM [%CPU] COMMAND */ + /* PID PPID USER STAT VSZ %VSZ [%CPU] COMMAND */ col = snprintf(line_buf, scr_width, "\n" "%5u%6u %-8.8s %s%s" FMT IF_FEATURE_TOP_SMP_PROCESS(" %3d") |