Commit Graph

110 Commits

Author SHA1 Message Date
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
Maxim Konovalov
38992545b7 o Plug a memory leak: do not forget to free asprintf(3) allocated
memory.

PR:		bin/119608
Submitted by:	peter.schuller
MFC after:	1 week
2008-01-12 20:37:06 +00:00
Maxim Konovalov
5b68ad556b o Get missed "%" in output back.
Submitted by:	sem
MFC after:	1 week
2007-12-16 07:18:59 +00:00
Maxim Konovalov
dd9bccc479 o With -x switch do not pay attention at the hardcoded limit of 3 devices and dump stats for all devices in the system. User can still limit iostat -x by -n switch.
Spotted by:	Igor Sysoev
Submitted by:	kensmith
Approved by:	re (kensmith)
MFC after:	2 weeks
2007-08-03 15:45:55 +00:00
Maxim Konovalov
beda5f787a o Re-indent long lines.
Style(9) wisdom from:	bde
2007-05-14 18:04:07 +00:00
Maxim Konovalov
fbe4fc2ec0 o Fix several style bugs in the previous commit.
Prodded by:	bde
2007-05-12 16:42:01 +00:00
Maxim Konovalov
30ff126652 o Make iostat -Ix work: print per-interval I/O extended statistics.
PR:		bin/112559
Submitted by:	Dan Nelson
MFC after:	2 weeks
2007-05-12 09:28:34 +00:00
John Baldwin
8d56a4caf9 Make iostat(8) fully work on crash dumps again (broken since 5.0):
- Pass the address of the variable we are reading to kvm_read() rather
  than the index into the nlist array.
- Properly report errors from kvm_read() which returns -1 on error, not
  0.

MFC after:	3 days
2007-02-06 20:29:40 +00:00