]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/iostat/iostat.8
This commit was generated by cvs2svn to compensate for changes in r102514,
[FreeBSD/FreeBSD.git] / usr.sbin / iostat / iostat.8
1 .\"
2 .\" Copyright (c) 1997 Kenneth D. Merry.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. The name of the author may not be used to endorse or promote products
14 .\"    derived from this software without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD$
29 .\"
30 .\" Copyright (c) 1985, 1991, 1993
31 .\"     The Regents of the University of California.  All rights reserved.
32 .\"
33 .\" Redistribution and use in source and binary forms, with or without
34 .\" modification, are permitted provided that the following conditions
35 .\" are met:
36 .\" 1. Redistributions of source code must retain the above copyright
37 .\"    notice, this list of conditions and the following disclaimer.
38 .\" 2. Redistributions in binary form must reproduce the above copyright
39 .\"    notice, this list of conditions and the following disclaimer in the
40 .\"    documentation and/or other materials provided with the distribution.
41 .\" 3. All advertising materials mentioning features or use of this software
42 .\"    must display the following acknowledgement:
43 .\"     This product includes software developed by the University of
44 .\"     California, Berkeley and its contributors.
45 .\" 4. Neither the name of the University nor the names of its contributors
46 .\"    may be used to endorse or promote products derived from this software
47 .\"    without specific prior written permission.
48 .\"
49 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 .\" SUCH DAMAGE.
60 .\"
61 .\"     @(#)iostat.8    8.1 (Berkeley) 6/6/93
62 .\"
63 .Dd December 22, 1997
64 .Dt IOSTAT 8
65 .Os
66 .Sh NAME
67 .Nm iostat
68 .Nd report
69 .Tn I/O
70 statistics
71 .Sh SYNOPSIS
72 .Nm
73 .Op Fl CdhKIoT?\&
74 .Op Fl c Ar count
75 .Op Fl M Ar core
76 .Op Fl n Ar devs
77 .Op Fl N Ar system
78 .Oo
79 .Fl t
80 .Sm off
81 .Ar type , if , pass
82 .Sm on
83 .Oc
84 .Op Fl w Ar wait
85 .Op Ar drives
86 .Sh DESCRIPTION
87 The
88 .Nm
89 utility displays kernel
90 .Tn I/O
91 statistics on terminal, device and cpu operations.
92 The first statistics that are printed are averaged over the system uptime.
93 To get information about the current activity, a suitable wait time should
94 be specified, so that the subsequent sets of printed statistics will be
95 averaged over that time.
96 .Pp
97 The options are as follows:
98 .Bl -tag -width flag
99 .It Fl c
100 Repeat the display
101 .Ar count
102 times.
103 If no
104 .Ar wait
105 interval is specified, the default is 1 second.
106 .It Fl C
107 Display CPU statistics.
108 This is on by default, unless
109 .Fl d
110 is specified.
111 .It Fl d
112 Display only device statistics.
113 If this flag is turned on, only device statistics will be displayed, unless
114 .Fl C
115 or
116 .Fl T
117 is also specfied to enable the display of CPU or TTY statistics.
118 .It Fl h
119 Put
120 .Nm
121 in
122 .Sq top
123 mode.
124 In this mode,
125 .Nm
126 will show devices in order from highest to lowest bytes
127 per measurement cycle.
128 .It Fl I
129 Display total statstics for a given time period, rather than average
130 statistics for each second during that time period.
131 .It Fl K
132 In the blocks transfered display (-o), display block count in kilobytes rather
133 then the device native block size.
134 .It Fl M
135 Extract values associated with the name list from the specified core
136 instead of the default
137 .Dq Pa /dev/kmem .
138 .It Fl n
139 Display up to
140 .Ar devs
141 number of devices.
142 The
143 .Nm
144 utility will display fewer devices if there aren't
145 .Ar devs
146 devices present.
147 .It Fl N
148 Extract the name list from the specified system instead of the default
149 .Dq Pa /boot/kernel/kernel .
150 .It Fl o
151 Display old-style
152 .Nm
153 device statistics.
154 Sectors per second, transfers per second, and miliseconds per seek are
155 displayed.
156 If
157 .Fl I
158 is specified, total blocks/sectors, total transfers, and
159 miliseconds per seek are displayed.
160 .It Fl t
161 Specify which types of devices to display.
162 There are three different categories of devices:
163 .Pp
164 .Bl -tag -width indent -compact
165 .It device type:
166 .Bl -tag -width 9n -compact
167 .It da
168 Direct Access devices
169 .It sa
170 Sequential Access devices
171 .It printer
172 Printers
173 .It proc
174 Processor devices
175 .It worm
176 Write Once Read Multiple devices
177 .It cd
178 CD devices
179 .It scanner
180 Scanner devices
181 .It optical
182 Optical Memory devices
183 .It changer
184 Medium Changer devices
185 .It comm
186 Communication devices
187 .It array
188 Storage Array devices
189 .It enclosure
190 Enclosure Services devices
191 .It floppy
192 Floppy devices
193 .El
194 .Pp
195 .It interface:
196 .Bl -tag -width 9n -compact
197 .It IDE
198 Integrated Drive Electronics devices
199 .It SCSI
200 Small Computer System Interface devices
201 .It other
202 Any other device interface
203 .El
204 .Pp
205 .It passthrough:
206 .Bl -tag -width 9n -compact
207 .It pass
208 Passthrough devices
209 .El
210 .El
211 .Pp
212 The user must specify at least one device type, and may specify at most
213 one device type from each category.
214 Multiple device types in a single device type statement must be separated by
215 commas.
216 .Pp
217 Any number of
218 .Fl t
219 arguments may be specified on the command line.
220 All
221 .Fl t
222 arguments are ORed together to form a matching expression against which
223 all devices in the system are compared.
224 Any device that fully matches any
225 .Fl t
226 argument will be included in the
227 .Nm
228 output, up to the number of devices that can be displayed in
229 80 columns, or the maximum number of devices specified by the user.
230 .It Fl T
231 Display TTY statistics.
232 This is on by default, unless
233 .Fl d
234 is specified.
235 .It Fl w
236 Pause
237 .Ar wait
238 seconds between each display.
239 If no repeat
240 .Ar count
241 is specified, the default is infinity.
242 .It Fl ?\&
243 Display a usage statement and exit.
244 .El
245 .Pp
246 The
247 .Nm
248 utility displays its information in the following format:
249 .Bl -tag -width flag
250 .It tty
251 .Bl -tag -width indent -compact
252 .It tin
253 characters read from terminals
254 .It tout
255 characters written to terminals
256 .El
257 .It devices
258 Device operations.
259 The header of the field is the device name and unit number.
260 The
261 .Nm
262 utility
263 will display as many devices as will fit in a standard 80 column screen, or
264 the maximum number of devices in the system, whichever is smaller.
265 If
266 .Fl n
267 is specified on the command line,
268 .Nm
269 will display the smaller of the
270 requested number of devices, and the maximum number of devices in the system.
271 To force
272 .Nm
273 to display specific drives, their names may be supplied on the command
274 line.
275 The
276 .Nm
277 utility
278 will not display more devices than will fit in an 80 column screen, unless
279 the
280 .Fl n
281 argument is given on the command line to specify a maximum number of
282 devices to display.
283 If fewer devices are specified on the command line than will fit in an 80
284 column screen,
285 .Nm
286 will show only the specified devices.
287 .Pp
288 The standard
289 .Nm
290 device display shows the following statistics:
291 .Pp
292 .Bl -tag -width indent -compact
293 .It KB/t
294 kilobytes per transfer
295 .It tps
296 transfers per second
297 .It MB/s
298 megabytes per second
299 .El
300 .Pp
301 The standard
302 .Nm
303 device display, with the
304 .Fl I
305 flag specified, shows the following statistics:
306 .Pp
307 .Bl -tag -width indent -compact
308 .It KB/t
309 kilobytes per transfer
310 .It xfrs
311 total number of transfers
312 .It MB
313 total number of megabytes transferred
314 .El
315 .Pp
316 The old-style
317 .Nm
318 display (using
319 .Fl o )
320 shows the following statistics:
321 .Pp
322 .Bl -tag -width indent -compact
323 .It sps
324 sectors transferred per second
325 .It tps
326 transfers per second
327 .It msps
328 average milliseconds per transaction
329 .El
330 .Pp
331 The old-style
332 .Nm
333 display, with the
334 .Fl I
335 flag specified, shows the following statistics:
336 .Pp
337 .Bl -tag -width indent -compact
338 .It blk
339 total blocks/sectors transferred
340 .It xfr
341 total transfers
342 .It msps
343 average milliseconds per transaction
344 .El
345 .It cpu
346 .Bl -tag -width indent -compact
347 .It \&us
348 % of cpu time in user mode
349 .It \&ni
350 % of cpu time in user mode running niced processes
351 .It \&sy
352 % of cpu time in system mode
353 .It \&in
354 % of cpu time in interrupt mode
355 .It \&id
356 % of cpu time in idle mode
357 .El
358 .El
359 .Sh FILES
360 .Bl -tag -width /boot/kernel/kernel -compact
361 .It Pa /boot/kernel/kernel
362 Default kernel namelist.
363 .It Pa /dev/kmem
364 Default memory file.
365 .El
366 .Sh EXAMPLES
367 .Dl iostat -w 1 da0 da1 cd0
368 .Pp
369 Display statistics for the first two Direct Access devices and the first
370 CDROM device every second ad infinitum.
371 .Pp
372 .Dl iostat -c 2
373 .Pp
374 Display the statistics for the first four devices in the system twice, with
375 a one second display interval.
376 .Pp
377 .Dl iostat -t da -t cd -w 1
378 .Pp
379 Display statistics for all CDROM and Direct Access devices every second
380 ad infinitum.
381 .Pp
382 .Dl iostat -t da,scsi,pass -t cd,scsi,pass
383 .Pp
384 Display statistics once for all SCSI passthrough devices that provide access
385 to either Direct Access or CDROM devices.
386 .Pp
387 .Dl iostat -h -n 8 -w 1
388 .Pp
389 Display up to 8 devices with the most I/O every second ad infinitum.
390 .Pp
391 .Dl iostat -dh -t da -w 1
392 .Pp
393 Omit the TTY and CPU displays, show devices in order of performance and
394 show only Direct Access devices every second ad infinitum.
395 .Pp
396 .Dl iostat -Iw 3
397 .Pp
398 Display total statistics every three seconds ad infinitum.
399 .Pp
400 .Dl iostat -odICTw 2 -c 9
401 .Pp
402 Display total statistics using the old-style output format 9 times, with
403 a two second interval between each measurement/display.
404 The
405 .Fl d
406 flag generally disables the TTY and CPU displays, but since the
407 .Fl T
408 and
409 .Fl C
410 flags are given, the TTY and CPU displays will be displayed.
411 .Sh SEE ALSO
412 .Xr fstat 1 ,
413 .Xr netstat 1 ,
414 .Xr nfsstat 1 ,
415 .Xr ps 1 ,
416 .Xr systat 1 ,
417 .Xr pstat 8 ,
418 .Xr vmstat 8
419 .Pp
420 The sections starting with ``Interpreting system activity'' in
421 .%T "Installing and Operating 4.3BSD" .
422 .Sh HISTORY
423 This version of
424 .Nm
425 first appeared in
426 .Fx 3.0 .
427 .Sh BUGS
428 The use of
429 .Nm
430 as a debugging tool for crash dumps is probably limited because there is
431 currently no way to get statistics that only cover the time immediately before
432 the crash.
433 .Sh AUTHORS
434 .An Kenneth Merry Aq ken@FreeBSD.org