Merge branch 'vendor/FLEX'
[dragonfly.git] / usr.sbin / pstat / pstat.8
1 .\" Copyright (c) 1980, 1991, 1993, 1994
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. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)pstat.8     8.5 (Berkeley) 5/13/94
33 .\" $FreeBSD: src/usr.sbin/pstat/pstat.8,v 1.19.2.10 2002/07/12 09:12:49 des Exp $
34 .\" $DragonFly: src/usr.sbin/pstat/pstat.8,v 1.5 2008/09/02 11:50:46 matthias Exp $
35 .\"
36 .Dd September 2, 2008
37 .Dt PSTAT 8
38 .Os
39 .Sh NAME
40 .Nm pstat ,
41 .Nm swapinfo
42 .Nd display system data structures
43 .Sh SYNOPSIS
44 .Nm
45 .Op Fl Tfknst
46 .Op Fl M Ar core
47 .Op Fl N Ar system
48 .Pp
49 .Nm swapinfo
50 .Op Fl k
51 .Op Fl M Ar core
52 .Op Fl N Ar system
53 .Sh DESCRIPTION
54 .Nm Pstat
55 displays open file entry, swap space utilization,
56 terminal state, and vnode data structures.
57 .Pp
58 If invoked as
59 .Nm swapinfo
60 the
61 .Fl s
62 option is implied, and only the
63 .Fl k
64 option is legal.
65 .Pp
66 The following options are available:
67 .Bl -tag -width indent
68 .It Fl n
69 Print devices out by major/minor instead of name.
70 .It Fl k
71 Print sizes in kilobytes, regardless of the setting of the
72 .Ev BLOCKSIZE
73 environment variable.
74 .It Fl T
75 Print the number of used and free slots in several system tables.
76 This is useful for checking to see how large system tables have become
77 if the system is under heavy load.
78 .It Fl f
79 Print the open file table with these headings:
80 .Bl -tag -width indent
81 .It LOC
82 The core location of this table entry.
83 .It TYPE
84 The type of object the file table entry points to.
85 .It FLG
86 Miscellaneous state variables encoded thus:
87 .Pp
88 .Bl -tag -width indent -compact
89 .It R
90 open for reading
91 .It W
92 open for writing
93 .It A
94 open for appending
95 .It S
96 shared lock present
97 .It X
98 exclusive lock present
99 .It I
100 signal pgrp when data ready
101 .El
102 .It CNT
103 Number of processes that know this open file.
104 .It MSG
105 Number of messages outstanding for this file.
106 .It DATA
107 The location of the vnode table entry or socket structure for this file.
108 .It OFFSET
109 The file offset (see
110 .Xr lseek 2 ) .
111 .El
112 .It Fl s
113 Print information about swap space usage on all the
114 swap areas compiled into the kernel.
115 The first column is the device name of the partition.  The next column is
116 the total space available in the partition.  The
117 .Ar Used
118 column indicates the total blocks used so far;  the
119 .Ar Available
120 column indicates how much space is remaining on each partition.
121 The
122 .Ar Capacity
123 reports the percentage of space used.
124 .Pp
125 If more than one partition is configured into the system, totals for all
126 of the statistics will be reported in the final line of the report.
127 .Pp
128 If you supply the option again, as in
129 .Fl ss ,
130 the system will display a breakdown of the swap bitmap/radix-tree.
131 .It Fl t
132 Print table for terminals
133 with these headings:
134 .Bl -tag -width indent
135 .It RAW
136 Number of characters in raw input queue.
137 .It CAN
138 Number of characters in canonicalized input queue.
139 .It OUT
140 Number of characters in output queue.
141 .It MODE
142 See
143 .Xr tty 4 .
144 .It ADDR
145 Physical device address.
146 .It DEL
147 Number of delimiters (newlines) in canonicalized input queue.
148 .It COL
149 Calculated column position of terminal.
150 .It STATE
151 Miscellaneous state variables encoded thus:
152 .Pp
153 .Bl -tag -width indent -compact
154 .It T
155 delay timeout in progress
156 .It W
157 waiting for open to complete
158 .It O
159 open
160 .It F
161 outq has been flushed during DMA
162 .It C
163 carrier is on
164 .It c
165 connection open
166 .It B
167 busy doing output
168 .It A
169 process is waiting for space in output queue
170 .It a
171 process is waiting for output to complete
172 .It X
173 open for exclusive use
174 .It S
175 output stopped (ixon flow control)
176 .It m
177 output stopped (carrier flow control)
178 .It o
179 output stopped (CTS flow control)
180 .It d
181 output stopped (DSR flow control)
182 .It K
183 input stopped
184 .It Y
185 send
186 .Dv SIGIO
187 for input events
188 .It D
189 state for lowercase
190 .Ql \e
191 work
192 .It E
193 within a
194 .Ql \e.../
195 for PRTRUB
196 .It L
197 next character is literal
198 .It P
199 retyping suspended input (PENDIN)
200 .It N
201 counting tab width, ignore FLUSHO
202 .It l
203 block mode input routine in use
204 .It s
205 i/o being snooped
206 .It Z
207 connection lost
208 .El
209 .It SESS
210 Kernel address of the session structure.
211 .It PGID
212 Process group for which this is controlling terminal.
213 .It DISC
214 Line discipline;
215 .Ql term
216 for
217 TTYDISC
218 or
219 .Ql ntty
220 for
221 NTTYDISC
222 or
223 .Ql tab
224 for
225 TABLDISC
226 or
227 .Ql slip
228 for
229 SLIPDISC
230 or
231 .Ql ppp
232 for
233 PPPDISC.
234 .El
235 .It Fl M
236 Extract values associated with the name list from the specified core
237 instead of the default
238 .Pa /dev/kmem .
239 .It Fl N
240 Extract the name list from the specified system instead of the default
241 .Pa /boot/kernel .
242 .El
243 .Sh FILES
244 .Bl -tag -width /dev/memxxx -compact
245 .It Pa /boot/kernel
246 namelist
247 .It Pa /dev/mem
248 default source of tables
249 .El
250 .Sh SEE ALSO
251 .Xr fstat 1 ,
252 .Xr ps 1 ,
253 .Xr systat 1 ,
254 .Xr stat 2 ,
255 .Xr fs 5 ,
256 .Xr iostat 8 ,
257 .Xr vmstat 8
258 .Rs
259 .%T UNIX Implementation
260 .%A K. Thompson
261 .Re
262 .Sh HISTORY
263 The
264 .Nm
265 command appeared in
266 .Bx 4.0 .
267 .Sh BUGS
268 Does not understand
269 .Tn NFS
270 swap servers.