aboutsummaryrefslogtreecommitdiff
path: root/procps/top.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* top: fix help text: with !TERMIOS, no keys are affected top outputDenys Vlasenko2016-12-031-1/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Convert all procps/* applets to "new style" applet definitionsDenys Vlasenko2016-11-231-1/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: move free(prev_hist) out of signal pathDenys Vlasenko2016-08-191-6/+6
| | | | | | | It was seen being called recursively on repeated signals, leading to double free Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: slap on a few ALIGN1/2s where appropriateDenys Vlasenko2016-04-221-3/+3
| | | | | | | | | | The result of looking at "grep -F -B2 '*fill*' busybox_unstripped.map" text data bss dec hex filename 829901 4086 1904 835891 cc133 busybox_before 829665 4086 1904 835655 cc047 busybox Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: add most of the required setup_common_bufsiz() callsDenys Vlasenko2016-04-211-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: make bb_common_bufsiz1 1 kbyte, add capability to use bss tail for itDenys Vlasenko2016-04-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The config item is FEATURE_USE_BSS_TAIL. When it is off (default): function old new delta read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 push 46 44 -2 inetd_main 2136 2134 -2 uevent_main 421 418 -3 addLines 97 92 -5 bb_common_bufsiz1 8193 1024 -7169 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/5 up/down: 62/-7181) Total: -7119 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829901 4086 1904 835891 cc133 busybox_unstripped FEATURE_USE_BSS_TAIL=y: read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 inetd_main 2136 2134 -2 bb_common_bufsiz1 8193 - -8193 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 8/1 up/down: 62/-8195) Total: -8133 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829911 4086 880 834877 cbd3d busybox_unstripped FIXME: setup_common_bufsiz() calls are missing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: make sort field for 's' mode less confusingDenys Vlasenko2015-10-141-13/+14
| | | | | | | function old new delta display_topmem_process_list 542 565 +23 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: more BUILD_BUG_ON conversionsDenys Vlasenko2015-10-131-5/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: fix memset length (sizeof(ptr) vs sizeof(array) problem)Denys Vlasenko2014-07-291-2/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: fix and merge code to parse /proc/meminfoTimo Teräs2014-07-271-110/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | display_header() code to parse meminfo as is was buggy: - uninitialized variables were used if meminfo was not as expected - meminfo parsing failed on new kernels (3.14+) as new field 'MemAvailable' was introduced between MemFree and Buffers - shared memory was handled only for ancient kernels (2.4.x and earlier) as result Buffers and shared memory fields were shown with bogus values on current kernels. The new code does not try to parse the old style summary header, as the separated fields are always present (it saves code size). Additionally, both Shmem (2.6+) and MemShared (2.4 and earlier) fields are now parsed and summed for shared memory usage; as only one of them exists depending on kernel version. display_topmem_header() parses also meminfo so this makes it use the same code for code shrink. function old new delta display_header - 681 +681 display_topmem_process_list 465 684 +219 parse_meminfo - 189 +189 static.fields - 106 +106 static.match 132 - -132 .rodata 120254 120117 -137 display_topmem_header 513 - -513 display_process_list 1705 667 -1038 ------------------------------------------------------------------------------ (add/remove: 3/2 grow/shrink: 1/2 up/down: 1195/-1820) Total: -625 bytes Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top.c: fix compilation warningsBartosz Golaszewski2014-01-201-5/+0
| | | | | | | pfd[1] is unused Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Use unsigned printf/scanf conversion where more appropriateDenys Vlasenko2013-11-291-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: fix breakage introduced by previous commitDenys Vlasenko2013-09-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Make smart_ulltoa return pointer to end (allows for code shink in callers)Denys Vlasenko2013-09-061-2/+1
| | | | | | | | | | | | | function old new delta smart_ulltoa5 405 408 +3 smart_ulltoa4 273 276 +3 list_table 1113 1114 +1 scale 36 34 -2 put_lu 55 53 -2 ulltoa6_and_space 19 14 -5 powertop_main 1470 1461 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: reuse more stringsDenys Vlasenko2013-01-221-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace cleanup. no code changesDenys Vlasenko2013-01-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: correctness/size tweaks in signal-related helpersDenys Vlasenko2012-09-271-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: do not touch stdin if -bDenys Vlasenko2012-09-261-10/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: fix build failure in !USE_TERMIOS caseDenys Vlasenko2012-09-251-17/+20
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: implement scrolling up/down (_very_ useful)Denys Vlasenko2012-09-211-20/+110
| | | | | | | | | | | | | function old new delta handle_input 494 564 +70 top_main 928 947 +19 display_topmem_process_list 363 381 +18 display_process_list 1442 1453 +11 clearmems 38 28 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 118/-10) Total: 108 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* add INIT_G()'s. No code changes.Denys Vlasenko2011-09-211-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: display sort indicator in memory displayDenys Vlasenko2011-05-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: better indicator of selected field in mem viewDenys Vlasenko2011-05-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: another scripting improvementDenys Vlasenko2011-05-061-16/+27
| | | | | | | function old new delta handle_input 492 493 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: make it possible to feed commands via pipeDenys Vlasenko2011-05-061-110/+155
| | | | | | | | | | | | function old new delta handle_input - 492 +492 mult_lvl_cmp 38 49 +11 packed_usage 28247 28257 +10 top_main 1345 928 -417 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/1 up/down: 513/-417) Total: 96 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: replace %MEM with %VSZ in header textDenys Vlasenko2011-01-251-7/+17
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: document a debugging scriptDenys Vlasenko2011-01-251-2/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: add keyboard commands to --helpDenys Vlasenko2011-01-131-0/+29
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* top: Use _exit() instead of exit() in sighandlerMarek Polacek2010-10-271-1/+2
| | | | | Signed-off-by: Marek Polacek <mmpolacek@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* pmap: new applet. +1k.Alexander Shishkin2010-08-281-8/+8
| | | | | | | | | | | | | | | | | | | pmap is a tool used to look at processes' memory maps, normally found in procps package. It provides more readable and easily sortable output (one line per mapping) from maps/smaps files in /proc/PID/. This would help in debugging memory usage issues, especially on devices where lots of typing is not a viable option. This patch does'n implement -d and -A command line options of GNU pmap, since those are not that must have features and I was afraid of going blind from looking at its code. The implementation takes smaps scanning part out of procps_scan() function and moves it into procps_read_smaps(), which does more detailed processing of a single PID's smaps data. Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: add tie breaking for topmem modeDenys Vlasenko2010-07-131-4/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: code shrink, -26 bytesDenys Vlasenko2010-06-061-33/+27
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: code shrinkMaksym Kryzhanovskyy2010-06-061-77/+42
| | | | | | | | | text data bss dec hex filename 853034 453 6820 860307 d2093 busybox_old 852726 453 6820 859999 d1f5f busybox_unstripped Signed-off-by: Maksym Kryzhanovskyy <xmaks@email.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* consolidate ESC sequencesDenys Vlasenko2010-05-161-4/+4
| | | | | | | | | | | | | | function old new delta bell 2 - -2 CMdown 2 - -2 Ceos 4 - -4 Ceol 4 - -4 CMup 4 - -4 SOs 5 - -5 SOn 5 - -5 CMrc 9 - -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: make 's' display easier to understandDenys Vlasenko2010-03-041-6/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: suppress ~60% of "aliased warnings" on gcc-4.4.1Denys Vlasenko2010-02-041-3/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: do not use #if inside printf, it can be a macroDenys Vlasenko2009-11-071-18/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use ffulsh_all()Denys Vlasenko2009-11-021-2/+2
| | | | | | | | | | | | | | | | | | | | function old new delta buffer_fill_and_print 179 196 +17 fflush_all - 9 +9 spawn 87 92 +5 rtcwake_main 455 453 -2 ... alarm_intr 93 84 -9 readcmd 1072 1062 -10 bb_ask 345 333 -12 more_main 845 832 -13 flush_stdout_stderr 42 23 -19 xfflush_stdout 27 - -27 flush_stderr 30 - -30 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397) Total: -366 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* randomconfig fixesDenys Vlasenko2009-10-191-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ps: conditionally enable -T on non-DESKTOP build tooDenys Vlasenko2009-09-211-3/+3
| | | | | | | function old new delta ps_main 253 274 +21 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ps,top: add an option to show threads. +260 bytes of codeDenys Vlasenko2009-09-191-5/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: remove GCCismsDenys Vlasenko2009-09-121-5/+12
| | | | | | | function old new delta display_process_list 1447 1448 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix read_cmdline API and a small buglet where "[comm]" may be too narrowDenys Vlasenko2009-09-121-1/+1
| | | | | | | | | | | function old new delta func_args 25 26 +1 read_cmdline 119 114 -5 display_process_list 1462 1447 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 1/-20) Total: -19 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: add -m ("memory") optionDenys Vlasenko2009-09-111-51/+57
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ps: conditionally support additional -o FIELDsDenys Vlasenko2009-07-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | | function old new delta procps_scan 1409 1642 +233 out_spec 220 300 +80 func_ruser - 36 +36 func_rgroup - 36 +36 func_group 13 49 +36 func_nice - 29 +29 buffer_fill_and_print 179 196 +17 send_tree 355 360 +5 mkfs_vfat_main 1604 1609 +5 display_speed 85 90 +5 scriptreplay_main 194 197 +3 find_out_spec 55 58 +3 changepath 192 195 +3 sha1_process_block64 497 484 -13 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 10/1 up/down: 491/-13) Total: 478 bytes Signed-off-by: David Krakov <krakov@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: mass renaming of USE_XXXX to IF_XXXXDenis Vlasenko2009-04-211-5/+5
| | | | | | and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
* top: make it work again on 2.4 kernels (closes bug 125)Denis Vlasenko2009-03-031-7/+6
|
* Fix forgotten license commentsDenis Vlasenko2008-12-071-7/+4
|
* ash,hush: add TODO for rare build failureDenis Vlasenko2008-11-251-2/+0
| | | | | *: remove some redundant includes