History log of /freebsd-current/usr.sbin/gstat/gstat.c
Revision Date Author Comments
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# a9cce232 07-Jul-2023 Alfonso Gregory <gfunni234@gmail.com>

Mark usage function as __dead2 in programs where it does not return

In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735


# eb8f8877 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-3-Clause-FreeBSD identifier never was, drop -FreeBSD

There never was a BSD-3-Clause-FreeBSD SPDX identifier. Replace it
with BSD-3-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 3874c0ab 07-Jul-2021 Alan Somers <asomers@FreeBSD.org>

[skip ci] correct a few SPDX license tags

These were all incorrectly labeled as 2-clause BSD licenses by a
semi-automated process, when in fact they are 3-clause.

Discussed with: pfg, imp
MFC after: 2 weeks
Sponsored by: Axcient


# d065b3eb 24-Aug-2020 Maxim Sobolev <sobomax@FreeBSD.org>

In the endless batch mode (-B), terminate if and when stdout is closed.
That mode is useful to call gstat from other app, however kinda useless
since gstat won't exit and stay running forever when its parent process
has long gone.

MFC after: 2 weeks


# 0b9079bf 21-Aug-2018 Marcelo Araujo <araujo@FreeBSD.org>

- Add CSV output to gstat via -C flag.

Add a -C option, similar to -B, that allows gstat to produce basic CSV output
with absolute timestamps (ISO 8601, nearly.) Multiple devices are handled by
way of a single-pivot CSV table with duplicated timestamps for each object
output.

Submitted by: Nick Principe <nap__ixsystems.com>
Reviewed by: myself, imp@, asomers (earlier verison), bcr (manpages)
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D16151


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

No functional change intended.


# 712a6ae6 09-Nov-2016 Marcelo Araujo <araujo@FreeBSD.org>

Add flag -B which does the same like batch mode but without exiting after
print. Also add a new flag -s that add blocks size to statistics.

PR: 198347, 212726
Submitted by: Ben RUBSON <ben.rubson@gmail.com>
Tested by: pi
MFC After: 2 weeks.


# 3185f0f0 23-Jun-2016 Alan Somers <asomers@FreeBSD.org>

Fix gstat's interactive f and q commands

curses and libedit don't play well together. After last year's libedit
upgrade in head, they play even less well together. This change resets some
curses settings after they get screwed up by libedit calls. Without it,
gstat's interactive commands require an extra "enter", screw up the terminal
on exit, and screw up the display if the user enters an invalid filter
string.

PR: 204852
Submitted by: Keith White
Reviewed by: pfg
Approved by: re (gjb)
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6934


# 2d0fc14c 11-Sep-2015 Xin LI <delphij@FreeBSD.org>

Use strlcpy() in favor of strncpy() as it's defined to have a nul character
at the end of string buffer, and the code context do expects this to behave
correctly (e.g. strchr).

Note that we do not believe there is real-world impact for gstat(8)'s usage
because the strings are length checked, and the on-stack buffer belongs to
main() and we can expect to have zeros in them.

MFC after: 2 weeks


# f7317857 03-Jul-2014 Xin LI <delphij@FreeBSD.org>

Add an option, -p, which makes gstat(8) to only display physical providers
(those with rank of 1).

MFC after: 2 weeks


# 16f6e715 17-May-2014 Alexander Motin <mav@FreeBSD.org>

Add -o option to gstat to display "other" operatins (e.g. BIO_FLUSH).

MFC after: 1 week


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


# 62bc2068 12-Mar-2009 Maxim Konovalov <maxim@FreeBSD.org>

o Turn the batch mode on if stdout is not tty.

Submitted by: vsevolod
MFC after: 1 week


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

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


# a0312e48 07-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Allow gstat to print values to different kind of outputs.
- Introduce batch mode, where gstat will collect the numbers, print them, and
exit.
- Document batch mode in the gstat man page.

Submitted by: anders


# 0c5de885 05-Jan-2008 Poul-Henning Kamp <phk@FreeBSD.org>

When the ms/req fields exceed 1 second, drop the fractions to fit more digits.

This is unfortunately necessary with some flash based devices which can
get hundreds of seconds behind with softupdates enabled.


# c8113770 29-Mar-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Deterministically set the default refresh interval to one second.

Approved by: phk
MFC after: 1 week


# 711385c9 20-May-2006 Simon L. B. Nielsen <simon@FreeBSD.org>

- Add support for filtering the the list of providers by a regular
expression, which makes it possible to only see interesting
providers. "f" is used inside gstat to set a filter, "F" is used to
remove current filter.
- Do not print some uninteresting values in the gstat title line.
- Do not print past the end of the screen.
- Read multiple keystrokes per "wait" when gstat is running.
- Remove a redundant != check, right after check of NULL against the
same variable ("gid").
- Use sysexits.h.
- Do not link against libkvm and libsbuf, they are not actually used.
- Fix a few style(9) issues where I had to touch nearby code anyway.

Approved by: cperciva (mentor)
MFC after: 2 weeks


# 4c985f4a 05-Jan-2005 Lukas Ertl <le@FreeBSD.org>

Add forgotten -a to the usage() message.


# be75dba7 10-Oct-2004 Lukas Ertl <le@FreeBSD.org>

Add an '-a' switch to only display providers that are at least
0.1% busy.

OK'ed by: phk


# 0c436cdf 04-Jun-2004 Ruslan Ermilov <ru@FreeBSD.org>

Added forgotten -d to the usage().


# a7526044 16-May-2004 Stefan Farfeleder <stefanf@FreeBSD.org>

Remove spurious semicolons. Outside of functions they are actually errors but
GCC doesn't warn about them without -pedantic.

Approved by: das (mentor)
PR: 56649
Reviewed by: md5


# 8ebcdbf7 15-May-2004 Matthew N. Dodd <mdodd@FreeBSD.org>

Correct a typo in column header.

Submitted by: phk
Obtained from: BSDCan


# ccac9da4 09-Mar-2004 John Baldwin <jhb@FreeBSD.org>

Make libgeom usable by C++ programs:
- Add DECL wrappers to libgeom.h.
- Rename structure members in libgeom.h to use a lg_ prefix for member
names. This is required because a few structures had members named
'class' which made g++ very unhappy.
- Catch gstat(8) and gconcat(8) up to these API changes.

Reviewed by: phk


# fbbe961c 15-Feb-2004 Poul-Henning Kamp <phk@FreeBSD.org>

Add -d flag to monitor BIO_DELETE operations too


# 6bf611a7 22-Mar-2003 Giorgos Keramidas <keramida@FreeBSD.org>

Make -c only set flag_c and not a toggle. With flag_c disabled by
default, this makes the behavior of gstat more predictable when -c is
specified multiple times on the command line.


# ab42be1f 22-Mar-2003 Giorgos Keramidas <keramida@FreeBSD.org>

Add & use a usage() function.


# 4fe8c1b6 22-Mar-2003 Giorgos Keramidas <keramida@FreeBSD.org>

Add error and range checking to strtoul() to avoid ending up with a
delay time of ULONG_MAX when -I is passed a non-numeric arg.


# dfb085cc 21-Mar-2003 Giorgos Keramidas <keramida@FreeBSD.org>

Call endwin() to restore terminal state just before exiting.

Approved by: phk


# 54a8adab 20-Mar-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Add a rudimentary gstat(8) to the system.

This is a small curses based program which shows the diskactivity
inside GEOM.