xref: /freebsd/usr.sbin/pstat/pstat.8 (revision 5ebc7e6281887681c3a348a5a4c902e262ccd656)
1.\" Copyright (c) 1980, 1991, 1993, 1994
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\"	@(#)pstat.8	8.4 (Berkeley) 4/19/94
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. All advertising materials mentioning features or use of this software
14.\"    must display the following acknowledgement:
15.\"	This product includes software developed by the University of
16.\"	California, Berkeley and its contributors.
17.\" 4. Neither the name of the University nor the names of its contributors
18.\"    may be used to endorse or promote products derived from this software
19.\"    without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\"     @(#)pstat.8	8.4 (Berkeley) 4/19/94
34.\"
35.Dd April 19, 1994
36.Dt PSTAT 8
37.Os BSD 4
38.Sh NAME
39.Nm pstat
40.Nd display system data structures
41.Sh SYNOPSIS
42.Nm pstat
43.Op Fl Tfknstv
44.Op Fl M Ar core
45.Op Fl N Ar system
46.Pp
47.Nm swapinfo
48.Op Fl k
49.Sh DESCRIPTION
50.Nm Pstat
51displays open file entry, swap space utilization,
52terminal state, and vnode data structures.
53If
54.Ar corefile
55is given, the information is sought there, otherwise
56in
57.Pa /dev/kmem .
58The required namelist is taken from
59.Pa /kernel
60unless
61.Ar system
62is specified.
63.Pp
64If invoked as
65.Nm swapinfo
66the
67.Fl s
68option is implied, and only the
69.Fl k
70option is legal.
71.Pp
72Options are
73.Bl -tag -width indent
74.It Fl n
75Print devices out by major/minor instead of name.
76.It Fl k
77Print sizes in kilobytes, regardless of the setting of the BLOCKSIZE
78environment variable.
79.It Fl T
80Prints the number of used and free slots in the several system tables
81and is useful for checking to see how large system tables have become
82if the system is under heavy load.
83.It Fl f
84Print the open file table with these headings:
85.Bl -tag -width indent
86.It LOC
87The core location of this table entry.
88.It TYPE
89The type of object the file table entry points to.
90.It FLG
91Miscellaneous state variables encoded thus:
92.Bl -tag -width indent
93.It R
94open for reading
95.It W
96open for writing
97.It A
98open for appending
99.It S
100shared lock present
101.It X
102exclusive lock present
103.It I
104signal pgrp when data ready
105.El
106.It CNT
107Number of processes that know this open file.
108.It MSG
109Number of messages outstanding for this file.
110.It DATA
111The location of the vnode table entry or socket structure for this file.
112.It OFFSET
113The file offset (see
114.Xr lseek 2 ) .
115.El
116.It Fl s
117Print information about swap space usage on all the
118swap areas compiled into the kernel.
119The first column is the device name of the partition.  The next column is
120the total space available in the partition.  The
121.Ar Used
122column indicates the total blocks used so far;  the
123.Ar Available
124column indicates how much space is remaining on each partition.
125The
126.Ar Capacity
127reports the percentage of space used.
128.Pp
129If more than one partition is configured into the system, totals for all
130of the statistics will be reported in the final line of the report.
131.It Fl t
132Print table for terminals
133with these headings:
134.Bl -tag -width indent
135.It RAW
136Number of characters in raw input queue.
137.It CAN
138Number of characters in canonicalized input queue.
139.It OUT
140Number of characters in putput queue.
141.It MODE
142See
143.Xr tty 4 .
144.It ADDR
145Physical device address.
146.It DEL
147Number of delimiters (newlines) in canonicalized input queue.
148.It COL
149Calculated column position of terminal.
150.It STATE
151Miscellaneous state variables encoded thus:
152.Bl -tag -width indent
153.It T
154delay timeout in progress
155.It W
156waiting for open to complete
157.It O
158open
159.It F
160outq has been flushed during DMA
161.It C
162carrier is on
163.It B
164busy doing output
165.It A
166process is awaiting output
167.It X
168open for exclusive use
169.It S
170output stopped
171.It H
172hangup on close
173.El
174.It PGRP
175Process group for which this is controlling terminal.
176.It DISC
177Line discipline; blank is old tty
178OTTYDISC
179or
180.Ql new tty
181for
182NTTYDISC
183or
184.Ql net
185for
186NETLDISC
187(see
188.Xr bk 4 ) .
189.El
190.It Fl v
191Print the active vnodes.  Each group of vnodes corresponding
192to a particular filesystem is preceded by a two line header.  The
193first line consists of the following:
194.Pp
195.Df I
196.No *** MOUNT Em fstype from
197on
198.Em on fsflags
199.De
200.Pp
201where
202.Em fstype
203is one of
204.Em ufs , nfs , mfs , or pc ;
205.Em from
206is the filesystem is mounted from;
207.Em on
208is the directory
209the filesystem is mounted on; and
210.Em fsflags
211is a list
212of optional flags applied to the mount (see
213.Xr mount 8 ) .
214.The second line is a header for the individual fields ,
215the first part of which are fixed, and the second part are filesystem
216type specific.  The headers common to all vnodes are:
217.Bl -tag -width indent
218.It ADDR
219Location of this vnode.
220.It TYP
221File type.
222.It VFLAG
223.Pp
224A list of letters representing vnode flags:
225.Bl -tag -width indent
226.It R
227\- VROOT
228.It T
229\- VTEXT
230.It L
231\- VXLOCK
232.It W
233\- VXWANT
234.It E
235\- VEXLOCK
236.It S
237\- VSHLOCK
238.It T
239\- VLWAIT
240.It A
241\- VALIASED
242.It B
243\- VBWAIT
244.El
245.Pp
246.It USE
247The number of references to this vnode.
248.It HOLD
249The number of I/O buffers held by this vnode.
250.It FILEID
251The vnode fileid.
252In the case of
253.Em ufs
254this is the inode number.
255.It IFLAG
256Miscellaneous filesystem specific state variables encoded thus:
257.Bl -tag -width indent
258.It "For ufs:"
259.Pp
260.Bl -tag -width indent
261.It L
262locked
263.It U
264update time
265.Pq Xr fs 5
266must be corrected
267.It A
268access time must be corrected
269.It W
270wanted by another process (L flag is on)
271.It C
272changed time must be corrected
273.It S
274shared lock applied
275.It E
276exclusive lock applied
277.It Z
278someone waiting for a lock
279.It M
280contains modifications
281.It R
282has a rename in progress
283.El
284.It "For nfs:"
285.Bl -tag -width indent
286.It W
287waiting for I/O buffer flush to complete
288.It P
289I/O buffers being flushed
290.It M
291locally modified data exists
292.It E
293an earlier write failed
294.It X
295non-cacheable lease (nqnfs)
296.It O
297write lease (nqnfs)
298.It G
299lease was evicted (nqnfs)
300.El
301.El
302.It SIZ/RDEV
303Number of bytes in an ordinary file, or
304major and minor device of special file.
305.El
306.El
307.Sh FILES
308.Bl -tag -width /dev/kmemxxx -compact
309.It Pa /kernel
310namelist
311.It Pa /dev/kmem
312default source of tables
313.El
314.Sh SEE ALSO
315.Xr iostat 1 ,
316.Xr ps 1 ,
317.Xr systat 1 ,
318.Xr vmstat 1 ,
319.Xr stat 2 ,
320.Xr fs 5 ,
321.Rs
322.Rt Tn UNIX Rt Implementation ,
323.Ra K. Thompson
324.Re
325.Sh BUGS
326Does not understand NFS swap servers.
327.Sh HISTORY
328The
329.Nm pstat
330command appeared in 4.0BSD.
331