History log of /freebsd-10.0-release/usr.bin/vmstat/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


246034 28-Jan-2013 zont

- Show page faults requiring I/O when -s invoked.

Reviewed by: alc
MFC after: 2 weeks


233298 22-Mar-2012 pluknet

Garbage collect defunct nlist(3) symbols.

MFC after: 1 week


228654 17-Dec-2011 dim

In usr.bin/vmstat/vmstat.c, cast several printf field widths to int, and
use printf format specifiers from inttypes.h for uint64_t's.

MFC after: 1 week


224198 18-Jul-2011 pluknet

sintrcnt/sintrnames is the address of the size, not the actual size.
Use them appropriately to fetch the actual size.
That fixes vmstat -i with kvm backend.

Submitted by: peter
Approved by: re (kib)


224187 18-Jul-2011 attilio

- Remove the eintrcnt/eintrnames usage and introduce the concept of
sintrcnt/sintrnames which are symbols containing the size of the 2
tables.
- For amd64/i386 remove the storage of intr* stuff from assembly files.
This area can be widely improved by applying the same to other
architectures and likely finding an unified approach among them and
move the whole code to be MI. More work in this area is expected to
happen fairly soon.

No MFC is previewed for this patch.

Tested by: pluknet
Reviewed by: jhb
Approved by: re (kib)


223493 24-Jun-2011 kevlo

Remove duplicated header files


219708 17-Mar-2011 emaste

Remove uptime validity check that hasn't been necessary since r151417
switched to clock_gettime. vmstat will now not exit with an error
if run on a system with 10 years of uptime.


216370 11-Dec-2010 joel

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


215569 20-Nov-2010 kevlo

Remove unused variable


213573 08-Oct-2010 uqs

mdoc: drop redundant .Pp and .LP calls

They have no effect when coming in pairs, or before .Bl/.Bd


209215 15-Jun-2010 sbruno

Add a new column to the output of vmstat -z to indicate the number
of times the system was forced to sleep when requesting a new allocation.

Expand the debugger hook, db_show_uma, to display these results as well.

This has proven to be very useful in out of memory situations when
it is not known why systems have become sluggish or fail in odd ways.

Reviewed by: rwatson alc
Approved by: scottl (mentor) peter
Obtained from: Yahoo Inc.


208389 21-May-2010 sbruno

Allow sub-second interval timings for iostat and vmstat.
e.g.
vmstat -w.5
iostat -w.5

Reviewed by: jhb
Approved by: scottl (mentor)
Obtained from: Yahoo Inc.
MFC after: 2 weeks


201386 02-Jan-2010 ed

Build usr.bin/ with WARNS=6 by default.

Also add some missing $FreeBSD$ to keep svn happy.


198620 29-Oct-2009 jhb

When fetching sum stats (vmstat -s) from a crash dump, fetch per-CPU counts
and sum them to form the total counts.

PR: bin/135893
Submitted by: Mikolaj Golub to my trociny of gmail
MFC after: 1 week


188888 21-Feb-2009 delphij

Utilize calloc() instead of bzero'ing manually.


184646 04-Nov-2008 keramida

Fix comment typo that managed to sneak in when I copy pasted some
comments & code from iostat.


184645 04-Nov-2008 keramida

Repeat vmstat header after window.rows instead of a hardcoded 20.

Use ioctl() to get the window size in vmstat(8), and force a new
header to be prepended to the output every time the current window
size changes. Change the number of lines before each header to the
current lines of the terminal when the terminal is resized, so that
the full terminal length can be used for output lines.

Inspired by: svn change 175562 (same feature for iostat)
Reviewed by: ru (who fixed some of my bugs too)
MFC after: 1 week


181881 19-Aug-2008 jhb

Use kvm_getcptime(3) to fetch the global CPU time stats from a crashdump
since the 'cp_time' symbol doesn't exist in recent kernels. This fixes
iostat and vmstat on crash dumps.

MFC after: 1 week


178063 10-Apr-2008 ru

Add forgotten -H, -h, and -P to usage().


175465 18-Jan-2008 peter

Fix some boolean logic errors. && vs & and other sillyness. *blush*
This would prevent it from skipping non-present cpus in -P output.

Submitted by: Pieter de Goeje <pieter@degoeje.nl>


174573 13-Dec-2007 peter

