aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/vmstat
Commit message (Collapse)AuthorAgeFilesLines
* MFC: backport -P (per-cpu) stats for %user/%system/%idle etc.Peter Wemm2008-04-093-20/+207
| | | | Notes: svn path=/stable/6/; revision=178045
* MFC: Revert signedness type changes to "struct vmtotal" to keepRuslan Ermilov2006-12-011-4/+3
| | | | | | | | overflows easier to detect. As a bonus, fix printing of other "struct vmtotal" members, t_rq, t_dw, t_pw, and t_sw. Notes: svn path=/stable/6/; revision=164791
* MFC: Make members of "struct vmmeter" unsigned; fix overflow bugs whenRuslan Ermilov2006-11-231-4/+5
| | | | | | | | | printing them in kilobytes in sysctl(8), systat(1), and vmstat(8). Fix sysctl(8) reporting of the virtual memory's total; it's accounted in pages too. Notes: svn path=/stable/6/; revision=164559
* MFC rev. 1.93, 1.94:Gleb Smirnoff2006-10-281-4/+4
| | | | | | | | | | | | | - Print the number of allocation failures in UMA zones. - Add comma after REQUESTS field missed in previous commit. - Widen some columns; make width of header columns less cryptic. PR: kern/102940 Approved by: re (hrs) Notes: svn path=/stable/6/; revision=163743
* MFC r1.33:Dmitry Morozovsky2006-02-171-6/+6
| | | | | | | | | | | | Default number of direct access devices had been changed from three to two. Reflect this in other paragraphs. PR: 93201 Submitted by: Marian Cerny Approved by: re (scottl) Notes: svn path=/stable/6/; revision=155792
* Merge vmstat.c:1.90 from HEAD to RELENG_6:Robert Watson2005-11-091-96/+19
| | | | | | | | Use libmemstat(3)'s kvm support for malloc(9) rather than hand-extracting this information from the core dump. Notes: svn path=/stable/6/; revision=152241
* Merge vmstat.c:1.89 from HEAD to RELENG_6:Robert Watson2005-11-091-14/+19
| | | | | | | | | 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. Notes: svn path=/stable/6/; revision=152240
* Merge Makefile:1.12, vmstat.c:1.87 from HEAD to RELENG_6:Robert Watson2005-08-192-23/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Merge vmstat.c:1.88 from HEAD to RELENG_6: 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 Approved by: re (kensmith) Notes: svn path=/stable/6/; revision=149257
* Modify vmstat(8)'s domem() routine, which is responsible for extractingRobert Watson2005-05-291-7/+38
| | | | | | | | | | 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. Notes: svn path=/head/; revision=146748
* Interlink systat(1), iostat(8) and vmstat(8) through their SEE ALSOGiorgos Keramidas2005-05-261-0/+1
| | | | | | | sections, so that users of one can learn about the others easily. Notes: svn path=/head/; revision=146650
* Sync program's usage() with manpage's SYNOPSIS.Ruslan Ermilov2005-05-211-2/+2
| | | | Notes: svn path=/head/; revision=146466
* Fix an overflow when calculating the number of kilobytes from thePaul Saab2005-02-211-1/+1
| | | | | | | | | number of pages. Obtained from: Yahoo! Notes: svn path=/head/; revision=142175
* Sort sections.Ruslan Ermilov2005-01-181-7/+7
| | | | Notes: svn path=/head/; revision=140420
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-6/+12
| | | | Notes: svn path=/head/; revision=131491
* Make vmstat -m work with -M/-N again. Note that making vmstat -z workBrian Feldman2004-06-301-11/+93
| | | | | | | | is much harder, and -m is grossly using unexported interfaces (that is, the array of malloc zones/sizes does not have an exported type). Notes: svn path=/head/; revision=131300
* Bumped the document date.Ruslan Ermilov2004-05-191-1/+1
| | | | Notes: svn path=/head/; revision=129435
* Print fork statistics with %u as they are unsigned quantities.Tim J. Robbins2004-04-231-3/+3
| | | | | | | | PR: 65889 Submitted by: Ken Stailey Notes: svn path=/head/; revision=128573
* Properly document the -M and -N options.Ruslan Ermilov2004-03-262-9/+19
| | | | Notes: svn path=/head/; revision=127452
* Fixed a misspelling of 0 as NULL.Bruce Evans2004-03-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=126842
* Put libdevstat before libkvm, because the former depends on the latter.Ruslan Ermilov2004-02-041-2/+2
| | | | Notes: svn path=/head/; revision=125431
* Remove an unused variable.David Malone2003-12-251-2/+1
| | | | | | | Add some missing constness. Notes: svn path=/head/; revision=123825
* Fixed misplacement of __FBSDID(). Backed out editing of vendor id lines.Bruce Evans2003-12-111-6/+7
| | | | | | | Just wrap them in #if 0...#endif. Notes: svn path=/head/; revision=123441
* Revert part of revision 1.74 after bde reminded me of a detail I'dDag-Erling Smørgrav2003-12-111-4/+7
| | | | | | | | forgotten about how sysctl works. This removes a potential (though not very likely) race that 1.74 introduced. Notes: svn path=/head/; revision=123438
* Whitespace cleanup.Dag-Erling Smørgrav2003-12-101-36/+36
| | | | Notes: svn path=/head/; revision=123414
* Remove debugging printfDag-Erling Smørgrav2003-12-101-1/+0
| | | | Notes: svn path=/head/; revision=123411
* Document the simpler -a semantics.Dag-Erling Smørgrav2003-12-101-3/+0
| | | | Notes: svn path=/head/; revision=123410
* Fix a couple of issues in the interrupt code:Dag-Erling Smørgrav2003-12-101-21/+13
| | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=123409
* s/u_(int|long)\>/unsigned \1/Dag-Erling Smørgrav2003-12-101-15/+15
| | | | Notes: svn path=/head/; revision=123407
* Fix a couple of warnings (const a function parameter and change someDavid Malone2003-12-101-4/+3
| | | | | | | | | | ints to size_ts to better match the types of variables they are used with). Glanced at by: des Notes: svn path=/head/; revision=123401
* Unbreak vmstat -i on ia64:Marcel Moolenaar2003-12-081-9/+12
| | | | | | | | | | 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. Notes: svn path=/head/; revision=123290
* Finish the transition from libkvm to sysctl that I started a while ago.Dag-Erling Smørgrav2003-12-073-115/+246
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=123250
* make minimum column size for interrupt name be the heading (depends uponJohn-Mark Gurney2003-11-091-1/+1
| | | | | | | | | Total being shorter than interrupt).. Pointed out by: bde Notes: svn path=/head/; revision=122365
* fix an overflow bug when scanning for length of names that I introduced inJohn-Mark Gurney2003-11-081-6/+6
| | | | | | | | | | | the last commit... include some minor style changes and fixes that bde sent me Submitted by: bde Notes: svn path=/head/; revision=122300
* take mux's fix to the next level, scan the names and make the field largerJohn-Mark Gurney2003-10-281-4/+15
| | | | | | | | | as necessary... on sparcs where: atapci0 vec1996 is a bit too long Notes: svn path=/head/; revision=121626
* Uncomment the description of the -f option. Add rfork() to the list ofTim J. Robbins2003-04-141-9/+10
| | | | | | | | | system calls it displays stats about. PR: 50924 Notes: svn path=/head/; revision=113461
* Reimplement the vmstat -f option (display fork statistics).Tim J. Robbins2003-04-141-15/+17
| | | | | | | | PR: 50924 Submitted by: Ken Stailey (with a few changes) Notes: svn path=/head/; revision=113460
* Slightly rework formatting in vmstat -i so that it doesn'tMaxime Henrion2003-04-101-3/+3
| | | | | | | break with "fooX irqY" lines that are a bit bigger. Notes: svn path=/head/; revision=113311
* Run a revision of the devstat interface:Poul-Henning Kamp2003-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=112288
* Update to use current rev of devstat API.Poul-Henning Kamp2003-03-151-9/+9
| | | | Notes: svn path=/head/; revision=112284
* Add #include <sys/resource.h>Poul-Henning Kamp2003-02-161-0/+1
| | | | | | | | My apologies for missing these #includes, I must have confused the dependencies with a wrong timestamp or something. Notes: svn path=/head/; revision=111008
* Remove #include <sys/dkstat.h>Poul-Henning Kamp2003-02-161-1/+0
| | | | Notes: svn path=/head/; revision=111002
* Make 'sysctl vm.vmtotal' work properly using updated patch from Hiten.Matthew Dillon2003-01-111-1/+1
| | | | | | | | | | (the patch in the PR was stale). PR: kern/5689 Submitted by: Hiten Pandya <hiten@unixdaemons.com> Notes: svn path=/head/; revision=109097
* The boottime variable in sys/kern/kern_tc.c is a struct timeval, not aThomas Moestl2002-08-091-3/+4
| | | | | | | | time_t, so do not use the latter as type when retrieving the variable via libkvm. This should fix vmstat on sparc64. Notes: svn path=/head/; revision=101590
* The .Nm utilityPhilippe Charnier2002-07-141-2/+5
| | | | Notes: svn path=/head/; revision=99970
* Replace /kernel with /boot/kernel/kernel.Josef Karthauser2002-05-091-3/+3
| | | | | | | | PR: docs/37757 Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org> Notes: svn path=/head/; revision=96247
* Remove malloc_type's ks_limit.Jeff Roberson2002-04-151-71/+17
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=94729
* Fix a missed conversion of lld to llu for the uint64_t ks_calls and castJeroen Ruigrok van der Werven2002-04-131-6/+7
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=94588
* Cast totreq to unsigned long long, as needed on 64-bit machines.Jeroen Ruigrok van der Werven2002-04-081-1/+2
| | | | | | | Pointed out by: jeff Notes: svn path=/head/; revision=94239
* Change totreq to uint64_t from a long (the PR has an int64_t, which didn'tJeroen Ruigrok van der Werven2002-04-081-3/+4
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=94200
* remove __PWarner Losh2002-03-221-14/+14
| | | | Notes: svn path=/head/; revision=92922