Commit Graph

46 Commits

Author SHA1 Message Date
Denis Vlasenko
3bba545a54 done a dozen of randconfig test. guess what? ALL failed...
these are resulting fixes
2006-12-30 17:57:03 +00:00
Denis Vlasenko
459e4d6cf7 replace /proc scanning code by more versatile one.
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-05 00:43:51 +00:00
Denis Vlasenko
fa07680091 top: improve CPU% calculation
style fixes
2006-11-05 00:38:51 +00:00
Denis Vlasenko
35fb512728 PID should be stored in pid_t, not int or long.
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-11-01 09:16:49 +00:00
Denis Vlasenko
25d8062128 top: batch mode should output all processes 2006-10-27 09:34:22 +00:00
Denis Vlasenko
ea62077b85 add open_read_close() and similar stuff 2006-10-14 02:23:43 +00:00
Denis Vlasenko
1385899416 attempt to regularize atoi mess. 2006-10-08 12:49:22 +00:00
Denis Vlasenko
c12f53090b dnsd fix; option_mask32 added. dnsd needs more love. 2006-10-06 09:49:47 +00:00
Denis Vlasenko
67b23e6043 getopt_ulflags -> getopt32.
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-10-03 21:00:06 +00:00
Denis Vlasenko
266bc17690 top: add support for -b, -n <iterations> 2006-09-29 17:16:39 +00:00
Denis Vlasenko
42dfcd2612 top: fixed wrong comment, made error message more clear 2006-09-09 12:55:02 +00:00
Rob Landley
d921b2ecc0 Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
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-08-03 15:41:12 +00:00
Rob Landley
a526c30cc5 Make another warning go away. 2006-06-30 20:30:10 +00:00
Rob Landley
db1ab1aeb3 Top was catching sigterm (and fumbling sigint) so it could reset the terminal
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-28 14:11:25 +00:00
Bernhard Reutner-Fischer
e15d7573a1 - move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early.
2006-06-02 20:56:16 +00:00
Rob Landley
299a6b4d7b Consolidate #include <sys/time.h> so libbb.h does it. 2006-05-27 21:42:58 +00:00
Bernhard Reutner-Fischer
e2922e42a0 - make it C89 compatible; Declarations in the middle of a function is of course
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-19 12:48:56 +00:00
Rob Landley
0c43046fde Fix allbareconfig. 2006-05-04 19:51:22 +00:00
Rob Landley
997650b972 From Denis Vlasenko:
* 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-24 23:13:46 +00:00
Bernhard Reutner-Fischer
d9cf7ac781 - patch from Denis Vlasenko to add and use bb_xchdir() 2006-04-12 18:39:58 +00:00
"Vladimir N. Oleynik"
c218a29325 add last terminal line 2006-02-15 17:15:56 +00:00
"Vladimir N. Oleynik"
3afdfecf7e restore change by Denis Vlasenko: file_to_buf must vary fast, best if inline 2006-02-14 10:36:38 +00:00
Rob Landley
b2804551a0 Cleanups from Denis Vlasenko. 2006-02-13 22:04:27 +00:00
"Vladimir N. Oleynik"
51bfa54e46 removed warning "comparison between signed and unsigned". Added ATTRIBUTE_UNUSED. My whitespace 2006-01-30 13:58:34 +00:00
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
"Vladimir N. Oleynik"
70678bc5b6 getopt -> getopt_ulflags. noticed by Rob Sullivan 2005-11-29 12:32:33 +00:00
"Vladimir N. Oleynik"
f246dc7f57 ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE->CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE 2005-09-16 12:55:29 +00:00
"Vladimir N. Oleynik"
1e07f852e0 FEATURE->ENABLE_FEATURE loses one for 'top' applet 2005-09-14 16:08:06 +00:00
Mike Frysinger
038b076e55 some portability fixes by rmh in Bug 395 2005-08-27 18:18:06 +00:00
Mike Frysinger
223b887960 touchup syntax 2005-07-30 09:42:05 +00:00
Rob Landley
60158cb93e A patch from Takeharu KATO to update/fix SE-Linux support. 2005-05-03 06:25:50 +00:00
Eric Andersen
14f5c8d764 Patch from Bernhard Fischer to make a bunch of symbols static
which were otherwise cluttering the global namespace.
2005-04-16 19:39:00 +00:00
Glenn L McGrath
b6570d07c4 remove a cut/paste mistake, i better get some sleep. 2004-09-14 19:14:00 +00:00
Glenn L McGrath
225be8c1f0 Apply patch from Felipe Kellermann to simlify logic of sort functions.
I reversed the result of the sort functions to make the big numbers go to the top.
2004-09-14 18:56:52 +00:00
Eric Andersen
aff114c33d Larry Doolittle writes:
This is a bulk spelling fix patch against busybox-1.00-pre10.
If anyone gets a corrupted copy (and cares), let me know and
I will make alternate arrangements.

Erik - please apply.

Authors - please check that I didn't corrupt any meaning.

Package importers - see if any of these changes should be
passed to the upstream authors.

I glossed over lots of sloppy capitalizations, missing apostrophes,
mixed American/British spellings, and German-style compound words.

What is "pretect redefined for test" in cmdedit.c?

Good luck on the 1.00 release!

      - Larry
2004-04-14 17:51:38 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Glenn L McGrath
f6bba3d689 Splitting statements with #define's can cause trouble for cross
compilers (and it looks a bit messy)
2003-12-08 20:31:25 +00:00
Eric Andersen
7857c03808 Paul Mundt (lethal) writes:
Erik,

The format for /proc/meminfo has changed between 2.4 and 2.6, quite considerably.
In addition to the removal of the two-line summary that was present in 2.4,
MemShared was also removed. Presently (at least in busybox CVS HEAD), top fails
to parse this correctly and spews forth a:

top: failed to read 'meminfo'

message. This patch switches around some of the semantics a little to do sane
parsing for both 2.4 and 2.6. Also, in the event that the summary gets yanked
from 2.4, this patch will deal with that as well. With this patch, I'm able
to run top correctly on 2.6.0-test7 (tested on sh).

Please apply.

 procps/top.c |   60 +++++++++++++++++++++++++++++++++++++++++++++++------------
  1 files changed, 48 insertions(+), 12 deletions(-)
2003-10-11 18:47:20 +00:00
Eric Andersen
8efe967018 Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles.
 -Erik
2003-09-15 08:33:45 +00:00
Eric Andersen
9e48045e45 Patch from Russell Coker:
I've attached my latest SE Linux patch for busybox against the latest CVS
    version of busybox.
2003-07-03 10:07:04 +00:00
Manuel Novoa III
cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Eric Andersen
44608e9693 Patch last_pach62 from vodz. This patch moves all the /proc parsing
code into libbb so it can be shared by ps, top, etc, saving over 1.5k.
2002-10-22 12:21:15 +00:00
Eric Andersen
08a72209c9 last_patch58 from vodz:
Ok. I generate patch for include to busybox-devel my work with
    top (original author give me maintaining) and telnetd (my
    support and unofficial maintaining) applets.  Docs changes
    also: added awk, netstat, time applets to list ;)
2002-09-30 20:52:10 +00:00
Eric Andersen
3a1d8377ab don't leak FILEs 2002-09-20 07:33:18 +00:00
Manuel Novoa III
d499330e9e Commit vodz's patch, plus a tweak to change TracePid to TracerPid. Now
works on i386 (2.4.19) and arm (2.4.6).
2002-09-18 19:27:10 +00:00
Eric Andersen
420b208a45 Add a new top applet
-Erik
2002-09-17 22:14:58 +00:00