Commit Graph

76 Commits

Author SHA1 Message Date
alfred
2e978add60 This patch merges the sort fields for both pages, so you can (for
example) view io stats while sorting by process size.  Also adds
voluntary and involuntary context-switch stats to the io page because
there was lots of room.

Submitted by: Dan Nelson dnelson at allantgroup.com
2004-08-16 07:51:22 +00:00
alfred
d879bd3de1 Comment some of the 'io' functions. 2004-08-01 09:19:41 +00:00
des
8572ddd501 Adjust the show_self code (the test got inadvertantly reversed a couple of
revisions ago)

Submitted by:	Alex Vasylenko <lxv@omut.org>
2004-07-12 08:22:32 +00:00
alfred
221d6a099a Cache a pointer to the old proc (as well as negative cache) to make
computing the io statistics over and over not as expensive.
This is a bit of a cop out, as I should just allocate a struct with
the computed values, but this will do for now.
2004-07-12 04:55:07 +00:00
keramida
600bdc3b55 Build upon the nice work of Alfred and add sorting capabilities to
the -m "io" mode of top.

Approved by:	alfred
2004-07-08 16:45:55 +00:00
des
c4117f7592 Additional preemptive unsigned -> signed casts. 2004-07-05 14:55:58 +00:00
des
96a5183b12 ki_pctcpu is unsigned, so we cast to long before subtracting. 2004-07-05 14:52:06 +00:00
des
b974c26308 Unhealthy amount of manual code cleanup. Some long lines still remain. 2004-07-05 14:45:57 +00:00
des
335407ec32 Apply consistent indentation. Long lines will be fixed in a separate
commit.
2004-07-05 13:12:16 +00:00
des
f5b03d5305 Protoize. 2004-07-05 13:03:35 +00:00
des
3414e8bf94 Sort out the #include mess. In particular, do not #include "os.h", since
all it does is provide broken prototypes for standard library functions.
2004-07-05 12:58:47 +00:00
des
e1e6a65474 Mechanical whitespace cleanup. 2004-07-05 12:51:35 +00:00
des
a9156607eb My previous commit fixed uid filtering, but broke io mode. Unravel the
process filtering logic to prevent this from happening again.
2004-07-05 12:48:17 +00:00
des
f8b24b7f7a Fix selecting processes by uid, which was broken in the previous commit. 2004-07-05 12:22:50 +00:00
alfred
69c1c1f072 Tell what percentage of the total IO a process is doing.
TODO: Show system totals.
2004-07-01 15:49:28 +00:00
alfred
bf711ae9b2 New feature, provide a display that shows the amount of IO processes
are doing.  Toggle this mode by hitting "m" or passing the command line
option "-m io" to top(1).  This allows one to identify disk bandwidth
hogs much easier.
2004-07-01 09:12:38 +00:00
alfred
ec6be8bb4a style, remove register. 2004-06-30 04:19:23 +00:00
green
5c9b04429a Do not use KERN_PROC_PROC with kvm_getproc(3); instead, if only process
(and not thread) scope is to be displayed, use KERN_PROC_ALL and
accrue CPU% ourselves, as the kernel makes no attempt to do so.

Of course, this doesn't make most stats any less bogus when displaying
threaded processes, but at least the CPU time is added up and not just
always 0.00%.  There are still issues with SCHED_ULE in top(1) that
cause other processes to display 0.00% CPU when they in fact have used
more.
2004-06-06 19:59:06 +00:00
julian
788547d4cf Changes to allow top to decide whether or not to show multiple threads per
process. Option -H enables it and it is toggled at the interactive
screen by 'H'.

Submitted by:	Jung-uk Kim <jkim@niksun.com>
2003-07-17 23:56:40 +00:00
phk
4bfb37f22e Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
jhb
b79961de95 Catch up to SMTX -> SLOCK changes. 2002-10-02 20:33:52 +00:00
charnier
7dd9d47059 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:23:09 +00:00
imp
0b20191705 remove __P 2002-03-22 01:42:45 +00:00
markm
31d81e4fbc Remove NO_WERRORs and WARNS=n's. To be revisited after GCC3. 2002-02-08 23:07:37 +00:00
dwmalone
af61797ee4 Add new option HAVE_STRERROR to CFLAGS. 2002-01-24 17:59:39 +00:00
markm
a1e7edd73c Protect this against the coming WARNS=2 default. 2001-12-12 00:05:16 +00:00
bde
229c3ac7c3 Compensate for "Compensate for header dethreading" by backing it out. 2001-10-10 17:48:44 +00:00
ru
e381dd2c3a Generate top.local.h and manpage dynamically, with sed(1) script.
The generated manpage will now describe the actual behavior of
top(1) WRT how many processes it displays.  This also eliminates
all troff(1) warnings.
2001-07-12 15:07:30 +00:00
tmm
b1d338257d Cast size_t variables before printing them to cope with the case of
sizeof(size_t) != sizeof(int).
2001-05-31 22:36:51 +00:00
phk
3c306fcab0 We don't need to include <sys/conf.h> 2001-05-23 23:01:37 +00:00
markm
9f745ed9e1 Compensate for header dethreading. 2001-05-01 08:46:02 +00:00
jhb
cea5d733b2 Check the new kern.smp.active sysctl rather than the non-existent
smp.smp_active sysctl to determine if we are running on an SMP machine.
2001-04-27 19:33:50 +00:00
tmm
9bcd268130 Correct the top memory stats display: convert page counts to kB.
Submitted by:	Andrea Campi <andrea@webcom.it>
Approved by:	rwatson
Pointy hat to:	myself
2001-03-20 16:02:16 +00:00
will
fc79ba5be0 Fix top(1) display for SMP systems where the username is longer than 14
characters.  This should avoid unattractive wrapping for people who are
stuck in an 80x24 screen.  :-)

