History log of /freebsd-current/usr.bin/systat/main.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/


# bf46512a 15-Aug-2023 Warner Losh <imp@FreeBSD.org>

systat: Remove obsolete copyright string

This is unused, so remove it. We don't put a copyright string in most of
the other binaries. This one doesn't need one either.

Sponsored by: Netflix


# 22054f88 28-Feb-2022 Warner Losh <imp@FreeBSD.org>

Report I/O stats from the CAM_IOSCHED_DYNAMIC extension

Report, on a periodic basis, the I/O latencies the CAM I/O scheduler
computes. These times are only for the hardware portion of the I/O as
measured from the time the operation is scheduled with the SIM using
xpt_action() until the SIM reports it has completed with xpt_dine(). Any
time the I/O operation spends in a software queue is no included.

The P50 (median), P90, P99 and P99.9 statistics about the latency of
each of the read, write and trim operations that completed during the
polling interval are reported. If there are fewer than 2, 10, 100 or
1000 operations during the polling interval, no statistic is reported
and a single dash '-' is displayed.

The read, write and trim commands (either on the command line or at run
time) toggle display of these operations. The color command toggles
color (it defaults to on, like gstat). When color is enabled, unknown
statistics are reported in blue, high latency for a statistics is
reported in red, medium in magenta and low in green (as with gstat). The
med= and hi= commands can set these latency thresholds.

Limitations: The entire sysctl space for all the devices is walked for
each polling period. This should be optimized to remember the OIDs and
only do such polling with the xpt generation changes. There is also no
way to filter devices displayed. This command only works on physical
devies that are connected to SCSI, ATA or NVME sims as those are the
only ones that are instrumented in the CAM I/O scheduler (the
CAM_IOSCHED_DYNAMIC option must be in the kernel, and the dynamic
scheduler can't be disabled).

MFC After: 1 month
Relnotes: yes
Sponsored by: Netflix
Reviewed by: pauamma_gundo.com, chs
Differential Revision: https://reviews.freebsd.org/D34259


# 6d88f9fe 01-Nov-2021 Mateusz Guzik <mjg@FreeBSD.org>

systat: mostly clean up warns

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


# 66483838 21-Apr-2021 Michael Reifenberger <mr@FreeBSD.org>

systat: Handle SIGWINCH to properly window resizing and adjust
-swap disk stat based on new size.

Display corrupts after resizing a window.
Process SIGWINCH to redraw all window.

Submitted by: Yoshihiro Ota ota@j.email.ne.jp
Differential Revision: https://reviews.freebsd.org/D29337


# 4bde6353 11-May-2020 Michael Reifenberger <mr@FreeBSD.org>

Patch systat -zarc to display cumulative rate and round down large numbers by SI units

PR: 237664
Submitted by: ota@j.email.ne.jp
MFC after: 2 weeks


# 61bbe5bf 12-Aug-2018 Cy Schubert <cy@FreeBSD.org>

Chasing r337661, fix systat after arc accounting change.


# 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


# 4c59a886 16-Aug-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use nitems() from sys/param.h.

MFC after: 2 weeks.


# 1e8b591f 26-Apr-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use macro MIN() from sys/param.h.

MFC after: 2 weeks.


# 05212689 28-Sep-2015 Xin LI <delphij@FreeBSD.org>

Use _PATH_DEVNULL instead of direct hardcoding.

MFC after: 2 weeks


# 27aa4769 27-Sep-2015 Michael Reifenberger <mr@FreeBSD.org>

Add support to systat to display zfs arc cache status/info

PR: 195460
Submitted by: ota


# a2ca3324 06-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove unused variable


# 525e2a83 15-May-2014 Brooks Davis <brooks@FreeBSD.org>

Revert r261296. This removes the WITHOUT_NCURSESW option.

It was the wrong direction. We will instead remove use of the
non-wide-character supporting libncurses.


# 6052df8e 09-May-2014 Alexander V. Chernikov <melifaro@FreeBSD.org>

Allow systat(1) interactive dispay-specific commands to
be specified via command line.

Submitted by: vsevolod
MFC after: 2 weeks


# 38e23337 30-Jan-2014 Brooks Davis <brooks@FreeBSD.org>

Merge from CheriBSD:
commit c1acf022c533c5ae27e0cd556977eafe3f5959eb
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date: Fri Jan 17 21:46:44 2014 +0000

Add an option WITHOUT_NCURSESW to suppress building and linking to
libncursesw. While wide character support it useful we'd like to
only need one ncurses library on embedded systems.

MFC after: 4 weeks
Sponsored by: DARPA, AFRL


# 00c31a91 18-Feb-2013 Philippe Charnier <charnier@FreeBSD.org>

Remove old-style function definition


# 8b3daf89 17-Sep-2012 Alexander V. Chernikov <melifaro@FreeBSD.org>

Make systat(1) accept fractional number of seconds.
Make old alarm(3)-based code use select(2).

MFC after: 2 weeks


# 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


# c2a8874e 22-Nov-2009 Hajimu UMEMOTO <ume@FreeBSD.org>

MFC r199242: Use ncursesw to output the date field of vmstat
display with multi-byte string, correctly.


# f969a7ac 15-Nov-2009 Jaakko Heinonen <jh@FreeBSD.org>

MFC r197956:

- Catch SIGHUP to perform cleanup before exiting.
- Exit if getch() returns with an error other than EINTR. Otherwise
systat(1) may get stuck in an infinite loop if it doesn't receive
SIGHUP when terminal closes.
- Remove attempt to clear stdio error indicators. getch() doesn't use
stdio, making it useless.
- Remove unneeded masking of getch() return value.

PR: bin/107171
Approved by: trasz (mentor)


# 347c7f55 12-Nov-2009 Hajimu UMEMOTO <ume@FreeBSD.org>

Use ncursesw to output the date field of vmstat display
with multi-byte string, correctly.


# c2dbb0de 10-Oct-2009 Jaakko Heinonen <jh@FreeBSD.org>

- Catch SIGHUP to perform cleanup before exiting.
- Exit if getch() returns with an error other than EINTR. Otherwise
systat(1) may get stuck in an infinite loop if it doesn't receive
SIGHUP when terminal closes. [1]
- Remove attempt to clear stdio error indicators. getch() doesn't use
stdio, making it useless. [2]
- Remove unneeded masking of getch() return value. [2]

PR: bin/107171
Reviewed by: bde
Approved by: trasz (mentor)
Obtained from: OpenBSD [1]
Suggested by: bde [2]
MFC after: 1 month


# 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).


# 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


# 33dc5491 09-Mar-2004 David Malone <dwmalone@FreeBSD.org>

Fix the easy warnings:

1) Avoid shadowing index.
2) Constness.
3) Missing prototype for ifcmd.
4) Missing include of string.h.
5) Avoid shadowing error function.
6) ANSI definition for main.