Add the -H, -h and -P flags to vmstat. -P causes per-cpu output of
user/system/idle stats. -h feeds the memory column through
humanize_number() to reduce the amount of column overflowing. -H turns
this off. -h is turned on by default if stdout is a tty.


171633 27-Jul-2007 alc

Add a counter for the total number of pages cached and support for
reporting the value of this counter in the program "vmstat".

Approved by: re (rwatson)


164718 28-Nov-2006 ru

- Revert signedness type changes to "struct vmtotal"; by making
them unsigned I made the possible overflows hard to detect,
and it only saved 1 bit which isn't principal, even less now
that the underlying issue with the total of virtual memory has
been fixed. (For the record, it will overflow with >=2T of
VM total, with 32-bit ints used to keep counters in pages.)

- While here, fix printing of other "struct vmtotal" members
such as t_rq, t_dw, t_pw, and t_sw as they are also signed.

Reviewed by: bde
MFC after: 3 days


164556 23-Nov-2006 ru

Oops, fix the format specifier to what was intended.


164443 20-Nov-2006 ru

- Fix types of "struct vmmeter" members so they are unsigned.

- Fix overflow bugs in sysctl(8), systat(1), and vmstat(8)
when printing values of "struct vmmeter" in kilobytes as
they don't necessarily fit into 32 bits. (Fix sysctl(8)
reporting of a total virtual memory; it's in pages too.)


163921 02-Nov-2006 rwatson

Cross-reference libmemstat(3), malloc(9), uma(9).


163563 21-Oct-2006 ru

The vm.zone sysctl has gone; zone stats are now supplied by libmemstat(3).


163562 21-Oct-2006 ru

- Add comma after REQUESTS field missed in previous commit.
- Widen some columns; make width of header columns less cryptic.


163560 21-Oct-2006 glebius

Print the number of allocation failures in UMA zones.

PR: kern/102940


162792 29-Sep-2006 ru

Markup fixes.


159200 03-Jun-2006 obrien

Increase the field widths of flt (total number of page faults), fr (pages
freed), & cs (CPU context switch rate). 'vmstat 1' output is now lined up
for today's typical machines vs. a VAX. [tested my modest 1.6ghz laptop]


155567 12-Feb-2006 marck

Default number of direct access devices had been changed from three to two.
Reflect this in other paragraphs.

PR: 93201
Submitted by: Marian Cerny
MFC After: 1 week


151417 17-Oct-2005 andre

Obtain true uptime through clock_gettime(CLOCK_MONOTONIC, struct *timespec)
instead of subtracting 'bootime' from 'now'.

Sponsored by: TCP/IP Optimization Fundraise 2005


148790 06-Aug-2005 rwatson

Use libmemstat(3)'s kvm support for malloc(9) rather than hand-extracting
this information from the core dump.


148630 01-Aug-2005 rwatson

Teach vmstat's domemstat_zone() to use memstat_kvm_uma() when the kvm
descriptor is non-NULL, restoring vmstat -z support for core dumps and
kmem access. These were broken with the introduction of UMA.


148472 28-Jul-2005 rwatson

Minor syntax tweaks:

- Remove some extra blank lines.
- Remove comments that don't contribute to understanding.
- Remove additional blank lines in output added to maximize compatibility
with older vmstat output, but that is actually somewhat gratuitous.

Submitted by: bde
MFC with: other vmstat libmemstat(3) changes


148413 25-Jul-2005 rwatson

Teach vmstat -m and vmstat -z to use libmemstat(3). Certain
statistics from -z are now a bit different due to changes in the
way statistics are now measured. Reproduce with some amount of
accuracy the slightly obscure layouts adopted by the two kernel
sysctls. In the future, we might want to normalize them.

GC dosysctl(), which is now no longer used.

MFC after: 1 week


146748 29-May-2005 rwatson

Modify vmstat(8)'s domem() routine, which is responsible for extracting
malloc(9) statistics from kernel memory or a kernel coredump, to catch
up with recent changes to adopt per-CPU malloc(9) statistics. The new
routines walk the per-CPU statistics pools and coalesce them for
presentation to the user.


146650 26-May-2005 keramida

Interlink systat(1), iostat(8) and vmstat(8) through their SEE ALSO
sections, so that users of one can learn about the others easily.


146466 21-May-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


142175 21-Feb-2005 ps

Fix an overflow when calculating the number of kilobytes from the
number of pages.

Obtained from: Yahoo!


140420 18-Jan-2005 ru

Sort sections.


131491 02-Jul-2004 ru

