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