build - Separate out CFLAGS for kernel & module build
[dragonfly.git] / usr.bin / vmstat / vmstat.8
blobc749eef65b78dd7234e4fcf787d546713dbd5cd2
1 .\" Copyright (c) 1986, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 .\"     @(#)vmstat.8    8.1 (Berkeley) 6/6/93
29 .\" $FreeBSD: src/usr.bin/vmstat/vmstat.8,v 1.16.2.5 2001/08/16 13:17:13 ru Exp $
30 .\" $DragonFly: src/usr.bin/vmstat/vmstat.8,v 1.6 2008/09/02 11:50:46 matthias Exp $
31 .\"
32 .Dd May 30, 2013
33 .Dt VMSTAT 8
34 .Os
35 .Sh NAME
36 .Nm vmstat
37 .Nd report virtual memory statistics
38 .Sh SYNOPSIS
39 .Nm
40 .\" .Op Fl fimst
41 .Op Fl imsvz
42 .Op Fl c Ar count
43 .Op Fl M Ar core
44 .Op Fl N Ar system
45 .Op Fl w Ar wait
46 .Op Fl n Ar devs
47 .Oo
48 .Fl p
49 .Sm off
50 .Ar type , if , pass
51 .Sm on
52 .Oc
53 .Op Ar disks
54 .Sh DESCRIPTION
55 .Nm Vmstat
56 reports certain kernel statistics kept about process, virtual memory,
57 disk, trap and cpu activity.
58 .Pp
59 The options are as follows:
60 .Bl -tag -width indent
61 .It Fl c
62 Repeat the display
63 .Ar count
64 times.
65 The first display is for the time since a reboot and each subsequent
66 report is for the time period since the last display.
67 If no repeat
68 .Ar count
69 is specified, and
70 .Fl w
71 is specified, the default is infinity, otherwise the default is one.
72 .\" .It Fl f
73 .\" Report on the number
74 .\" .Xr fork 2
75 .\" and
76 .\" .Xr vfork 2
77 .\" system calls since system startup, and the number of pages of virtual memory
78 .\" involved in each.
79 .It Fl i
80 Report on the number of interrupts taken by each device since system
81 startup.
82 .It Fl M
83 Extract values associated with the name list from the specified
84 .Ar core
85 instead of the default
86 .Pa /dev/kmem .
87 .It Fl N
88 Extract the name list from the specified
89 .Ar system
90 instead of the default
91 .Pa /boot/kernel .
92 .It Fl m
93 Report on the usage of kernel dynamic memory listed first by size of
94 allocation and then by type of usage.
95 .It Fl n
96 Change the maximum number of disks to display from the default of 2.
97 .It Fl p
98 Specify which types of devices to display.  There are three different
99 categories of devices:
101 .Bl -tag -width indent -compact
102 .It device type:
103 .Bl -tag -width 9n -compact
104 .It da
105 Direct Access devices
106 .It sa
107 Sequential Access devices
108 .It printer
109 Printers
110 .It proc
111 Processor devices
112 .It worm
113 Write Once Read Multiple devices
114 .It cd
115 CD devices
116 .It scanner
117 Scanner devices
118 .It optical
119 Optical Memory devices
120 .It changer
121 Medium Changer devices
122 .It comm
123 Communication devices
124 .It array
125 Storage Array devices
126 .It enclosure
127 Enclosure Services devices
128 .It floppy
129 Floppy devices
132 .It interface:
133 .Bl -tag -width 9n -compact
134 .It IDE
135 Integrated Drive Electronics devices
136 .It SCSI
137 Small Computer System Interface devices
138 .It other
139 Any other device interface
142 .It passthrough:
143 .Bl -tag -width 9n -compact
144 .It pass
145 Passthrough devices
149 The user must specify at least one device type, and may specify at most
150 one device type from each category.  Multiple device types in a single
151 device type statement must be separated by commas.
153 Any number of
154 .Fl p
155 arguments may be specified on the command line.  All
156 .Fl p
157 arguments are ORed together to form a matching expression against which
158 all devices in the system are compared.  Any device that fully matches
160 .Fl p
161 argument will be included in the
163 output, up to three devices, or the maximum number of devices specified
164 by the user.
165 .It Fl s
166 Display the contents of the
167 .Em sum
168 structure, giving the total number of several kinds of paging related
169 events which have occurred since system startup.
170 .\" .It Fl t
171 .\" Report on the number of page in and page reclaims since system startup,
172 .\" and the amount of time required by each.
173 .It Fl v
174 If specified together with
175 .Fl i ,
176 include IRQ numbers and IRQ target CPU numbers before device names.
177 .It Fl w
178 Pause
179 .Ar wait
180 seconds between each display.
181 If no repeat
182 .Ar wait
183 interval is specified, the default is 1 second.
184 .It Fl z
185 Report on memory used by the kernel zone allocator, by zone.
186 The information shown is the same as that returned by the
187 .Va vm.zone
188 sysctl variable.
191 By default,
193 displays the following information:
194 .Bl -tag -width indent
195 .It procs
196 Information about the numbers of processes in various states.
198 .Bl -tag -width indent -compact
199 .It r
200 in run queue
201 .It b
202 blocked for resources (i/o, paging, etc.)
203 .It w
204 runnable or short sleeper (< 20 secs) but swapped
206 .It memory
207 Information about the usage of virtual and real memory.
208 Virtual pages (reported in units of 1024 bytes) are considered active if
209 they belong to processes which are running or have run in the last 20
210 seconds.
212 .Bl -tag -width indent -compact
213 .It fre
214 Approximate free and easily-freeable memory.
216 .It page
217 Information about page faults and paging activity.
218 These are averaged each five seconds, and given in units per second.
220 .Bl -tag -width indent -compact
221 .It flt
222 total number of page faults
223 .It re
224 page reclaims (simulating reference bits)
225 .\" .It at
226 .\" pages attached (found in free list)
227 .It pi
228 pages paged in
229 .It po
230 pages paged out
231 .It fr
232 pages freed per second
233 .\" .It de
234 .\" anticipated short term memory shortfall
236 .It disks
237 Disk operations per second (this field is system dependent).
238 Typically paging will be split across the available drives.
239 The header of the field is the first two characters of the disk name and
240 the unit number.
241 If more than three disk drives are configured in the system,
243 displays only the first three drives, unless the user specifies the
244 .Fl n
245 argument to increase the number of drives displayed.  This will probably
246 cause the display to exceed 80 columns, however.
247 To force
249 to display specific drives, their names may be supplied on the command line.
251 defaults to show disks first, and then various other random devices in the
252 system to add up to three devices, if there are that many devices in the
253 system.  If devices are specified on the command line, or if a device type
254 matching pattern is specified (see above),
256 will only display the given devices or the devices matching the pattern,
257 and will not randomly select other devices in the system.
258 .It faults
259 Trap/interrupt rate averages per second over last 5 seconds.
261 .Bl -tag -width indent -compact
262 .It int
263 device interrupts per interval (including clock interrupts)
264 .It sys
265 system calls per interval
266 .It ctx
267 cpu context switch rate (switches/interval)
269 .It cpu
270 Breakdown of percentage usage of CPU time.
272 .Bl -tag -width indent -compact
273 .It us
274 user time for normal and low priority processes
275 .It sy
276 system time
277 .It id
278 cpu idle
281 .Sh FILES
282 .Bl -tag -width /dev/kmemxxx -compact
283 .It Pa /boot/kernel
284 default kernel namelist
285 .It Pa /dev/kmem
286 default memory file
288 .Sh EXAMPLES
289 The command:
290 .Dl vmstat -w 5
291 will print what the system is doing every five
292 seconds; this is a good choice of printing interval since this is how often
293 some of the statistics are sampled in the system.
294 Others vary every second and running the output for a while will make it
295 apparent which are recomputed every second.
297 The command:
298 .Dl vmstat -p da -p cd -w 1
299 will tell vmstat to select the first three direct access or CDROM devices
300 and display statistics on those devices, as well as other systems
301 statistics every second.
302 .Sh SEE ALSO
303 .Xr fstat 1 ,
304 .Xr netstat 1 ,
305 .Xr nfsstat 1 ,
306 .Xr ps 1 ,
307 .Xr systat 1 ,
308 .Xr iostat 8 ,
309 .Xr pstat 8 ,
310 .Xr sysctl 8
312 The sections starting with ``Interpreting system activity'' in
313 .%T "Installing and Operating 4.3BSD" .
314 .Sh BUGS
316 .Fl c
318 .Fl w
319 options are only available with the default output.