Mechanically kill hard sentence breaks.


131300 30-Jun-2004 green

Make vmstat -m work with -M/-N again. Note that making vmstat -z work
is much harder, and -m is grossly using unexported interfaces (that is,
the array of malloc zones/sizes does not have an exported type).


129435 19-May-2004 ru

Bumped the document date.


128573 23-Apr-2004 tjr

Print fork statistics with %u as they are unsigned quantities.

PR: 65889
Submitted by: Ken Stailey


127452 26-Mar-2004 ru

Properly document the -M and -N options.


126842 11-Mar-2004 bde

Fixed a misspelling of 0 as NULL.

Fixed a nearby bug. The "play it safe" code in dosysctl() was unsafe
because it overran the buffer by 1 if sysctl() filled all of the buffer.

Fixed a nearby style bug in output. Not just 1, but 2 extra newlines
were printed at the end by "vmstat -m" and "vmstat -z". Don't print
any newlines explicitly. This depends on 2 of the many formatting
bugs in the corresponding sysctls. First, the sysctls return an extra
newline at the end of the strings. This also messes up output from
sysctl(8). Second, the sysctls return an extra newline at the beginning
of the strings. This is good for separating the 2 tables output by
"vmstat -mz" and for starting the header on a new line in plain sysctl
output, but gives a bogus extra newline at the beginning for "vm -[m | z]"
and "sysctl -n [kern.malloc | vm.zone]".

Fixed some nearby style bugs in the source code:
- the same line that misspelled 0 as NULL also spelled NULL as 0.
- the size was doubled twice in the realloc loop.
- the "play it safe" comment was misleading. Terminating the buffer
is bogus because dosysctl() is only meant to work with sysctls that
return strings and the terminator is part of a string. However, the
kern.malloc sysctl has more than style bugs. It also doesn't return
a string. Termination is needed to work around this bug.


125431 04-Feb-2004 ru

Put libdevstat before libkvm, because the former depends on the latter.


123825 25-Dec-2003 dwmalone

Remove an unused variable.
Add some missing constness.


123441 11-Dec-2003 bde

Fixed misplacement of __FBSDID(). Backed out editing of vendor id lines.
Just wrap them in #if 0...#endif.


123438 11-Dec-2003 des

Revert part of revision 1.74 after bde reminded me of a detail I'd
forgotten about how sysctl works. This removes a potential (though
not very likely) race that 1.74 introduced.


123414 10-Dec-2003 des

Whitespace cleanup.


123411 10-Dec-2003 des

Remove debugging printf


123410 10-Dec-2003 des

Document the simpler -a semantics.


123409 10-Dec-2003 des

Fix a couple of issues in the interrupt code:

- Replace overly-complicated (and buggy) -a logic with a much simpler
version: -a causes all interrupts to be displayed, otherwise only
those that have occurred are displayed. This removes the need for
any MD code.

- Instead of just making sure intrcnt is large enough, figure out the
exact size it needs to be. We derive nintr from this number, and we
don't want to risk printing garbage. Note that on sparc64, we end up
printing garbage anyway because the names of non-existent interrupts
are left uninitialized by the kernel.

Tested on: alpha, i386, sparc64


123407 10-Dec-2003 des

s/u_(int|long)\>/unsigned \1/


123401 10-Dec-2003 dwmalone

Fix a couple of warnings (const a function parameter and change some
ints to size_ts to better match the types of variables they are used
with).

Glanced at by: des


123290 08-Dec-2003 marcel

Unbreak vmstat -i on ia64:
o nintr and inamlen must by of type size_t, not int,
o Remove now unnecessary casts,
o Handle the aflag differently, because the intr. names have a
fixed width and almost always have trailing spaces.


123250 07-Dec-2003 des

Finish the transition from libkvm to sysctl that I started a while ago.
The use of libkvm for post-mortem analysis is still supported (though it
could use more testing). We can now remove vmstat's setgid bit.

While I'm here, hack the interrupt listing code to not display interrupts
that haven't occurred unless the -a option was given on the command line,
and document this change.


122365 09-Nov-2003 jmg

make minimum column size for interrupt name be the heading (depends upon
Total being shorter than interrupt)..

Pointed out by: bde


122300 08-Nov-2003 jmg

fix an overflow bug when scanning for length of names that I introduced in
the last commit...

include some minor style changes and fixes that bde sent me

Submitted by: bde


121626 28-Oct-2003 jmg

