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