xref: /freebsd/usr.sbin/pstat/pstat.8 (revision 283fecc1448ed5878ce8835cf86ecc88b1eaae77)
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 c
164connection open
165.It B
166busy doing output
167.It A
168process is waiting for space in output queue
169.It a
170process is waiting for output to complete
171.It X
172open for exclusive use
173.It S
174output stopped (ixon flow control)
175.It m
176output stopped (carrier flow control)
177.It o
178output stopped (CTS flow control)
179.It d
180output stopped (DSR flow control)
181.It K
182input stopped
183.It Y
184send SIGIO for input events
185.It l
186block mode input routine in use
187.It s
188i/o being snooped
189.It Z
190connection lost
191.El
192.It PGRP
193Process group for which this is controlling terminal.
194.It DISC
195Line discipline;
196.Ql term
197for
198TTYDISC
199or
200.Ql ntty
201for
202NTTYDISC
203or
204.Ql tab
205for
206TABLDISC
207or
208.Ql slip
209for
210SLIPDISC
211or
212.Ql ppp
213for
214PPPDISC.
215.El
216.It Fl v
217Print the active vnodes.  Each group of vnodes corresponding
218to a particular filesystem is preceded by a two line header.  The
219first line consists of the following:
220.Pp
221.Df I
222.No *** MOUNT Em fstype from
223on
224.Em on fsflags
225.De
226.Pp
227where
228.Em fstype
229is one of
230.Em ufs , nfs , mfs , or pc ;
231.Em from
232is the filesystem is mounted from;
233.Em on
234is the directory
235the filesystem is mounted on; and
236.Em fsflags
237is a list
238of optional flags applied to the mount (see
239.Xr mount 8 ) .
240.The second line is a header for the individual fields ,
241the first part of which are fixed, and the second part are filesystem
242type specific.  The headers common to all vnodes are:
243.Bl -tag -width indent
244.It ADDR
245Location of this vnode.
246.It TYP
247File type.
248.It VFLAG
249.Pp
250A list of letters representing vnode flags:
251.Bl -tag -width indent
252.It R
253\- VROOT
254.It T
255\- VTEXT
256.It L
257\- VXLOCK
258.It W
259\- VXWANT
260.It E
261\- VEXLOCK
262.It S
263\- VSHLOCK
264.It T
265\- VLWAIT
266.It A
267\- VALIASED
268.It B
269\- VBWAIT
270.El
271.Pp
272.It USE
273The number of references to this vnode.
274.It HOLD
275The number of I/O buffers held by this vnode.
276.It FILEID
277The vnode fileid.
278In the case of
279.Em ufs
280this is the inode number.
281.It IFLAG
282Miscellaneous filesystem specific state variables encoded thus:
283.Bl -tag -width indent
284.It "For ufs:"
285.Pp
286.Bl -tag -width indent
287.It L
288locked
289.It U
290update time
291.Pq Xr fs 5
292must be corrected
293.It A
294access time must be corrected
295.It W
296wanted by another process (L flag is on)
297.It C
298changed time must be corrected
299.It S
300shared lock applied
301.It E
302exclusive lock applied
303.It Z
304someone waiting for a lock
305.It M
306contains modifications
307.It R
308has a rename in progress
309.El
310.It "For nfs:"
311.Bl -tag -width indent
312.It W
313waiting for I/O buffer flush to complete
314.It P
315I/O buffers being flushed
316.It M
317locally modified data exists
318.It E
319an earlier write failed
320.It X
321non-cacheable lease (nqnfs)
322.It O
323write lease (nqnfs)
324.It G
325lease was evicted (nqnfs)
326.El
327.El
328.It SIZ/RDEV
329Number of bytes in an ordinary file, or
330major and minor device of special file.
331.El
332.El
333.Sh FILES
334.Bl -tag -width /dev/kmemxxx -compact
335.It Pa /kernel
336namelist
337.It Pa /dev/kmem
338default source of tables
339.El
340.Sh SEE ALSO
341.Xr iostat 1 ,
342.Xr ps 1 ,
343.Xr systat 1 ,
344.Xr vmstat 1 ,
345.Xr stat 2 ,
346.Xr fs 5 ,
347.Rs
348.Rt Tn UNIX Rt Implementation ,
349.Ra K. Thompson
350.Re
351.Sh BUGS
352Does not understand NFS swap servers.
353.Sh HISTORY
354The
355.Nm pstat
356command appeared in 4.0BSD.
357