take mux's fix to the next level, scan the names and make the field larger
as necessary... on sparcs where:
atapci0 vec1996
is a bit too long


113461 14-Apr-2003 tjr

Uncomment the description of the -f option. Add rfork() to the list of
system calls it displays stats about.

PR: 50924


113460 14-Apr-2003 tjr

Reimplement the vmstat -f option (display fork statistics).

PR: 50924
Submitted by: Ken Stailey (with a few changes)


113311 10-Apr-2003 mux

Slightly rework formatting in vmstat -i so that it doesn't
break with "fooX irqY" lines that are a bit bigger.


112288 15-Mar-2003 phk

Run a revision of the devstat interface:

Kernel:

Change statistics to use the *uptime() timescale (ie: relative to
boottime) rather than the UTC aligned timescale. This makes the
device statistics code oblivious to clock steps.

Change timestamps to bintime format, they are cheaper.

Remove the "busy_count", and replace it with two counter fields:
"start_count" and "end_count", which are updated in the down and
up paths respectively. This removes the locking constraint on
devstat.

Add a timestamp argument to devstat_start_transaction(), this will
normally be a timestamp set by the *_bio() function in bp->bio_t0.
Use this field to calculate duration of I/O operations.

Add two timestamp arguments to devstat_end_transaction(), one is
the current time, a NULL pointer means "take timestamp yourself",
the other is the timestamp of when this transaction started (see
above).

Change calculation of busy_time to operate on "the salami principle":
Only when we are idle, which we can determine by the start+end
counts being identical, do we update the "busy_from" field in the
down path. In the up path we accumulate the timeslice in busy_time
and update busy_from.

Change the byte_* and num_* fields into two arrays: bytes[] and
operations[].

Userland:

Change the misleading "busy_time" name to be called "snap_time" and
make the time long double since that is what most users need anyway,
fill it using clock_gettime(CLOCK_MONOTONIC) to put it on the same
timescale as the kernel fields.

Change devstat_compute_etime() to operate on struct bintime.

Remove the version 2 legacy interface: the change to bintime makes
compatibility far too expensive.

Fix a bug in systat's "vm" page where boot relative busy times would
be bogus.

Bump __FreeBSD_version to 500107

Review & Collaboration by: ken


112284 15-Mar-2003 phk

Update to use current rev of devstat API.


111008 16-Feb-2003 phk

Add #include <sys/resource.h>

My apologies for missing these #includes, I must have confused the
dependencies with a wrong timestamp or something.


111002 16-Feb-2003 phk

Remove #include <sys/dkstat.h>


109097 11-Jan-2003 dillon

Make 'sysctl vm.vmtotal' work properly using updated patch from Hiten.
(the patch in the PR was stale).

PR: kern/5689
Submitted by: Hiten Pandya <hiten@unixdaemons.com>


101590 09-Aug-2002 tmm

The boottime variable in sys/kern/kern_tc.c is a struct timeval, not a
time_t, so do not use the latter as type when retrieving the variable
via libkvm. This should fix vmstat on sparc64.


99970 14-Jul-2002 charnier

The .Nm utility


96247 09-May-2002 joe

Replace /kernel with /boot/kernel/kernel.

PR: docs/37757
Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org>


94729 15-Apr-2002 jeff

Remove malloc_type's ks_limit.

Updated the kmemzones logic such that the ks_size bitmap can be used as an
index into it to report the size of the zone used.

Create the kern.malloc sysctl which replaces the kvm mechanism to report
similar data. This will provide an easy place for statistics aggregation if
malloc_type statistics become per cpu data.

Add some code ifdef'd under MALLOC_PROFILING to facilitate a tool for sizing
the malloc buckets.


94588 13-Apr-2002 asmodai

Fix a missed conversion of lld to llu for the uint64_t ks_calls and cast
to unsigned long long.

Don't be too overzealous with the printing of ks_calls in the total
statistics, cut back from 20 to 13 positions to print (which should last
a couple of years easily (20 digits is enough for 3168 years of calls at a
measly billion (10^9) calls per second.)).

Submitted by: bde


94239 08-Apr-2002 asmodai

Cast totreq to unsigned long long, as needed on 64-bit machines.

Pointed out by: jeff


94200 08-Apr-2002 asmodai

Change totreq to uint64_t from a long (the PR has an int64_t, which didn't
make sense to me) and change the printf argument from %8ld to %20llu to
accompany the printing of the totals.
Realigned the header printed above it as well.

