Back out previous commit minus spelling fixes. Should have asked maintainer
before.
This commit is contained in:
parent
ee5114590e
commit
6b7275814f
@ -25,6 +25,8 @@
|
|||||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
.\" SUCH DAMAGE.
|
.\" SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
|
.\" $FreeBSD$
|
||||||
|
.\"
|
||||||
.\" Copyright (c) 1985, 1991, 1993
|
.\" Copyright (c) 1985, 1991, 1993
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
.\"
|
.\"
|
||||||
@ -57,7 +59,6 @@
|
|||||||
.\" SUCH DAMAGE.
|
.\" SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
.\" @(#)iostat.8 8.1 (Berkeley) 6/6/93
|
.\" @(#)iostat.8 8.1 (Berkeley) 6/6/93
|
||||||
.\" $FreeBSD$
|
|
||||||
.\"
|
.\"
|
||||||
.Dd December 22, 1997
|
.Dd December 22, 1997
|
||||||
.Dt IOSTAT 8
|
.Dt IOSTAT 8
|
||||||
@ -69,7 +70,7 @@
|
|||||||
statistics
|
statistics
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm iostat
|
.Nm iostat
|
||||||
.Op Fl CdhKIoT
|
.Op Fl CdhKIoT?
|
||||||
.Op Fl c Ar count
|
.Op Fl c Ar count
|
||||||
.Op Fl M Ar core
|
.Op Fl M Ar core
|
||||||
.Op Fl n Ar devs
|
.Op Fl n Ar devs
|
||||||
@ -122,16 +123,16 @@ instead of the default
|
|||||||
Display up to
|
Display up to
|
||||||
.Ar devs
|
.Ar devs
|
||||||
number of devices.
|
number of devices.
|
||||||
.Nm Iostat
|
.Nm iostat
|
||||||
will display fewer devices if there aren't
|
will display fewer devices if there aren't
|
||||||
.Ar devs
|
.Ar devs
|
||||||
devices present.
|
devices present.
|
||||||
.It Fl N
|
.It Fl N
|
||||||
Extract the name list from the specified system instead of the default
|
Extract the name list from the specified system instead of the default
|
||||||
.Pa /kernel .
|
.Dq Pa /kernel .
|
||||||
.It Fl o
|
.It Fl o
|
||||||
Display old-style
|
Display old-style
|
||||||
.Nm
|
.Nm iostat
|
||||||
device statistics. Sectors per second, transfers per second, and miliseconds
|
device statistics. Sectors per second, transfers per second, and miliseconds
|
||||||
per seek are displayed. If
|
per seek are displayed. If
|
||||||
.Fl I
|
.Fl I
|
||||||
@ -202,7 +203,7 @@ all devices in the system are compared. Any device that fully matches
|
|||||||
any
|
any
|
||||||
.Fl t
|
.Fl t
|
||||||
argument will be included in the
|
argument will be included in the
|
||||||
.Nm
|
.Nm iostat
|
||||||
output, up to the number of devices that can be displayed in
|
output, up to the number of devices that can be displayed in
|
||||||
80 columns, or the maximum number of devices specified by the user.
|
80 columns, or the maximum number of devices specified by the user.
|
||||||
.It Fl T
|
.It Fl T
|
||||||
@ -216,6 +217,8 @@ seconds between each display.
|
|||||||
If no repeat
|
If no repeat
|
||||||
.Ar count
|
.Ar count
|
||||||
is specified, the default is infinity.
|
is specified, the default is infinity.
|
||||||
|
.It Fl ?
|
||||||
|
Display a usage statement and exit.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
.Nm Iostat
|
.Nm Iostat
|
||||||
@ -230,28 +233,27 @@ characters written to terminals
|
|||||||
.El
|
.El
|
||||||
.It devices
|
.It devices
|
||||||
Device operations. The header of the field is the device name and unit number.
|
Device operations. The header of the field is the device name and unit number.
|
||||||
.Nm Iostat
|
.Nm iostat
|
||||||
will display as many devices as will fit in a standard 80 column screen, or
|
will display as many devices as will fit in a standard 80 column screen, or
|
||||||
the maximum number of devices in the system, whichever is smaller. If
|
the maximum number of devices in the system, whichever is smaller. If
|
||||||
.Fl n
|
.Fl n
|
||||||
is specified on the command line, iostat will display the smaller of the
|
is specified on the command line, iostat will display the smaller of the
|
||||||
requested number of devices, and the maximum number of devices in the system.
|
requested number of devices, and the maximum number of devices in the system.
|
||||||
To force
|
To force
|
||||||
.Nm
|
.Nm iostat
|
||||||
to display specific drives, their names may be supplied on the command
|
to display specific drives, their names may be supplied on the command
|
||||||
line.
|
line.
|
||||||
.Nm Iostat
|
.Nm iostat
|
||||||
will not display more devices than will fit in an 80 column screen, unless
|
will not display more devices than will fit in an 80 column screen, unless
|
||||||
the
|
the
|
||||||
.Fl n
|
.Fl n
|
||||||
argument is given on the command line to specify a maximum number of
|
argument is given on the command line to specify a maximum number of
|
||||||
devices to display. If fewer devices are specified on the command line
|
devices to display. If fewer devices are specified on the command line
|
||||||
than will fit in an 80 column screen,
|
than will fit in an 80 column screen, iostat will show only the specified
|
||||||
.Nm
|
devices.
|
||||||
will show only the specified devices.
|
|
||||||
.Pp
|
.Pp
|
||||||
The standard
|
The standard
|
||||||
.Nm
|
.Nm iostat
|
||||||
device display shows the following statistics:
|
device display shows the following statistics:
|
||||||
.Pp
|
.Pp
|
||||||
.Bl -tag -width indent -compact
|
.Bl -tag -width indent -compact
|
||||||
@ -264,7 +266,7 @@ megabytes per second
|
|||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The standard
|
The standard
|
||||||
.Nm
|
.Nm iostat
|
||||||
device display, with the
|
device display, with the
|
||||||
.Fl I
|
.Fl I
|
||||||
flag specified, shows the following statistics:
|
flag specified, shows the following statistics:
|
||||||
@ -279,7 +281,7 @@ total number of megabytes transferred
|
|||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The old-style
|
The old-style
|
||||||
.Nm
|
.Nm iostat
|
||||||
display (using
|
display (using
|
||||||
.Fl o )
|
.Fl o )
|
||||||
shows the following statistics:
|
shows the following statistics:
|
||||||
@ -294,7 +296,7 @@ average milliseconds per transaction
|
|||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The old-style
|
The old-style
|
||||||
.Nm
|
.Nm iostat
|
||||||
display, with the
|
display, with the
|
||||||
.Fl I
|
.Fl I
|
||||||
flag specified, shows the following statistics:
|
flag specified, shows the following statistics:
|
||||||
@ -324,9 +326,9 @@ average milliseconds per transaction
|
|||||||
.Sh FILES
|
.Sh FILES
|
||||||
.Bl -tag -width /dev/kmem -compact
|
.Bl -tag -width /dev/kmem -compact
|
||||||
.It Pa /kernel
|
.It Pa /kernel
|
||||||
default kernel namelist
|
Default kernel namelist.
|
||||||
.It Pa /dev/kmem
|
.It Pa /dev/kmem
|
||||||
default memory file
|
Default memory file.
|
||||||
.El
|
.El
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
.Dl iostat -w 1 da0 da1 cd0
|
.Dl iostat -w 1 da0 da1 cd0
|
||||||
@ -385,7 +387,7 @@ The sections starting with ``Interpreting system activity'' in
|
|||||||
.%T "Installing and Operating 4.3BSD" .
|
.%T "Installing and Operating 4.3BSD" .
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
This version of
|
This version of
|
||||||
.Nm
|
.Nm iostat
|
||||||
first appeared in
|
first appeared in
|
||||||
.Fx 3.0 .
|
.Fx 3.0 .
|
||||||
.Sh BUGS
|
.Sh BUGS
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Parts of this program are derived from the original FreeBSD iostat
|
* Parts of this program are derived from the original FreeBSD iostat
|
||||||
@ -97,10 +99,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
|
||||||
static const char rcsid[] =
|
|
||||||
"$FreeBSD$";
|
|
||||||
#endif /* not lint */
|
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -157,10 +155,9 @@ usage(void)
|
|||||||
* This isn't mentioned in the man page, or the usage statement,
|
* This isn't mentioned in the man page, or the usage statement,
|
||||||
* but it is supported.
|
* but it is supported.
|
||||||
*/
|
*/
|
||||||
fprintf(stderr, "%s\n%s\n",
|
fprintf(stderr, "usage: iostat [-CdhIKoT?] [-c count] [-M core]"
|
||||||
"usage: iostat [-CdhIKoT] [-c count] [-M core] [-n devs] [-N system]",
|
" [-n devs] [-N system]\n"
|
||||||
" [-t type,if,pass] [-w wait] [drives]");
|
"\t [-t type,if,pass] [-w wait] [drives]\n");
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -174,6 +171,7 @@ main(int argc, char **argv)
|
|||||||
struct devstat_match *matches;
|
struct devstat_match *matches;
|
||||||
int num_matches = 0;
|
int num_matches = 0;
|
||||||
char errbuf[_POSIX2_LINE_MAX];
|
char errbuf[_POSIX2_LINE_MAX];
|
||||||
|
char *err_str;
|
||||||
kvm_t *kd;
|
kvm_t *kd;
|
||||||
int hz, stathz;
|
int hz, stathz;
|
||||||
int headercount;
|
int headercount;
|
||||||
@ -187,7 +185,7 @@ main(int argc, char **argv)
|
|||||||
matches = NULL;
|
matches = NULL;
|
||||||
maxshowdevs = 3;
|
maxshowdevs = 3;
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "c:CdhIKM:n:N:ot:Tw:")) != -1) {
|
while ((c = getopt(argc, argv, "c:CdhIKM:n:N:ot:Tw:?")) != -1) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
cflag++;
|
cflag++;
|
||||||
@ -241,9 +239,9 @@ main(int argc, char **argv)
|
|||||||
if (waittime < 1)
|
if (waittime < 1)
|
||||||
errx(1, "wait time is < 1");
|
errx(1, "wait time is < 1");
|
||||||
break;
|
break;
|
||||||
case '?':
|
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
|
exit(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -290,11 +288,7 @@ main(int argc, char **argv)
|
|||||||
err(1, "can't get number of devices");
|
err(1, "can't get number of devices");
|
||||||
|
|
||||||
cur.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo));
|
cur.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo));
|
||||||
if (cur.dinfo == NULL)
|
|
||||||
errx(1, "malloc failed");
|
|
||||||
last.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo));
|
last.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo));
|
||||||
if (last.dinfo == NULL)
|
|
||||||
errx(1, "malloc failed");
|
|
||||||
bzero(cur.dinfo, sizeof(struct devinfo));
|
bzero(cur.dinfo, sizeof(struct devinfo));
|
||||||
bzero(last.dinfo, sizeof(struct devinfo));
|
bzero(last.dinfo, sizeof(struct devinfo));
|
||||||
|
|
||||||
@ -314,8 +308,6 @@ main(int argc, char **argv)
|
|||||||
* they are in the list of devices we have now.
|
* they are in the list of devices we have now.
|
||||||
*/
|
*/
|
||||||
specified_devices = (char **)malloc(sizeof(char *));
|
specified_devices = (char **)malloc(sizeof(char *));
|
||||||
if (specified_devices == NULL)
|
|
||||||
errx(1, "malloc failed");
|
|
||||||
for (num_devices_specified = 0; *argv; ++argv) {
|
for (num_devices_specified = 0; *argv; ++argv) {
|
||||||
if (isdigit(**argv))
|
if (isdigit(**argv))
|
||||||
break;
|
break;
|
||||||
@ -323,8 +315,6 @@ main(int argc, char **argv)
|
|||||||
specified_devices = (char **)realloc(specified_devices,
|
specified_devices = (char **)realloc(specified_devices,
|
||||||
sizeof(char *) *
|
sizeof(char *) *
|
||||||
num_devices_specified);
|
num_devices_specified);
|
||||||
if (specified_devices == NULL)
|
|
||||||
errx(1, "malloc failed");
|
|
||||||
specified_devices[num_devices_specified - 1] = *argv;
|
specified_devices[num_devices_specified - 1] = *argv;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user