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