xref: /original-bsd/usr.sbin/pstat/pstat.8 (revision e58c8952)
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) 04/19/94
5.\" %sccs.include.redist.man%
6.\"
7.\"     @(#)pstat.8	8.4 (Berkeley) 04/19/94
8.\"
9.Dd
10.Dt PSTAT 8
11.Os BSD 4
12.Sh NAME
13.Nm pstat
14.Nd display system data structures
15.Sh SYNOPSIS
16.Nm pstat
17.Op Fl Tfnstv
18.Op Fl M Ar core
19.Op Fl N Ar system
20.Sh DESCRIPTION
21.Nm Pstat
22displays open file entry, swap space utilization,
23terminal state, and vnode data structures.
24If
25.Ar corefile
26is given, the information is sought there, otherwise
27in
28.Pa /dev/kmem .
29The required namelist is taken from
30.Pa /vmunix
31unless
32.Ar system
33is specified.
34The
35.Fl n
36option specifies that devices should be printed out by major/minor
37number rather than by name.
38.Pp
39Options are
40.Bl -tag -width indent
41.It Fl T
42Prints the number of used and free slots in the several system tables
43and is useful for checking to see how large system tables have become
44if the system is under heavy load.
45.It Fl f
46Print the open file table with these headings:
47.Bl -tag -width indent
48.It LOC
49The core location of this table entry.
50.It TYPE
51The type of object the file table entry points to.
52.It FLG
53Miscellaneous state variables encoded thus:
54.Bl -tag -width indent
55.It R
56open for reading
57.It W
58open for writing
59.It A
60open for appending
61.It S
62shared lock present
63.It X
64exclusive lock present
65.It I
66signal pgrp when data ready
67.El
68.It CNT
69Number of processes that know this open file.
70.It MSG
71Number of messages outstanding for this file.
72.It DATA
73The location of the vnode table entry or socket structure for this file.
74.It OFFSET
75The file offset (see
76.Xr lseek 2 ) .
77.El
78.It Fl s
79Print information about swap space usage on all the
80swap areas compiled into the kernel.
81The first column is the device name of the partition.  The next column is
82the total space available in the partition.  The
83.Ar Used
84column indicates the total blocks used so far;  the
85.Ar Available
86column indicates how much space is remaining on each partition.
87The
88.Ar Capacity
89reports the percentage of space used.
90.Pp
91If more than one partition is configured into the system, totals for all
92of the statistics will be reported in the final line of the report.
93.It Fl t
94Print table for terminals
95with these headings:
96.Bl -tag -width indent
97.It RAW
98Number of characters in raw input queue.
99.It CAN
100Number of characters in canonicalized input queue.
101.It OUT
102Number of characters in putput queue.
103.It MODE
104See
105.Xr tty 4 .
106.It ADDR
107Physical device address.
108.It DEL
109Number of delimiters (newlines) in canonicalized input queue.
110.It COL
111Calculated column position of terminal.
112.It STATE
113Miscellaneous state variables encoded thus:
114.Bl -tag -width indent
115.It T
116delay timeout in progress
117.It W
118waiting for open to complete
119.It O
120open
121.It F
122outq has been flushed during DMA
123.It C
124carrier is on
125.It B
126busy doing output
127.It A
128process is awaiting output
129.It X
130open for exclusive use
131.It S
132output stopped
133.It H
134hangup on close
135.El
136.It PGRP
137Process group for which this is controlling terminal.
138.It DISC
139Line discipline; blank is old tty
140OTTYDISC
141or
142.Ql new tty
143for
144NTTYDISC
145or
146.Ql net
147for
148NETLDISC
149(see
150.Xr bk 4 ) .
151.El
152.It Fl v
153Print the active vnodes.  Each group of vnodes corresponding
154to a particular filesystem is preceded by a two line header.  The
155first line consists of the following:
156.Pp
157.Df I
158.No *** MOUNT Em fstype from
159on
160.Em on fsflags
161.De
162.Pp
163where
164.Em fstype
165is one of
166.Em ufs , nfs , mfs , or pc ;
167.Em from
168is the filesystem is mounted from;
169.Em on
170is the directory
171the filesystem is mounted on; and
172.Em fsflags
173is a list
174of optional flags applied to the mount (see
175.Xr mount 8 ) .
176.The second line is a header for the individual fields ,
177the first part of which are fixed, and the second part are filesystem
178type specific.  The headers common to all vnodes are:
179.Bl -tag -width indent
180.It ADDR
181Location of this vnode.
182.It TYP
183File type.
184.It VFLAG
185.Pp
186A list of letters representing vnode flags:
187.Bl -tag -width indent
188.It R
189\- VROOT
190.It T
191\- VTEXT
192.It L
193\- VXLOCK
194.It W
195\- VXWANT
196.It E
197\- VEXLOCK
198.It S
199\- VSHLOCK
200.It T
201\- VLWAIT
202.It A
203\- VALIASED
204.It B
205\- VBWAIT
206.El
207.Pp
208.It USE
209The number of references to this vnode.
210.It HOLD
211The number of I/O buffers held by this vnode.
212.It FILEID
213The vnode fileid.
214In the case of
215.Em ufs
216this is the inode number.
217.It IFLAG
218Miscellaneous filesystem specific state variables encoded thus:
219.Bl -tag -width indent
220.It "For ufs:"
221.Pp
222.Bl -tag -width indent
223.It L
224locked
225.It U
226update time
227.Pq Xr fs 5
228must be corrected
229.It A
230access time must be corrected
231.It W
232wanted by another process (L flag is on)
233.It C
234changed time must be corrected
235.It S
236shared lock applied
237.It E
238exclusive lock applied
239.It Z
240someone waiting for a lock
241.It M
242contains modifications
243.It R
244has a rename in progress
245.El
246.It "For nfs:"
247.Bl -tag -width indent
248.It W
249waiting for I/O buffer flush to complete
250.It P
251I/O buffers being flushed
252.It M
253locally modified data exists
254.It E
255an earlier write failed
256.It X
257non-cacheable lease (nqnfs)
258.It O
259write lease (nqnfs)
260.It G
261lease was evicted (nqnfs)
262.El
263.El
264.It SIZ/RDEV
265Number of bytes in an ordinary file, or
266major and minor device of special file.
267.El
268.El
269.Sh FILES
270.Bl -tag -width /dev/kmemxxx -compact
271.It Pa /vmunix
272namelist
273.It Pa /dev/kmem
274default source of tables
275.El
276.Sh SEE ALSO
277.Xr iostat 1 ,
278.Xr ps 1 ,
279.Xr systat 1 ,
280.Xr vmstat 1 ,
281.Xr stat 2 ,
282.Xr fs 5 ,
283.Rs
284.Rt Tn UNIX Rt Implementation ,
285.Ra K. Thompson
286.Re
287.Sh BUGS
288Swap statistics are reported for all swap partitions compiled into the kernel,
289regardless of whether those partitions are being used.
290.Pp
291Does not understand NFS swap servers.
292.Sh HISTORY
293The
294.Nm pstat
295command appeared in 4.0BSD.
296