summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat/vmstat.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix an overflow when calculating the number of kilobytes from theps2005-02-211-1/+1
| | | | | | number of pages. Obtained from: Yahoo!
* Use 'k' as suffix for Kilophk2003-10-241-1/+1
| | | | Pointed out by: several.
* When a numeric field overflows its width, try formatting the number inphk2003-10-201-5/+4
| | | | | 'kilo' or 'mega' with appropriate suffix instead of filling the field with stars.
* Let libdevstat calculate the device-busy % instead of home-rolling.phk2003-04-091-13/+5
|
* Run a revision of the devstat interface:phk2003-03-151-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add #include <sys/resource.h>phk2003-02-161-0/+1
|
* Remove #include <sys/dkstat.h>phk2003-02-161-1/+0
|
* Make 'sysctl vm.vmtotal' work properly using updated patch from Hiten.dillon2003-01-111-1/+1
| | | | | | | (the patch in the PR was stale). PR: kern/5689 Submitted by: Hiten Pandya <hiten@unixdaemons.com>
* debug.{numvnodes,freevnodes} moved to vfs.des2002-06-061-2/+2
|
* remove __Pimp2002-03-221-9/+9
|
* WARNS=2 fixes with NO_WERROR set, as there are some header issuesmarkm2001-12-121-102/+101
| | | | with namelists. use __FBSDID().
* Remove the 'irq' string from the irqN part of the "interrupts" display.markm2001-12-011-2/+10
| | | | This allows us to see the irq number when device names ate too long.
* Convert systat(1) to use the new devstat interface.ken2001-09-061-15/+14
| | | | Submitted by: "Sergey A. Osokin" <osa@freebsd.org.ru>
* Replace a use of the hw.nintr sysctl as it has just gone away, casttmm2001-06-011-3/+9
| | | | | size_t variables when passing them to a printf-like function, and some minor cleanups.
* numdirtybuffers is an int, not a long.gallatin2001-03-291-1/+1
|
* Get rid of setgid kmem for systat, and while being there, fix some bugstmm2001-03-231-116/+118
| | | | | | | | | | | and compiler warnings. The data for network statistics are still obtained via the kvm interface if systat was started with the needed privileges, otherwise sysctls are used. The reason for this is that with really many open sockets, the sysctl method is probably slower, but it systat -netstat is probably not really usable in either mode under these conditions. Approved by: rwatson
* Don't attempt to parse %cache2001-03-211-2/+7
|
* Correct int/long type mismatch in the proper place this time. freevnodesgallatin2000-12-021-2/+2
| | | | | | | | | | | and numvnodes are longs in the kernel. They should remain longs in systat, what really needs to change is that they should be using SYSCTL_LONG rather than SYSCTL_INT. I also changed wantfreevnodes to SYSCTL_LONG because I happened to notice it. I wish there was a way to find all of these automatically.. Pointed out by: bde
* fix int/long type mismatches found on alphagallatin2000-12-011-4/+4
|
* o Make systat/vmstat.c use sysctl() to retrieve cp_time, bufspace,rwatson2000-11-251-29/+50
| | | | | | | | | | maxvnodes, numvnodes, freevnodes, nchstats, and numdirtybuffers. o Make the hw.ncpu error checking code a little more rigorous by sanity checking the returned data size. o Didn't fix machine-dependent non-sysctl-exported variables: intrnames, eintrnames, intrcnt, eintrcnt, as these variables are defined and exported from machine-dependent kernel code in assembly. This should probably be fixed somehow.
* Don't include <sys/buf.h>phk2000-05-051-1/+0
|
* #include <errno.h> where needed. Kill extern int errno;.imp2000-04-141-1/+1
| | | | Minor warnings in tip corrected.
* "Disks" is more correct than "Disks" could be.green1999-09-191-1/+1
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Show dirty buffers and the percentage of time a disk was busy.des1999-07-301-10/+32
| | | | | PR: 12858 Submitted by: Arjan de Vet <Arjan.deVet@adv.iae.nl>
* Display floats with format %*.0f instead of as "*****" if there isbde1999-03-221-1/+5
| | | | | enough space for this but not enough space for the normal %*.*f format. Similarly for long doubles.
* Include discrete ozfod as well as ozfod/zfod percentage.dillon1999-02-081-7/+7
|
* If there are 4 or fewer disk devices, we have room to display additionaldillon1999-02-081-5/+38
| | | | | VM statistics. zfod is moved and %slo-z ( percentage of zero-fills that were slow, i.e. not pre-zero'd ), and number of pages freed per second.
* revert to rev 1.29. (floppy drives will be gotten rid of another way)obrien1999-01-091-10/+1
|
* Turn the compile time option into a run-time option.obrien1998-12-271-7/+8
| | | | | | You can now use the `want_fd' command in the vmstat display. Suggested by: grog
* Don't waste precious space on showing the performance of fdX.obrien1998-12-271-1/+9
| | | | (can get old behavior with -DWANT_FD)
* Quiet many compiler warnings.obrien1998-10-081-3/+2
|
* Fix a core-dump situation in ":boot" mode in the vmstat display.ken1998-10-051-2/+2
| | | | Reported by: bde
* Update system to new device statistics code.gibbs1998-09-151-96/+176
| | | | Submitted by: "Kenneth D. Merry" <ken@plutotech.com>
* Fixed type mismatches which were fatal when sizeof(long) > sizeof(int).bde1998-07-061-6/+6
|
* o Use snprintf rather than sprintfimp1998-06-091-3/+3
| | | | | | | | | | | o Add more checks for buffer overflows o Use snprintf rather than strcat/cpy and have better checks for max length exceeded. Most of these changes are not exploitable buffer overruns, but it never hurts to be safe. Inspired by and obtained from: OpenBSD
* Correctly display the interrupt counts.jhay1998-05-271-1/+6
| | | | Reviewed with optimizations by: Tor Egge <tegge>
* Show size of vnode pool in vmstat mode.peter1997-09-251-2/+21
|
* Use err(3). /sys/dkstat.h -> /usr/include/sys/dkstat.hcharnier1997-08-131-8/+11
|
* Now that systat's working again, bring the vmstat cleanup over fromjkh1996-11-121-14/+14
| | | | -stable.
* Initialize interrupt counters. The boot time values were displayed as ***.bde1996-11-101-1/+1
| | | | | | Should be in 2.2. Pointed out by: /etc/malloc.conf -> AJ
* Cosmetic fixes for drive names which are 4 chars long.jkh1996-06-111-2/+2
| | | | Submitted-By: Joe Greco <jgreco@ns.sol.net>
* Localize timeache1996-03-311-1/+4
|
* Renamed Proc-cache to Dir-cache for the same reasons as in vmstat.bde1996-03-291-3/+3
| | | | Tweaked screen positions to match.
* Reduced vm dependencies. Only `struct vmmeter.h' is required.bde1995-12-131-2/+3
| | | | | | Unfortunately, the sysctl number for reading this struct is bogusly placed in <vm/vm_param.h> instead of with the declaration of the struct.
* Add explicit #include of <sys/vmmeter.h> after the last round of <vm/vm.h>peter1995-12-131-0/+1
| | | | changes.
* Don't attempt to read the variable `total' from the kernel. `total'bde1995-07-121-4/+2
| | | | | | isn't used in systat or in the kernel (it was replaced by a sysctl() call involving VM_METER) and will go away when I clean up bogus common variables in the kernel.
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* From Mark Murray:dg1995-03-291-5/+5
| | | | | | I got irritated with not seeing the interrupt numbers in a (crowded) "systat -vmstat" display, so I fixed it. Here is a patch to please be applied in src/usr.bin/systat
* Removed object lookup/hit count and changed the order of things a little.dg1995-03-251-28/+24
|
OpenPOWER on IntegriCloud