xref: /freebsd/usr.sbin/pstat/pstat.8 (revision 6e8394b8baa7d5d9153ab90de6824bcd19b3b4e1)
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.\"	$Id: pstat.8,v 1.16 1998/01/17 16:58:55 bde Exp $
34.\"
35.Dd May 13, 1994
36.Dt PSTAT 8
37.Os BSD 4
38.Sh NAME
39.Nm pstat ,
40.Nm swapinfo
41.Nd display system data structures
42.Sh SYNOPSIS
43.Nm pstat
44.Op Fl Tfiknstv
45.Op Fl M Ar core
46.Op Fl N Ar system
47.Pp
48.Nm swapinfo
49.Op Fl k
50.Op Fl M Ar core
51.Op Fl N Ar system
52.Sh DESCRIPTION
53.Nm Pstat
54displays open file entry, swap space utilization,
55terminal state, and vnode data structures.
56If
57.Ar corefile
58is given, the information is sought there, otherwise
59in
60.Pa /dev/mem .
61The required namelist is taken from
62.Pa /kernel
63unless
64.Ar system
65is specified.
66.Pp
67If invoked as
68.Nm swapinfo
69the
70.Fl s
71option is implied, and only the
72.Fl k
73option is legal.
74.Pp
75The following options are available:
76.Bl -tag -width indent
77.It Fl n
78Print devices out by major/minor instead of name.
79.It Fl k
80Print sizes in kilobytes, regardless of the setting of the BLOCKSIZE
81environment variable.
82.It Fl T
83Print the number of used and free slots in the several system tables
84and is useful for checking to see how large system tables have become
85if the system is under heavy load.
86.It Fl f
87Print the open file table with these headings:
88.Bl -tag -width indent
89.It LOC
90The core location of this table entry.
91.It TYPE
92The type of object the file table entry points to.
93.It FLG
94Miscellaneous state variables encoded thus:
95.Bl -tag -width indent
96.It R
97open for reading
98.It W
99open for writing
100.It A
101open for appending
102.It S
103shared lock present
104.It X
105exclusive lock present
106.It I
107signal pgrp when data ready
108.El
109.It CNT
110Number of processes that know this open file.
111.It MSG
112Number of messages outstanding for this file.
113.It DATA
114The location of the vnode table entry or socket structure for this file.
115.It OFFSET
116The file offset (see
117.Xr lseek 2 ) .
118.El
119.It Fl s
120Print information about swap space usage on all the
121swap areas compiled into the kernel.
122The first column is the device name of the partition.  The next column is
123the total space available in the partition.  The
124.Ar Used
125column indicates the total blocks used so far;  the
126.Ar Available
127column indicates how much space is remaining on each partition.
128The
129.Ar Capacity
130reports the percentage of space used.
131.Pp
132If more than one partition is configured into the system, totals for all
133of the statistics will be reported in the final line of the report.
134.Pp
135If you supply the option again, as in
136.Fl ss ,
137the system will display a breakdown of the swap bitmap/radix-tree.
138.It Fl t
139Print table for terminals
140with these headings:
141.Bl -tag -width indent
142.It RAW
143Number of characters in raw input queue.
144.It CAN
145Number of characters in canonicalized input queue.
146.It OUT
147Number of characters in output queue.
148.It MODE
149See
150.Xr tty 4 .
151.It ADDR
152Physical device address.
153.It DEL
154Number of delimiters (newlines) in canonicalized input queue.
155.It COL
156Calculated column position of terminal.
157.It STATE
158Miscellaneous state variables encoded thus:
159.Bl -tag -width indent
160.It T
161delay timeout in progress
162.It W
163waiting for open to complete
164.It O
165open
166.It F
167outq has been flushed during DMA
168.It C
169carrier is on
170.It c
171connection open
172.It B
173busy doing output
174.It A
175process is waiting for space in output queue
176.It a
177process is waiting for output to complete
178.It X
179open for exclusive use
180.It S
181output stopped (ixon flow control)
182.It m
183output stopped (carrier flow control)
184.It o
185output stopped (CTS flow control)
186.It d
187output stopped (DSR flow control)
188.It K
189input stopped
190.It Y
191send SIGIO for input events
192.It D
193state for lowercase
194.Ql \e
195work
196.It E
197within a
198.Ql \e.../
199for PRTRUB
200.It L
201next character is literal
202.It P
203retyping suspended input (PENDIN)
204.It N
205counting tab width, ignore FLUSHO
206.It l
207block mode input routine in use
208.It s
209i/o being snooped
210.It Z
211connection lost
212.El
213.It SESS
214Kernel address of the session structure.
215.It PGID
216Process group for which this is controlling terminal.
217.It DISC
218Line discipline;
219.Ql term
220for
221TTYDISC
222or
223.Ql ntty
224for
225NTTYDISC
226or
227.Ql tab
228for
229TABLDISC
230or
231.Ql slip
232for
233SLIPDISC
234or
235.Ql ppp
236for
237PPPDISC.
238.El
239.It Fl v
240Print the active vnodes.  Each group of vnodes corresponding
241to a particular filesystem is preceded by a two line header.  The
242first line consists of the following:
243.Pp
244.Df I
245.No *** MOUNT Em fstype from
246on
247.Em on fsflags
248.De
249.Pp
250where
251.Em fstype
252is one of
253.Em ufs , nfs , mfs , or pc ;
254.Em from
255is the filesystem is mounted from;
256.Em on
257is the directory
258the filesystem is mounted on; and
259.Em fsflags
260is a list
261of optional flags applied to the mount (see
262.Xr mount 8 ) .
263.The second line is a header for the individual fields ,
264the first part of which are fixed, and the second part are filesystem
265type specific.  The headers common to all vnodes are:
266.Bl -tag -width indent
267.It ADDR
268Location of this vnode.
269.It TYP
270File type.
271.It VFLAG
272.Pp
273A list of letters representing vnode flags:
274.Bl -tag -width indent
275.It R
276\- VROOT
277.It T
278\- VTEXT
279.It S
280\- VSYSTEM
281.It t
282\- VISTTY
283.It L
284\- VXLOCK
285.It W
286\- VXWANT
287.It B
288\- VBWAIT
289.It A
290\- VALIASED
291.It V
292\- VOBJBUF
293.It a
294\- VAGE
295.It l
296\- VOLOCK
297.It w
298\- VOWANT
299.El
300.Pp
301.It USE
302The number of references to this vnode.
303.It HOLD
304The number of I/O buffers held by this vnode.
305.It FILEID
306The vnode fileid.
307In the case of
308.Em ufs
309this is the inode number.
310.It IFLAG
311Miscellaneous filesystem specific state variables encoded thus:
312.Bl -tag -width indent
313.It "For ufs:"
314.Pp
315.Bl -tag -width indent
316.It L
317locked
318.It U
319update time
320.Pq Xr fs 5
321must be corrected
322.It A
323access time must be corrected
324.It W
325wanted by another process (L flag is on)
326.It C
327changed time must be corrected
328.It S
329shared lock applied
330.It E
331exclusive lock applied
332.It Z
333someone waiting for a lock
334.It M
335contains modifications
336.It R
337has a rename in progress
338.El
339.It "For nfs:"
340.Bl -tag -width indent
341.It W
342waiting for I/O buffer flush to complete
343.It P
344I/O buffers being flushed
345.It M
346locally modified data exists
347.It E
348an earlier write failed
349.It X
350non-cacheable lease (nqnfs)
351.It O
352write lease (nqnfs)
353.It G
354lease was evicted (nqnfs)
355.El
356.El
357.It SIZ/RDEV
358Number of bytes in an ordinary file, or
359major and minor device of special file.
360.El
361.It Fl i
362Same as
363.Fl v ,
364present for backwards-compatibility.
365.El
366.Sh FILES
367.Bl -tag -width /dev/memxxx -compact
368.It Pa /kernel
369namelist
370.It Pa /dev/mem
371default source of tables
372.El
373.Sh SEE ALSO
374.Xr ps 1 ,
375.Xr systat 1 ,
376.Xr stat 2 ,
377.Xr fs 5 ,
378.Xr iostat 8 ,
379.Xr vmstat 8
380.Rs
381.Rt Tn UNIX Rt Implementation ,
382.Ra K. Thompson
383.Re
384.Sh BUGS
385Does not understand NFS swap servers.
386.Sh HISTORY
387The
388.Nm pstat
389command appeared in
390.Bx 4.0 .
391