Commit Graph

117 Commits

Author SHA1 Message Date
Alan Somers
61631b24a1 iostat: fix rounding errors in iostat -x
Better to round numbers instead of flooring them.

MFC after:	3 weeks
Sponsored by:	Axcient
2021-07-08 10:16:32 -06:00
Edward Tomasz Napierala
125de8263a Fix formatting for tps values between 99.95 and 99.99; previously
it would display as "100.0", breaking vertical alignment.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D23538
2020-02-21 20:57:32 +00:00
Edward Tomasz Napierala
83743daead In iostat(8) output, skip the decimal point and the fractional part
for tps >= 100 and MB/s >= 1000, to prevent them for widening too much.

MFC after:	2 weeks
2019-06-16 17:32:05 +00:00
Edward Tomasz Napierala
f322b7b058 Reduce the precision of "MB/s" by one, making room for displaying
transfer rates larger 99MB/s.

MFC after:	2 weeks
2019-03-29 16:05:30 +00:00
Edward Tomasz Napierala
100b034530 Make the "KB/s" field one character shorter (by reducing the precision)
and use the space to make the "tps" one character longer.

It makes the iostat(8) output a bit less messed up.

Reviewed by:	allanjude
MFC after:	2 weeks
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D19710
2019-03-28 20:16:19 +00:00
Will Andrews
a4671335c5 iostat: update man page for r277566
The original commit added granularity to the transaction latency display
in the extended device stats mode, but didn't update the man page.

Reported by:	Miroslav Lachman <000.fbsd@quip.cz> via jmg
MFC after:	1 day
2018-08-20 13:42:22 +00:00
Allan Jude
0484aa6d85 Make iostat -xC print CPU information on its own line
Requested by:	mahrens
Reviewed by:	kenm (maintainer), mahrens
MFC after:	1 week
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D15076
2018-04-18 02:25:03 +00:00
Pedro F. Giffuni
8a16b7a18f 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.
2017-11-20 19:49:47 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Warner Losh
fbbd9655e5 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
2017-02-28 23:42:47 +00:00
Edward Tomasz Napierala
b99b3c1739 Make the "r/s" and "w/s" fields in "iostat -x" a little bit wider;
five chars is way too narrow for todays disks.

MFC after:	1 month
2016-09-21 11:22:19 +00:00
Alan Somers
01368cfa26 Fix the usr.sbin/iostat build with GCC, broken by r295768
Renamed some local variables for compatibility with -Wshadow

Reported by:	Andrew Turner
Tested by:	ken
MFC after:	4 weeks
X-MFC-with:	295768
Sponsored by:	Spectra Logic Corp
2016-02-22 21:40:53 +00:00
Alan Somers
a59c2129f3 Fix compiler warnings in iostat
Raise WARNS from 1 to 6 (the default)
Fix warnings:
* Use C99 designated initializers for structs, and initialize all fields
* Mark global variables as static
* Mark unused function arguments
* Be careful about signed/unsigned comparisons

Reviewed by:	eadler
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D5328
2016-02-18 20:08:01 +00:00
Alan Somers
da61e79c42 When iostat(8) receives SIGINT while running with "-w" or "-c", it will now
print statistics one more time before exiting. Also, it now implements the
wait using setitimer instead of sleep, so the waits will be more consistent
when the system is heavily loaded.

MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4473
2015-12-09 18:07:26 +00:00
Bryan Drewery
cf990407e1 Update dependencies after r291406 added libelf to libkvm.
Unfortunately filemon/meta mode tracks all indirect dependencies here
since ld(1) is reading libelf when linking in libkvm.  Churn would be
reduced if this was able to be limited to direct dependencies.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:18:48 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Edward Tomasz Napierala
b853c718a9 Advertise ctlstat(8) a little better.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2015-05-22 11:59:37 +00:00
Will Andrews
abf607ed8f Print transfer times for read, write, & overall independently.
Round up calculated values for iops and average time per io to avoid a
shifting display if there are 1000+ (or even 10000+) iops, or if an
average time per io column is 1000+ ms.

Reviewed by:	ken
MFC after:	1 week
Sponsored by:	Spectra Logic
MFSpectraBSD:	1089947 on 2014/09/26
		1093625 on 2014/09/29
		1093650 on 2014/09/29
		1095662 on 2014/10/09
2015-01-23 15:55:03 +00:00
Baptiste Daroussin
c6db8143ed Convert usr.sbin to LIBADD
Reduce overlinking
2014-11-25 16:57:27 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Baptiste Daroussin
01c2b8ac0d use .Mt to mark up email addresses consistently (part2)
PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
2014-06-20 09:57:27 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Sergey Kandaurov
8cb3704a63 iostat: fix extracting TTY statistics from core.
MFC after:	1 week
2013-11-25 22:55:47 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
David E. O'Brien
d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
Mikolaj Golub
3cfa2135c5 Change iostat -Ix to display total duration of transactions instead
of average duration, and total busy time instead of %.