# bbf5c743 23-Mar-2002 Warner Losh <imp@FreeBSD.org>

unifdef __STDC__


# 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().


# 5a3c3d03 25-May-2001 Thomas Moestl <tmm@FreeBSD.org>

Fix the error buffer passed to kvm_openfiles to have a length of
_POSIX2_LINE_MAX as required.
While being there, wrap an overly long line.

MFC after: 3 days


# 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


# 48c193e1 17-Dec-2000 Robert Watson <rwatson@FreeBSD.org>

o Fix up includes which built due to excessive nested including in the
base system, but not in BruceBSD.
o Fix up style violations of various sorts.
o Remove redundant normalization of hertz variable, as the sysctl handler
does this work (unlike when kread was used).

Submitted by: bde


# 7ace4e61 24-Nov-2000 Robert Watson <rwatson@FreeBSD.org>

o Make systat use sysctl() to retrieve hz and stathz, instead of
using kmem.


# 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.


# 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


# 01492790 26-Aug-1997 Philippe Charnier <charnier@FreeBSD.org>

Main() returns int.


# d8793dfa 13-Aug-1997 Philippe Charnier <charnier@FreeBSD.org>

Use err(3). /sys/dkstat.h -> /usr/include/sys/dkstat.h


# daab8558 31-Mar-1996 Andrey A. Chernov <ache@FreeBSD.org>

Localize time


# c3f4fea4 11-Mar-1995 Poul-Henning Kamp <phk@FreeBSD.org>

Don't use curses until initialized.


# 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].


# dc5c110e 18-Oct-1994 Andrey A. Chernov <ache@FreeBSD.org>

Prevents segm. fault on unknown option


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

BSD 4.4 Lite Usr.bin Sources