History log of /freebsd-current/usr.bin/systat/iostat.c
Revision Date Author Comments
# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# e5d258c9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .c pattern

Remove /^#include\s+<sys/cdefs.h>.*$\n\s+__FBSDID\("\$FreeBSD\$"\);\n/


# d1673185 07-Feb-2022 Warner Losh <imp@FreeBSD.org>

systat/iostat: Use bools for numbers and kbpt

These are really bools, declare them as such.

Sponsored by: Netflix


# 932c2667 01-Nov-2021 Mateusz Guzik <mjg@FreeBSD.org>

systat: fix stack overflow when running -iostat

The new buffer is arbitrarily sized to likely "big enough".

Sponsored by: Rubicon Communications, LLC ("Netgate")


# 45518845 02-Apr-2019 Michael Reifenberger <mr@FreeBSD.org>

systat -zarc to display disk activities like -vm

PR: 213310
Submitted by: ota
MFH: 4 weeks
Differential Revision: https://reviews.freebsd.org/D18726


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# 1e902b3b 10-Sep-2015 Xin LI <delphij@FreeBSD.org>

- Avoid accessing window properties directly, instead, use accessors.
This should be no-op for now, but allows the code to work if we
move to NCURSES_OPAQUE.
- Use calloc() instead of malloc+bzero.

MFC after: 2 weeks


# 627d915e 05-Feb-2012 Ed Schouten <ed@FreeBSD.org>

Whitespace fixes.

- Remove redundant empty lines.
- Replace ^L by \014. This allows you to safely cat/grep/etc this file
without causing confusion.


# da52b4ca 11-Dec-2010 Joel Dahl <joel@FreeBSD.org>

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


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 821df508 12-Dec-2009 Xin LI <delphij@FreeBSD.org>

Revert most part of 200420 as requested, as more review and polish is
needed.


# 6f2d3221 11-Dec-2009 Xin LI <delphij@FreeBSD.org>

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 93b9f504 16-Jan-2008 Xin LI <delphij@FreeBSD.org>

ANSIfy and remove register.

Resulting binary verified with strip(1)+md5(1).


# 65b02a0f 27-Nov-2006 Yaroslav Tykhiy <ytykhiy@gmail.com>

Consistently mark percentage scales as such.

PR: bin/101975
MFC after: 3 days


# a9a3dcd6 29-Apr-2006 Bruce Evans <bde@FreeBSD.org>

Remove trailing whitespace.

Submitted by: Se=E1n Farley <sean-freebsd at farley dot org>
PR: bin/81874


# 8aa22952 29-Apr-2006 Bruce Evans <bde@FreeBSD.org>

Show the load average in the tcp display (it was already shown, perhaps
not very usefully, in all other displays). This was the original point
of the PR.

Move the load average up by 2 so that it starts in row 0 for all windows
(2 lines above it were wasted for all other windows except vmstat).
Move everything below it up by 2 or 3 (3 for icmp and icmp6 which had
an extra blank line due from not compensating for the foot-shooting in
note (3); only ip and ip6 compensated). Reduce the magic numbers related
to this.

Notes by the submitter:
%%%
1. All the subwin() calls are identical using #define MAINWIN_ROW 3
(systat.h).
2. The load average is at the top of the window.
3. Each display starts on the fourth line. I made changes to those
displays that shifted the start line (i.e., icmp). This entailed a
lot of changes within the comments at the top of those displays.
4. For ip6, I shifted the "Input next-header histogram" column down one
row to separate it from "IPv6 Output". I raised "bad scope packets"
and "address selection failed" up one row to stay with "IPv6 Input"
(valid?). They were down one row to probably line up at the bottom,
but I think they should stick with their fellow items in a column.
5. I condensed ifstat a bit. It had a lot of empty rows.
%%%

Submitted by: Se=E1n Farley <sean-freebsd at farley dot org>
PR: bin/81874


# d980da6c 31-Oct-2003 Tim J. Robbins <tjr@FreeBSD.org>

Copy cur's snap_time to last when refreshing statistics. Fixes problem
where MB/s and tps statistics would always be zero, presumably because
they were being averaged out over the time between now and when the
system booted instead of a few seconds.

PR: 58683


# 7194d335 15-Mar-2003 Poul-Henning Kamp <phk@FreeBSD.org>

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


# 3bd41074 16-Feb-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Add #include <sys/resource.h>


# f341ca98 16-Feb-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Remove #include <sys/dkstat.h>


# 3f330d7d 21-Mar-2002 Warner Losh <imp@FreeBSD.org>

remove __P


# 9ff712b0 11-Dec-2001 Mark Murray <markm@FreeBSD.org>

WARNS=2 fixes with NO_WERROR set, as there are some header issues
with namelists. use __FBSDID().


# 8f29de8b 05-Sep-2001 Kenneth D. Merry <ken@FreeBSD.org>

Convert systat(1) to use the new devstat interface.

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


# 342e2faa 22-Mar-2001 Thomas Moestl <tmm@FreeBSD.org>

Get rid of setgid kmem for systat, and while being there, fix some bugs
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


# 8c82fe65 24-Nov-2000 Robert Watson <rwatson@FreeBSD.org>

o Make systat/iostat.c use sysctl() to retrieve cp_time instead of
kmem.


# fb7a8c91 01-Jun-2000 Poul-Henning Kamp <phk@FreeBSD.org>

Duh! get the scaling right.


# 0e5064d2 01-Jun-2000 Poul-Henning Kamp <phk@FreeBSD.org>

Rescale the IOstat bars, modern disks are faster than old disks.


# 9df46d4a 05-May-2000 Poul-Henning Kamp <phk@FreeBSD.org>

Don't include <sys/buf.h>


# 3879bee4 30-Aug-1999 Peter Wemm <peter@FreeBSD.org>

systat is way too comfortable with curses internals...


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# d22889b8 08-Oct-1998 David E. O'Brien <obrien@FreeBSD.org>

Quiet many compiler warnings.


# 8d2fbde5 15-Sep-1998 Justin T. Gibbs <gibbs@FreeBSD.org>

Update system to new device statistics code.

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


# 81a4459b 06-Jul-1998 Bruce Evans <bde@FreeBSD.org>

Fixed type mismatches which were fatal when sizeof(long) > sizeof(int).


# 448b84a0 08-Jun-1998 Warner Losh <imp@FreeBSD.org>

o Use snprintf rather than sprintf
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


# 94591e17 11-Jun-1996 Jordan K. Hubbard <jkh@FreeBSD.org>

Cosmetic fixes for drive names which are 4 chars long.
Submitted-By: Joe Greco <jgreco@ns.sol.net>


# 3544ae54 03-Dec-1994 Bruce Evans <bde@FreeBSD.org>

extern.h, iostat.c, main.c, vmstat.c:
Use the correct value of hz (stathz if it is nonzero) for
interpretion of dk_time[] and cp_time[] in iostat.c. Avoid
multiple conversions of this value in iostat.c and vmstat.c

iostat.c:
Implement the display of cp_time[CP_INTR]. Fix the display
of cp_time[CP_IDLE] (the display was always null because
cp_time[CP_INTR] == 0 was displayed instead).

systat.1:
Document the display of cp_time[CP_INTR].

vmstat.c:
Implement the display of cp_time[CP_INTR].


# 9b50d902 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Usr.bin Sources