PR:		22270
Submitted by:	William Carrel <williamc@go2net.com>
2001-03-12 05:53:54 +00:00
gallatin
f23ef63cf9 - An array of 4 32-bit ints for avenrun doesn't work on the alpha because
fscale is a (64-bit) long.  So just use a struct loadavg.
This fixes the recent failure of top on alphas:
	top: sysctl(vm.loadavg...) failed: Cannot allocate memory

- use size_t for sizeof() so as to fix a few int/long warnings on alpha

Reviewed by: Thomas Moestl <tmoestl@gmx.net>
2001-02-27 17:11:19 +00:00
rwatson
a9d344358c Remove directive to install top as group kmem. Remove directive to
install top with setgid bit.
2001-02-23 18:55:43 +00:00
rwatson
6b94a67d0b Adapt the top utility to not use kmem_read to retrieve variables now
available via sysctl().  As a result, top should now be able to run without
setgid kmem.

Submitted by:	Thomas Moestl <tmoestl@gmx.net>
Reviewed by:	freebsd-audit
2001-02-23 18:52:37 +00:00
markm
3c67bf1d70 Adjust columns for wide nicenesses in 'top -S'. 2001-02-18 11:08:47 +00:00
jake
0dc4d20fbd Catch up to new priority interface. 2001-02-12 00:21:38 +00:00
jhb
295ec88f1f Catch up to proc flag change. 2001-01-24 14:17:23 +00:00
mckusick
cba301121b Change the proc information returned from the kernel so that it
no longer contains kernel specific data structures, but rather
only scalar values and structures that are already part of the
kernel/user interface, specifically rusage and rtprio. It no
longer contains proc, session, pcred, ucred, procsig, vmspace,
pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If
any of these changed in size, ps, w, fstat, gcore, systat, and
top would all stop working. The new structure has over 200 bytes
of unassigned space for future values to be added, yet is nearly
100 bytes smaller per entry than the structure that it replaced.
2000-12-12 07:25:57 +00:00
jhb
ab339e8905 Make use of the full screen width to display p_comm rather than assuming a
hardcoded screen width of 80 chars.
2000-11-29 23:03:02 +00:00
jhb
c710e2e278 Display the name of the mutex we are blocked on in the state field. To
differentiate mutex names from wait channel names, prefix mutex names with
an asterisk.

Submitted by:	Dan Nelson <dnelson@emsphone.com>
2000-11-29 20:22:34 +00:00
jasone
769e0f974d Major update to the way synchronization is done in the kernel. Highlights
include:

* Mutual exclusion is used instead of spl*().  See mutex(9).  (Note: The
  alpha port is still in transition and currently uses both.)

* Per-CPU idle processes.

* Interrupts are run in their own separate kernel threads and can be
  preempted (i386 only).

Partially contributed by:	BSDi (BSD/OS)
Submissions by (at least):	cp, dfr, dillon, grog, jake, jhb, sheldonh
2000-09-07 01:33:02 +00:00
davidn
3d4886f969 Reduce max length of user names to 15 characters to reflect reality.
This also prevents the line-wrap and messed up display that occurs
when there happens to be one or more names with 15 chars.
1999-11-17 16:31:51 +00:00
bde
c1eced8210 Fixed sorting on time. On i386's, time differences of more than 2147
seconds caused overflow.  Use a type-safe but slightly slower comparison.
Comparisons for other fields are still fragile.

Fixed rounding of cputime (don't do extra work to get it slightly wrong
by first converting without rounding to milliseconds).

Removed dead code for setting cputime.

Fixed comments about cputime.
1999-11-17 03:25:54 +00:00
peter
3b842d34e8 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
n_hibma
7ab044dd75 Man pages for top refer to only 2.x, but not to 3.x and later 1999-06-14 12:06:11 +00:00
peter
280d1557df Tidy up references to <sys/rlist.h> and support for the old swap management
that went away in January.
1999-05-11 14:32:18 +00:00
jhay
cf7ba8e8fa Fix the display of the "nice" value of processes like ntpd that use the
posix sched_setscheduler() to set their priority.

Noticed by:	Mark Allwright <mallwri@orion.didata.co.za>
1999-04-22 14:34:53 +00:00