This looks more useful when one runs `iostat -Ix` periodically to
collect statistics: e.g. now it is possible to calculate busy %
between two runs subtracting total busy times and dividing per time
period.

Average duration and % busy are still available via `iostat -x`.
2012-12-15 18:21:09 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Dimitry Andric
cfed15e6c5 In usr.sbin/iostat/iostat.c, use printf format specifiers from
inttypes.h for u_int64_t's.  While here, sort #include directives.

MFC after:	1 week
2011-12-17 20:25:23 +00:00
Joel Dahl
914e11a72b Remove the advertising clause from UCB copyrighted files in usr.sbin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
2010-12-11 09:38:12 +00:00
Yaroslav Tykhiy
43b98c2b52 Clarify a few details about iostat(8) behavior:
- The default repeat count for iostat(8) is 1 unless there
  was a -w on the command line.

- A -x display doesn't include TTY or CPU stats by default
  but they can be turned on with a -T or -C, respectively.

Submitted by:	arundel (initial version)
Reviewed by:	arundel
MFC after:	1 week
2010-11-24 00:05:19 +00:00
Ivan Voras
51e5e45458 Change "wait" banner to "qlen" to be more indicative of its purpose and to
be more inline with what gstat uses.

Reviewed by:	gnn
Silence from:	phk, keramida
2010-11-17 15:12:10 +00:00
Yaroslav Tykhiy
0d0699a172 Clean up the style and markup of the paragraph on fractional wait intervals.
MFC after:	3 days
2010-08-07 11:48:31 +00:00
Yaroslav Tykhiy
4eac7ff119 Properly spell and mark up the name of kern.hz.
MFC after:	3 days
2010-08-07 11:32:17 +00:00
Yaroslav Tykhiy
40f2ad794d Move the sentences telling the defaults for -c and -w
to where they belong.  Previously they were misplaced,
i.e., swapped.

MFC after:	3 days
2010-08-07 11:13:50 +00:00
Sean Bruno
b72df67bb4 Cleanup manpage as suggested by jhb@ to start new sentences on a new line.
MFC after:	2 Weeks
2010-05-24 16:42:53 +00:00
Sean Bruno
f1a178a2a0 Explain how the new sub-second interval from changeset:208389 works.
Approved by:	scottl(mentor)
Obtained from:	Yahoo Inc.
MFC after:	2 weeks
2010-05-23 19:48:54 +00:00
Sean Bruno
8b10473d30 Allow sub-second interval timings for iostat and vmstat.
e.g.
vmstat -w.5
iostat -w.5

Reviewed by:	jhb
Approved by:	scottl (mentor)
Obtained from:	Yahoo Inc.
MFC after:	2 weeks
2010-05-21 17:10:52 +00:00
Ed Schouten
71ccf09269 The last big commit: let usr.sbin/ use WARNS=6 by default. 2010-01-02 11:07:44 +00:00
Giorgos Keramidas
bc5980cb6c iostat: add a bit of space between tty in/out columns
The columns for tty input and output may bump against each other
if the tty output needs more than 5 columns.  Add a bit of space
that pushes everything 1 column to the right, but also avoids the
problem.

Approved by:	re (rwatson)
2009-08-15 17:57:21 +00:00
Xin LI
4f6e13686b Use calloc(). 2009-05-21 23:00:20 +00:00
Adrian Chadd
ab8ac08e14 Fix the device name spacing.
The old logic padded the device name out but assumed the unit number was one digit
long; this fails for things like SATA devices which (for me) begin at ad10.

Assemble the full device name in a temporary buffer and then calcluate padding
based on that string.
2008-09-11 09:55:54 +00:00
John Baldwin
32c9e3bd01 Use kvm_getcptime(3) to fetch the global CPU time stats from a crashdump
since the 'cp_time' symbol doesn't exist in recent kernels.  This fixes
iostat and vmstat on crash dumps.

MFC after:	1 week
2008-08-19 21:33:09 +00:00
John Baldwin
9e5fbab2a2 Pass the right pointer to bzero() when clearing cp_time.
MFC after:	1 week
2008-08-19 20:33:59 +00:00
Giorgos Keramidas
53fbcd3a78 Repeat iostat header after rows-3 instead of a hardcoded 20.
Use ioctl() to get the window size in iostat(8), and force a new
header to be prepended to the output every time the current
window size changes.  Change the number of lines before each
header to `rows - 3' when the terminal is resized, so that the
full terminal length can be used for output lines.

PR:		bin/119705
Submitted by:	keramida
Approved by:	maxim
MFC after:	2 weeks
2008-01-22 11:18:51 +00:00
Maxim Konovalov
e08b1089a6 o Fix a typo. errx() -> err().
Submitted by:	das
2008-01-12 20:57:19 +00:00