PR: 32342
Submitted by: ryan beasley <ryanb@goddamnbastard.org>
Reviewed by: jeff, Tim J Robbins


92922 22-Mar-2002 imp

remove __P


92653 19-Mar-2002 jeff

Remove the kmembuckets stats in preparation for the UMA commit.


90416 08-Feb-2002 markm

Remove NO_WERRORs and WARNS=n's. To be revisited after GCC3.


87690 11-Dec-2001 markm

WARNS=2 fixes, but set NO_WERROR, as there are some HardToFix(tm)
warnings originating in system headers.


82664 31-Aug-2001 ru

SECURITY: Drop `setgid kmem' bit as early as possible.


81537 11-Aug-2001 ken

Change the compute_stats() call to the new devstat_compute_statistics()
interface.

Cast the return of the rest of the printfs in here to void.

Submitted by: "Sergey A. Osokin" <osa@freebsd.org.ru>


80551 29-Jul-2001 tmm

Correct the old length argument passed to sysctl to be a pointer to a
size_t (not to an int).

MFC after: 2 days


79755 15-Jul-2001 dd

Remove whitespace at EOL.


79535 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


78849 26-Jun-2001 schweikh

Increase column widths when using -i (they are now wide enough to
hold a 64bit or 32bit ~0 value, i.e. 20 and 10; this anticipates
soon-to-be machines with Exahertz rtc interrupt frequencies. :-)

PR: bin/16206
Submitted by: John Capo <jc@irbs.com>
MFC after: 1 week


78672 23-Jun-2001 schweikh

Reduce field width for some columns so that the default output fits in <= 79
columns. 80 columns + newline is a problem for some terminals including syscons.

Requested by: bde
MFC after: 1 week


78474 19-Jun-2001 schweikh

Made all fields in default output be space separated. Run-together
columns confuse the heck out of other apps trying to parse vmstat output
(eg sscope). I made sure we're still <= 80 cols per line.
Fixed warnings about unused vars and printf %format mismatches.

Requested by: Eugene Aleynikov <eugenea@infospace.com>
Reviewed by: joerg (implicitly)
MFC after: 2 weeks


78177 13-Jun-2001 schweikh

Avoid the avm field joining the w field when avm is > 9.999.999 pages
which is slightly less than 4GB. To use a quote from someone who shall
remain nameless "No one will ever need more than 4 GB" :-) But FreeBSD
is prepared if we one day will.

Requested by: Eugene Aleynikov <eugenea@infospace.com>


78149 12-Jun-2001 schweikh

Increase field width by one for 'fre' to accomodate today's memory sizes.
PR: 25267
Submitted by: Eugene Aleynikov <eugene@infospace.com>
Reviewed by: joerg
MFC after: 2 weeks


76812 18-May-2001 ru

Removed -I${.CURDIR}/.../sys from CFLAGS.


74848 27-Mar-2001 ru

MAN[1-9] -> MAN.


72887 22-Feb-2001 alfred

fix usage statement (add missing [-n devs] option)

Submitted by: Maxim Konovalov <maxim@macomnet.ru>

Silence a warning by renaming the 'pgtok' #define to 'vmstat_pgtok' so
as not to conflict with the 'pgtok' #define in sys/param.h


71895 01-Feb-2001 ru

mdoc(7) police: split punctuation characters + misc fixes.


71429 23-Jan-2001 ume

Add mibs to hold the number of forks since boot. New mibs are:

vm.stats.vm.v_forks
vm.stats.vm.v_vforks
vm.stats.vm.v_rforks
vm.stats.vm.v_kthreads
vm.stats.vm.v_forkpages
vm.stats.vm.v_vforkpages
vm.stats.vm.v_rforkpages
vm.stats.vm.v_kthreadpages

Submitted by: Paul Herman <pherman@frenchfries.net>
Reviewed by: alfred


71405 23-Jan-2001 des

Document that the -z option is equivalent to 'sysctl vm.zone'.


71404 23-Jan-2001 des

Use the vm.zone sysctl rather that grope through the zone allocator's
internal data structures.


71402 23-Jan-2001 mjacob

Update vm zone list traversal for changes made to kernel. Note that this
is ultimately silly because no locks are held in user space while traversing
the list via kvm_reads... really, this should use the sysctl interface
which *is* protected by a lock in the kernel.


70197 19-Dec-2000 ru

Prepare for mdoc(7)NG.


68963 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


60050 05-May-2000 phk

Remove unneeded #include <sys/buf.h>


50743 01-Sep-1999 phk

unifdef -Uvax -Uhp300 -Uluna68k -Umips -Utahoe


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


49107 26-Jul-1999 n_hibma

Convert interrupt count from signed to unsigned and the total
from signed long to unsigned lon long.

PR: 12808
Submitted by: Kevin Day toasty@dragondata.com
Reviewed by: bde


47786 06-Jun-1999 kris

Correct description of -c and -w options

Inspired by: PR docs/11774
Submitted by: Chad R. Larson <chad@freeway.dcfinc.com>


47068 12-May-1999 bde

Backed out the previous commit, except for the parts that reduced
the magicness of 200. Cleaned up the remaining parts. Circularisation
of the list of malloc types was a kernel bug (now fixed). Interfering
with applications' definitions of pgtok is a system header bug (not
fixed).


46852 10-May-1999 imp

Sometime since this file was written, the list of kernel malloc types
changed from a simple list to a circular one. We compensate by only
looping until we see the first address again. Before, things would
terminate because it was limited to 200 iterations. This lead to
bogus statistics and repeating stats for memory types.

This should be merged into 3.2, as the same bug is there.


46094 26-Apr-1999 kris

Move an option outside of a nested list and up a bit to live free among
its brothers and sisters.


44067 15-Feb-1999 bde

Fixed bitrot in usage message and disordering of options in previous commit.

I'm not sure why we have `mvstat -z'. `sysctl vm.zone' gives more
information. OTOH, `sysctl vm.zone' shouldn't return ASCII data,
and reporting of memory use should be integrated, at least as an
option.


44066 15-Feb-1999 bde

Fixed disordering of options in previous commit.


43962 13-Feb-1999 dillon

Add -z option to vmstat to dump data from the zone allocator


43822 10-Feb-1999 ken

Fix vmstat display problems. The header printout wasn't quite right, and
the display wrapped around.

This decreases the default maximum number of disks shown to 2, so things
don't wrap around so easily. Also, it fixes the header display issues.

Submitted by: Bruce Evans <bde@FreeBSD.ORG>


43819 10-Feb-1999 ken

Add a prioritization field to the devstat_add_entry() call so that
peripheral drivers can determine where in the devstat(9) list they are
inserted.

This requires recompilation of libdevstat, systat, vmstat, rpc.rstatd, and
any ports that depend on the devstat code, since the size of the devstat
structure has changed. The devstat version number has been incremented as
well to reflect the change.

This sorts devices in the devstat list in "more interesting" to "less
interesting" order. So, for instance, da devices are now more important
than floppy drives, and so will appear before floppy drives in the default
output from systat, iostat, vmstat, etc.

The order of devices is, for now, kept in a central table in devicestat.h.
If individual drivers were able to make a meaningful decision on what
priority they should be at attach time, we could consider splitting the
priority information out into the various drivers. For now, though, they
have no way of knowing that, so it's easier to put them in an easy to find
table.

Also, move the checkversion() call in vmstat(8) to a more logical place.

Thanks to Bruce and David O'Brien for suggestions, for reviewing this, and
for putting up with the long time it has taken me to commit it. Bruce did
object somewhat to the central priority table (he would rather the
priorities be distributed in each driver), so his objection is duly noted
here.

Reviewed by: bde, obrien


40690 28-Oct-1998 jdp

Back out previous work-around for "vmstat -i" failing on ELF
kernels. A better fix is now committed to "src/lib/libc/gen/nlist.c"
and "src/usr.sbin/kvm_mkdb/nlist.c".


40631 24-Oct-1998 msmith

Work around some variables having N_UNDF types but valid values; this
makes vmstat work on ELF kernels again.
Submitted by: Daniel Rock <rock@cs.uni-sb.de>


39498 20-Sep-1998 ken

Change the devstat generation number from an int to a long. The int-sized
generation was causing unaligned access faults on the Alpha.

I have incremented the devstat version number, since this is an interface
change. You'll need to recompile libdevstat, systat, iostat, vmstat and
rpc.rstatd along with your kernel.

Partially Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>


39372 16-Sep-1998 dillon

vmstat shows all manually-specified devices rather then just the first
three.


39318 16-Sep-1998 ken

Delete unused code. This has been obsoleted by the new devstat code.

Reviewed by: imp


39230 15-Sep-1998 gibbs

Update system to new device statistics code.

Submitted by: "Kenneth D. Merry" <ken@plutotech.com>


38962 09-Sep-1998 msmith

Terminate the defdrives array correctly. (Shame, Rod!)
Submitted by: Scott Michel <scottm@cs.ucla.edu>


37453 06-Jul-1998 bde

Fixed printf format errors.


34214 07-Mar-1998 dyson

Support a couple of new "-s" stats.


31560 05-Dec-1997 bde

Const poisoning from ks_shortdesc.


30287 10-Oct-1997 phk

struct kmemstats was renamed.


30279 10-Oct-1997 phk

Make vmstat understand the dynamic malloc stuff. There are a number
of ugly hardcoded constants in there.


30180 06-Oct-1997 dima

Be more specific about -f/-t options (they're not yet implemented),
not just exit with 0 status.

This definitely should go to 2.2.5.
If i won't have any objections - I'll commit it tonight.


28693 25-Aug-1997 charnier

Use err(3). Add some %d to %ld changes.


28631 23-Aug-1997 steve

Cleanup inconsistencies in the manpage.

PR: docs/3709
Submitted by: Takahiro Yugawa <yugawa@orleans.rim.or.jp>


24360 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


23952 16-Mar-1997 scrappy

Slight visual formatting change to the output so that:

procs memory page disks faults cpu
r b w avm fre flt re pi po fr sr w0 w1 in sy cs us sy id
1 0 04135184 6016 180 2 1 0 158 135 10 0 386 1820 77 20 6 74

looks like:

procs memory page disks faults cpu
r b w avm fre flt re pi po fr sr w0 w1 in sy cs us sy id
1 0 0 4135188 6016 180 2 1 0 158 135 10 0 387 1821 77 20 6 74


21450 09-Jan-1997 mpp

Make the man page agree with the actual vmstat output
and options.


18050 05-Sep-1996 bde

Fixed DPADD.


17814 24-Aug-1996 mpp

Change a stray reference to pstat to vmstat.

Pointed-out-by: bde


17799 23-Aug-1996 mpp

Convert to mdoc format.


15463 30-Apr-1996 joerg

Correct a typo.

Submitted by: mbarkah@hemi.com (Ade Barkah)


14353 03-Mar-1996 jkh

Print number of second-level cache hits as per-directory, not per-process
(since they're per-directory now).
Learned from: Kirk McKusick's OS internals course.. :-)


12811 13-Dec-1995 bde

Reduced vm dependencies. Only `struct vmmeter.h' is required.
Unfortunately, the sysctl number for reading this struct is
bogusly placed in <vm/vm_param.h> instead of with the declaration
of the struct.


