Commit Graph

18 Commits

Author SHA1 Message Date
John Baldwin
2e52fb92ff Add a new line to top that provides a brief summary of the ZFS ARC memory
usage on hosts using ZFS.  The new line displays the total amount of RAM
used by the ARC along with the size of MFU, MRU, anonymous (in flight),
headers, and other (miscellaneous) sub-categories.  The line is not
displayed on systems that are not using ZFS.

Reviewed by:	avg, fs@
MFC after:	3 days
2012-06-27 18:08:48 +00:00
John Baldwin
fcc3d62fa5 Rework the dynamic per-CPU stats code a bit. Always set 'statics->ncpus'
to the maximum number of CPUs to ensure that lcpustates[] array is always
allocated to the maximum size.  Previously, if top was started without
per-CPU stats it would allocate a smaller lcpustates[] array.  When
per-CPU stats were then enabled, it would overflow the array and trash
the cpustates_columns[] array causing the CPU stats to be printed in the
wrong locations.

Approved by:	re (kib)
MFC after:	1 week
2011-07-18 21:15:47 +00:00
John Baldwin
51f202e9ed Allow per-CPU statistics to be toggled at runtime via the 'P' key.
While here, make -P a toggle similar to other options such as -I.

Reviewed by:	arundel
MFC after:	1 week
2011-07-11 16:48:52 +00:00
Xin LI
7afed3bf78 Revert r214857 pursudant to 9.0-RELEASE cycle.
Requested by:	jh
2011-06-20 16:48:00 +00:00
John Baldwin
f69c3436ee Output an appropriate amount of padding to line up per-CPU state columns
rather than using a terminal sequence to move the cursor when drawing the
initial screen.

Requested by:	arundel
MFC after:	3 days
2011-02-01 15:48:27 +00:00
Xin LI
584e07b573 Inverse display of top(1)'s table header when running in inactive mode.
MFC after:	2 weeks
2010-11-06 03:59:21 +00:00
Rebecca Cran
2ab8e45eb8 Since top displays the uptime including seconds, there is no need to add 30
onto it, which may have been used for rounding purposes in other utilities.

PR:	bin/147934
Submitted by:	Janne Snabb <snabb at epipe.com>
Approved by:	rrs (mentor)
MFC after:	2 weeks
2010-08-17 09:51:08 +00:00
John Baldwin
fcaeaff4b6 Explicitly line up the CPU state labels with the calculated starting column
that takes into account the width of the largest CPU ID.  On systems with
> 10 CPUs the labels for the first 10 CPUs were not lined up properly
otherwise.

Approved by:	re (kib)
MFC after:	1 week
2009-08-19 15:17:13 +00:00
Peter Wemm
031175705e Add a -P flag to display per-cpu cpu usage stats. 2008-01-18 01:43:14 +00:00
Giorgos Keramidas
3c2ab2b0ec The 'text' argument of u_header() is not used, so we don't need to
trim_header() it.

Noticed by:	bde
2005-05-19 13:34:19 +00:00
Giorgos Keramidas
cd660671ce Properly trim the header line too, to fix wrap-around problems that
have been noticed by running top(1) in terminals that are too narrow
(or on systems with usernames that were too long, pushing everything
too far to the right).

Note that this does *not* solve the wrap-around problem of the system
statistics, which is an entirely different matter :-/

Tested on:	i386, sparc64 (panther), amd64 (sledge)
Approved by:	davidxu (in principle)
2005-05-18 13:48:33 +00:00
David Malone
1b39d8a298 Fix a bug where you couldn't start top in a very small window. Now
you can start it in a small window, but it doesn't always display
anything sensible. Resizing the window does work though.

The patch is a slightly simpler one than Sheldon's in the PR.

PR:		21075
2002-08-11 18:37:25 +00:00
David Malone
337fd7a891 Resolve conflicts. 2002-01-24 17:58:42 +00:00
Warner Losh
1e3661ab60 display.c: sprintf -> snprintf
top.c: fix from NetBSD/OpenBSD: make sure that new_message() is called
with a format.

Add $FreeBSD$ While I'm here.

These files are already off the vendor branch.
2000-10-04 23:34:16 +00:00
David E. O'Brien
a2641311ff uptime display more in style with original code 1999-01-09 20:25:02 +00:00
David E. O'Brien
9b98b6333e Display uptime in upper right corner.
Submitted by:	Andy Farkas <andyf@speednet.com.au>
Obtained from:	freebsd-current list
1998-12-19 20:09:20 +00:00
Joerg Wunsch
6ab598d69b Apply the FreeBSD-local patches.
Obtained from:	The ports collection.
1997-03-23 18:53:01 +00:00
Joerg Wunsch
aee34003d7 This is the long-awaited import of top into the base system (actually,
the src/contrib/top part right now).  This tools is simply too system-
dependant to maintain it in the ports collection.
1997-03-23 18:51:21 +00:00