aboutsummaryrefslogtreecommitdiff
path: root/procps/top.c
AgeCommit message (Collapse)Author
2007-09-08top: TOPMEM feature - 's(how sizes)' command. +2.5k when enabled,Denis Vlasenko
+80 bytes when disabled (mainly because of text wrapping fixes in display_process_list).
2007-08-29top: another readability fixDenis Vlasenko
2007-08-29top: don't wait before final bailout (try top -b -n1).Denis Vlasenko
top: make code a bit more readable.
2007-08-28top: use poll instead of select for waiting on one descriptorDenis Vlasenko
smart_ulltoa5: make it more cryptic. -50 bytes. function old new delta passwd_main 1095 1103 +8 getNum 557 565 +8 buffer_fill_and_print 73 76 +3 udhcpc_main 2393 2395 +2 mkfs_minix_main 3071 3070 -1 dname_enc 377 373 -4 expmeta 480 472 -8 smart_ulltoa5 334 283 -51 top_main 911 815 -96 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/5 up/down: 21/-160) Total: -139 bytes text data bss dec hex filename 770872 1063 10788 782723 bf183 busybox_old 770732 1063 10788 782583 bf0f7 busybox_unstripped
2007-08-23*: compile fixes for 64-bit buildDenis Vlasenko
2007-08-18don't pass argc in getopt32, it's superfluousDenis Vlasenko
(add/remove: 0/0 grow/shrink: 12/131 up/down: 91/-727) Total: -636 bytes text data bss dec hex filename 773469 1058 11092 785619 bfcd3 busybox_old 772644 1058 11092 784794 bf99a busybox_unstripped
2007-08-17assorted fixes for breakage found by randomconfigDenis Vlasenko
2007-07-15top: nested function allows us to reuse some codeDenis Vlasenko
(not everyone likes them - but code does get smaller). display_generic - 761 +761 static.fmt_100percent_8 - 111 +111 fmt_100percent_8 101 - -101 display_status 1489 581 -908 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 0/1 up/down: 872/-1009) Total: -137 bytes text data bss dec hex filename 677020 3344 13936 694300 a981c busybox_old 676876 3344 13936 694156 a978c busybox_unstripped
2007-07-15top: make "100%" case less ugly, and shrink code while at itDenis Vlasenko
fmt_100percent_8 - 101 +101 .rodata 129185 129153 -32 display_status 1726 1489 -237 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 101/-269) Total: -168 bytes text data bss dec hex filename 677180 3344 13936 694460 a98bc busybox_old 677020 3344 13936 694300 a981c busybox_unstripped
2007-07-15top: simpler loadavg processingDenis Vlasenko
display_status 1787 1726 -61 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-61) Total: -61 bytes text data bss dec hex filename 677244 3344 13936 694524 a98fc busybox_old 677180 3344 13936 694460 a98bc busybox_unstripped
2007-07-15top: truncate usernames to 8 charsDenis Vlasenko
2007-06-30top,ps: improve /proc/PID/cmdinfo reading codeDenis Vlasenko
function old new delta display_status - 1231 +1231 read_cmdline - 101 +101 parse_conf 1284 1303 +19 arith 2033 2042 +9 collect_blk 467 474 +7 fsck_main 1909 1911 +2 dhcprelay_main 1125 1122 -3 singlemount 4555 4547 -8 read_close 50 36 -14 get_lcm 123 105 -18 ed_main 3111 3084 -27 func_args 73 28 -45 procps_scan 732 658 -74 top_main 2187 899 -1288 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 4/8 up/down: 1369/-1477) Total: -108 bytes text data bss dec hex filename 676048 2744 13968 692760 a9218 busybox_old 675940 2744 13968 692652 a91ac busybox_unstripped
2007-06-30killall, pidof: use argv0 for process matching tooDenis Vlasenko
top: show cmdline, not comm field (fixes problems with re-execed applets showing as processes with name "exe", and not being found by pidof/killall by applet name) function old new delta find_pid_by_name 98 156 +58 procps_scan 692 732 +40 top_main 2724 2762 +38 find_pair 164 180 +16 collect_int 114 123 +9 cmp_main 547 555 +8 collect_fork 112 119 +7 collect_ctx 112 119 +7 read_package_field 253 257 +4 passwd_main 1983 1985 +2 process_stdin 435 433 -2 xstrtoul_range_sfx 229 226 -3 get_next_block 1852 1849 -3 arith 2042 2033 -9 sv_main 1236 1226 -10 singlemount 4690 4672 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 10/6 up/down: 189/-45) Total: 144 bytes text data bss dec hex filename 734789 3028 14400 752217 b7a59 busybox_old 734933 3028 14400 752361 b7ae9 busybox_unstripped
2007-06-11top: on user suggestion make percentile calculations configurable. -56 bytes ↵Denis Vlasenko
when off. +600 bytes when on top: reorder columns, so that [P]PIDs are together and VSZ/%MEM are together. Makes more sense
2007-06-10top: improve global CPU percentage (smaller & faster code)Denis Vlasenko
2007-06-10top: add config option and code for global CPU % displayDenis Vlasenko
2007-05-26usage.c: remove reference to busybox.hDenis Vlasenko
*: s/include "busybox.h"/include "libbb.h"
2007-04-19procps: remove all global variablesDenis Vlasenko
text data bss dec hex filename 1462 14 24 1500 5dc busybox.t2/procps/ps.o 1484 0 0 1484 5cc busybox.t3/procps/ps.o 3122 0 252 3374 d2e busybox.t1/procps/top.o 3117 0 0 3117 c2d busybox.t3/procps/top.o
2007-04-16style fixes, no code changesDenis Vlasenko
2007-02-08make sure ps/top output what they claim: vsz, not rss ... down the line we ↵Mike Frysinger
should make the output controllable either at runtime or buildtime as both statistics are quite useful
2007-02-03suppress warnings about easch <applet>_main() havingDenis Vlasenko
no preceding prototype
2007-01-11Trailing whitespace removal over entire treeDenis Vlasenko
2006-12-30done a dozen of randconfig test. guess what? ALL failed...Denis Vlasenko
these are resulting fixes
2006-11-05replace /proc scanning code by more versatile one.Denis Vlasenko
Use it where appropriate. Stop scanning /etc/passwd *for every process*!!! (uid->username) top: reduce memory usage - we won't save unneeded fields from /proc info anymore. Downside: ~+250 bytes of code
2006-11-05top: improve CPU% calculationDenis Vlasenko
style fixes
2006-11-01PID should be stored in pid_t, not int or long.Denis Vlasenko
find_pid_by_name() was returning 0 or -1 in last array element, but -1 was never checked. We can use just 0 intead.
2006-10-27top: batch mode should output all processesDenis Vlasenko
2006-10-14add open_read_close() and similar stuffDenis Vlasenko
2006-10-08attempt to regularize atoi mess.Denis Vlasenko
2006-10-06dnsd fix; option_mask32 added. dnsd needs more love.Denis Vlasenko
2006-10-03getopt_ulflags -> getopt32.Denis Vlasenko
It is impossible to formulate sane ABI based on size of ulong because it can be 32-bit or 64-bit. Basically it means that you cannot portably use more that 32 option chars in one call anyway... Make it explicit.
2006-09-29top: add support for -b, -n <iterations>Denis Vlasenko
2006-09-09top: fixed wrong comment, made error message more clearDenis Vlasenko
2006-08-03Remove bb_ prefixes from xfuncs.c (and a few other places), consolidateRob Landley
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
2006-06-30Make another warning go away.Rob Landley
2006-06-28Top was catching sigterm (and fumbling sigint) so it could reset the terminalRob Landley
type on the way out, but the signal handler didn't exit. Plus it did unnecessary things with sigaction. This code is overgrown and needs a serious weed-whacking...
2006-06-02- move #include busybox.h to the very top so we pull in the configBernhard Reutner-Fischer
and eventual platform specific includes in early.
2006-05-27Consolidate #include <sys/time.h> so libbb.h does it.Rob Landley
2006-05-19- make it C89 compatible; Declarations in the middle of a function is of courseBernhard Reutner-Fischer
fine in C99, but it really serves no purpose other than breaking compilation on C89 compilers. Thanks to Rich Felker for pointing this out.
2006-05-04Fix allbareconfig.Rob Landley
2006-04-24From Denis Vlasenko:Rob Landley
* CPU% = process[i].ticks/sum(process[i].ticks) * busy_cpu_ticks/total_cpu_ticks * got rid of empty line under "Load average" line   and used last line - +2 visible processes * do not do float conversion of loadavg, just read it as string from /proc * fix display on small screens * dropped unused .stime, .utime fields * a few variables were renamed * style fixes
2006-04-12- patch from Denis Vlasenko to add and use bb_xchdir()Bernhard Reutner-Fischer
2006-02-15add last terminal line"Vladimir N. Oleynik"
2006-02-14restore change by Denis Vlasenko: file_to_buf must vary fast, best if inline"Vladimir N. Oleynik"
2006-02-13Cleanups from Denis Vlasenko.Rob Landley
2006-01-30removed warning "comparison between signed and unsigned". Added ↵"Vladimir N. Oleynik"
ATTRIBUTE_UNUSED. My whitespace
2006-01-25just whitespaceTim Riker
2005-11-29getopt -> getopt_ulflags. noticed by Rob Sullivan"Vladimir N. Oleynik"
2005-09-16ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE->CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE"Vladimir N. Oleynik"
2005-09-14FEATURE->ENABLE_FEATURE loses one for 'top' applet"Vladimir N. Oleynik"