aboutsummaryrefslogtreecommitdiff
path: root/libbb/procps.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* ps,top: add an option to show threads. +260 bytes of codeDenys Vlasenko2009-09-191-0/+25
| | | | 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-3/+4
| | | | | | | | | | | 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, ps: do not output trailing spacesDenys Vlasenko2009-09-111-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* make find_pid_by_name look at /proc/PID/exe tooAlexander Shishkin2009-07-291-6/+12
| | | | | | | | | | function old new delta procps_scan 1642 1709 +67 find_pid_by_name 193 223 +30 free_procps_scan 29 37 +8 Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ps: conditionally support additional -o FIELDsDenys Vlasenko2009-07-031-2/+38
| | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
* libbb: password/group function helpers rewritten by Tito:Denis Vlasenko2008-12-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta xgetpwuid - 27 +27 uid2uname_utoa - 22 +22 gid2group_utoa - 22 +22 uid2uname - 18 +18 gid2group - 18 +18 buffer_fill_and_print 179 196 +17 print_user 12 24 +12 print_group 12 24 +12 get_cached 89 99 +10 ... print_common 134 120 -14 vlock_main 415 396 -19 logger_main 410 387 -23 crontab_main 642 609 -33 bb_getpwuid 42 - -42 bb_getgrgid 42 - -42 bb_getug 80 - -80 ------------------------------------------------------------------------------ (add/remove: 6/3 grow/shrink: 9/11 up/down: 187/-296) Total: -109 bytes
* top: optional SMP support by Vineet Gupta (vineetg76 AT gmail.com)Denis Vlasenko2008-09-251-7/+26
|
* libbb: make xrealloc_vector zero out the realloc'ed tailDenis Vlasenko2008-08-041-4/+4
| | | | | | | | | | | | | | function old new delta xrealloc_vector_helper 51 76 +25 man_main 712 705 -7 act 250 234 -16 create_list 91 70 -21 getopt_main 695 664 -31 load_dep_bb 281 248 -33 fileAction 744 709 -35 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/6 up/down: 25/-143) Total: -118 bytes
* libbb: [x]fopen_for_{read,write} introduced and used.Denis Vlasenko2008-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (by Valdimir) function old new delta config_open2 - 41 +41 config_read 507 542 +35 find_pair 169 187 +18 fopen_for_write - 14 +14 fopen_for_read - 14 +14 find_main 406 418 +12 xfopen_for_write - 10 +10 xfopen_for_read - 10 +10 popstring 134 140 +6 parse_inittab 396 401 +5 next_token 923 928 +5 pack_gzip 1659 1661 +2 bb__parsespent 117 119 +2 fallbackSort 1719 1717 -2 evalvar 1376 1374 -2 qrealloc 36 33 -3 ... ... ... ... singlemount 4579 4569 -10 process_stdin 443 433 -10 patch_main 1111 1101 -10 ifupdown_main 2175 2165 -10 file_action_grep 90 80 -10 uuidcache_init 649 637 -12 hush_main 797 785 -12 read_config 230 217 -13 dpkg_main 3835 3820 -15 read_line_input 3134 3110 -24 sysctl_main 232 203 -29 config_open 40 10 -30 WARN_BAD_LINE 44 - -44 login_main 1714 1575 -139 ------------------------------------------------------------------------------ (add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737) Total: -563 bytes
* pidof/killall: allow find_pid_by_name to find runningDenis Vlasenko2008-07-171-9/+8
| | | | | | processes started as scripts_with_name_longer_than_15_bytes.sh closes bug 4054 (and is generally neat)
* libbb: introduce and use xrealloc_vectorDenis Vlasenko2008-07-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta xrealloc_vector_helper - 51 +51 create_list 84 99 +15 getopt_main 690 695 +5 passwd_main 1049 1053 +4 get_cached 85 89 +4 msh_main 1377 1380 +3 add_match 42 41 -1 read_lines 720 718 -2 grave 1068 1066 -2 fill_match_lines 143 141 -2 add_to_dirlist 67 65 -2 add_input_file 49 47 -2 act 252 250 -2 fsck_main 2252 2246 -6 man_main 765 757 -8 bb_internal_initgroups 228 220 -8 cut_main 1052 1041 -11 add_edge_to_node 55 43 -12 dpkg_main 3851 3835 -16 ifupdown_main 2202 2178 -24 sort_main 838 812 -26 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 5/15 up/down: 82/-124) Total: -42 bytes
* *: introduce and use FAST_FUNC: regparm on i386, otherwise no-onDenis Vlasenko2008-06-271-9/+9
| | | | | | | text data bss dec hex filename 808035 611 6868 815514 c719a busybox_old 804472 611 6868 811951 c63af busybox_unstripped
* libbb: fix wrong sscanf count check (affects pidof etc)Denis Vlasenko2008-04-251-1/+1
|
* *: add -Wunused-parameter; fix resulting breakageDenis Vlasenko2008-03-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta procps_scan 1265 1298 +33 aliascmd 278 283 +5 parse_file_cmd 116 120 +4 dname_enc 373 377 +4 setcmd 90 93 +3 execcmd 57 60 +3 count_lines 72 74 +2 process_command_subs 340 339 -1 test_main 409 407 -2 mknod_main 179 177 -2 handle_incoming_and_exit 2653 2651 -2 argstr 1312 1310 -2 shiftcmd 131 128 -3 exitcmd 46 43 -3 dotcmd 297 294 -3 breakcmd 86 83 -3 evalpipe 353 349 -4 evalcommand 1180 1176 -4 evalcmd 109 105 -4 send_tree 374 369 -5 mkfifo_main 82 77 -5 evalsubshell 152 147 -5 typecmd 75 69 -6 letcmd 61 55 -6 add_cmd 1190 1183 -7 main 891 883 -8 ash_main 1415 1407 -8 parse_stream 1377 1367 -10 alloc_procps_scan 55 - -55 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148) Total: -94 bytes text data bss dec hex filename 797195 658 7428 805281 c49a1 busybox_old 797101 658 7428 805187 c4943 busybox_unstripped
* ps: add conditional support for -o [e]timeDenis Vlasenko2008-01-051-2/+5
|
* trivial typo fixDenis Vlasenko2007-09-291-1/+1
|
* pgrep,pkill: new applets by Loic Grenie <loic.grenie@gmail.com>Denis Vlasenko2007-09-291-1/+10
|
* remove if() which is always trueDenis Vlasenko2007-09-291-2/+1
|
* more "if (p) free(p)" fixes; fix a typo in commentDenis Vlasenko2007-09-281-12/+6
|
* top: TOPMEM feature - 's(how sizes)' command. +2.5k when enabled,Denis Vlasenko2007-09-081-0/+73
| | | | | | +80 bytes when disabled (mainly because of text wrapping fixes in display_process_list).
* ps: fix RSS parsing (rss field in /proc/PID/stat is in pages, not bytes)Denis Vlasenko2007-08-261-4/+15
|
* bb_getpwuid, bb_getgrgid: change order of arguments to more intuitive one;Denis Vlasenko2007-07-271-2/+3
| | | | | comment thoroughly when they die and when they dont.
* stray trailing tabs removedDenis Vlasenko2007-07-191-2/+2
|
* remove accumulated stray trailing whitespaceDenis Vlasenko2007-07-171-1/+1
|
* top,ps: improve /proc/PID/cmdinfo reading codeDenis Vlasenko2007-06-301-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | 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
* killall, pidof: use argv0 for process matching tooDenis Vlasenko2007-06-301-15/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* procps: shrink /proc scanning code a bitDenis Vlasenko2007-06-301-16/+22
| | | | | | | | | | | | | function old new delta skip_fields 16 15 -1 .rodata 144266 144258 -8 procps_scan 739 692 -47 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-56) Total: -56 bytes text data bss dec hex filename 734845 3028 14400 752273 b7a91 busybox_old 734789 3028 14400 752217 b7a59 busybox_unstripped
* remove extra ')'Denis Vlasenko2007-06-211-1/+1
|
* top,ps: 'stringify' tty only when needed. -60 bytes.Denis Vlasenko2007-06-191-18/+6
|
* top: speedup if tty info is not requestedDenis Vlasenko2007-06-191-1/+3
|
* top,ps: reduce CPU usage in decimal conversion (optional)Denis Vlasenko2007-06-191-2/+53
| | | | | | | text data bss dec hex filename 734651 3040 14416 752107 b79eb busybox_old 734751 3040 14416 752207 b7a4f busybox_unstripped
* top: add config option and code for global CPU % displayDenis Vlasenko2007-06-101-2/+9
|
* ps: fix -Z (by Yuichi Nakamura <ynakam@hitachisoft.jp>)Denis Vlasenko2007-06-061-1/+10
|
* procps: remove all global variablesDenis Vlasenko2007-04-191-1/+1
| | | | | | | | 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
* ps: add -o tty and -o rss supportDenis Vlasenko2007-04-191-7/+23
| | | | | 1373 14 24 1411 583 busybox.t1/procps/ps.o 1462 14 24 1500 5dc busybox.t2/procps/ps.o
* make sure ps/top output what they claim: vsz, not rss ... down the line we ↵Mike Frysinger2007-02-081-11/+5
| | | | should make the output controllable either at runtime or buildtime as both statistics are quite useful
* ls: use get_cached_username/groupnameDenis Vlasenko2007-01-191-3/+3
|
* Trailing whitespace removal over entire treeDenis Vlasenko2007-01-111-1/+1
|
* safe_strtoXX interface proved to be a bit unconvenient.Denis Vlasenko2006-11-271-1/+2
| | | | | Remove it, introduce saner bb_strtoXX. Saved ~350 bytes.
* tar: sanitize option handlingDenis Vlasenko2006-11-241-32/+32
|
* tar: small fixes:Denis Vlasenko2006-11-241-15/+19
| | | | | * size-optimize mapping code * kill double close
* tar: cache [ug]id->username/groupname mappings. Cuts down amountDenis Vlasenko2006-11-241-18/+48
| | | | | of open/read/close of /etc/passwd and /etc/group dramatically (we were rereading those for each untarred file!!!)
* replace /proc scanning code by more versatile one.Denis Vlasenko2006-11-051-90/+171
| | | | | | | 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
* top: improve CPU% calculationDenis Vlasenko2006-11-051-7/+0
| | | | style fixes
* Unneeded code removed, usused field "unsigned pscpu" removedDenis Vlasenko2006-11-011-4/+4
|
* PID should be stored in pid_t, not int or long.Denis Vlasenko2006-11-011-1/+2
| | | | | find_pid_by_name() was returning 0 or -1 in last array element, but -1 was never checked. We can use just 0 intead.
* add open_read_close() and similar stuffDenis Vlasenko2006-10-141-8/+2
|
* small style fixesDenis Vlasenko2006-10-121-1/+2
|
* Remove bb_ prefixes from xfuncs.c (and a few other places), consolidateRob Landley2006-08-031-1/+1
| | | | | | | | | | 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.)