12804 13-Dec-1995 peter

add a #include <sys/vmmeter.h> since we are using the vmmeter structures
and this was once (but no longer it seems) included by <vm/vm.h>
It should now compile again.


8874 30-May-1995 rgrimes

Remove trailing whitespace.


7351 25-Mar-1995 dg

Removed object lookup/hit count and changed the order of things a little.


7347 25-Mar-1995 dg

Removed printing of cnt.v_nzfod: we don't implement this in the kernel.


5463 10-Jan-1995 dg

Added 'pages in VM cache' statistic.


5064 12-Dec-1994 ats

change a .TH VMSTAT 1 to a .TH VMSTAT 8 .


4720 21-Nov-1994 phk

More absolute paths


3695 18-Oct-1994 dg

Made zero-fill stats a bit more clear.


3693 18-Oct-1994 dg

Updated to changes in struct vmmeter and reorganized -s stats to be more
logical.


3659 17-Oct-1994 dg

Restore all of my changes that Garrett clobbered in the previous commit.


3642 16-Oct-1994 wollman

New way of getting disk drive names.


3613 15-Oct-1994 dg

Updated to changes in struct vmmeter. Nuked !NEWVM code. Fixed rounding
bug when interval is 1 second.


3372 05-Oct-1994 phk

Realigned the output of "vmstat -m", "MSDOSFS mount" was too wide for the
field. Saved some space and gained a little clarity by printing "128K"
instead of 131072 (and so on).


1866 05-Aug-1994 wollman

More merry makefile munging for man page compatability.


1856 05-Aug-1994 dg

Converted 'vmunix' to 'kernel'.


1620 29-May-1994 rgrimes

Add read_names support for i386, based on my original work from FreeBSD
and cleaned up slightly.


1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.