xref: /netbsd-src/usr.sbin/pstat/pstat.8 (revision 9fbd88883c38d0c0fbfcbe66d76fe6b0fab3f9de)
1.\"	$NetBSD: pstat.8,v 1.26 2001/07/09 17:46:39 ad Exp $
2.\"
3.\" Copyright (c) 1980, 1991, 1993, 1994
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     from: @(#)pstat.8	8.5 (Berkeley) 5/13/94
35.\"
36.Dd May 13, 1994
37.Dt PSTAT 8
38.Os
39.Sh NAME
40.Nm pstat
41.Nd display system data structures
42.Sh SYNOPSIS
43.Nm
44.Oo
45.Fl T | Fl f | Fl s |
46.Fl t | Fl v
47.Oc
48.Op Fl kn
49.Op Fl M Ar core
50.Op Fl N Ar system
51.Sh DESCRIPTION
52.Nm
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 /netbsd
62unless
63.Ar system
64is specified.
65.Pp
66The following options are available:
67.Bl -tag -width Ds
68.It Fl T
69Prints the number of used and free slots for open files, used vnodes, and swap
70space.  This option is useful for checking to see how large system tables
71become if the system is under heavy load.
72.It Fl f
73Print the open file table with these headings:
74.Bl -tag -width indent
75.It LOC
76The core location of this table entry.
77.It TYPE
78The type of object the file table entry points to.
79.It FLG
80Miscellaneous state variables encoded thus:
81.Pp
82.Bl -tag -width indent -compact
83.It R
84open for reading
85.It W
86open for writing
87.It A
88open for appending
89.It S
90shared lock present
91.It X
92exclusive lock present
93.It I
94signal pgrp when data ready
95.El
96.It CNT
97Number of processes that know this open file.
98.It MSG
99Number of messages outstanding for this file.
100.It DATA
101The location of the vnode table entry or socket structure for this file.
102.It OFFSET
103The file offset (see
104.Xr lseek 2 ) .
105.El
106.It Fl k
107Use 1K-byte blocks.
108.It Fl n
109Print devices by major/minor number rather than by name.
110.It Fl s
111Print information about swap space usage on all the
112swap areas compiled into the kernel.
113The first column is the device name of the partition.  The next column is
114the total space available in the partition.  The
115.Ar Used
116column indicates the total blocks used so far;  the
117.Ar Available
118column indicates how much space is remaining on each partition.
119The
120.Ar Capacity
121reports the percentage of space used.
122.Pp
123If more than one partition is configured into the system, totals for all
124of the statistics will be reported in the final line of the report.
125.It Fl t
126Print table for terminals
127with these headings:
128.Bl -tag -width indent
129.It LINE
130Physical device name.
131.It RAW
132Number of characters in raw input queue.
133.It CAN
134Number of characters in canonicalized input queue.
135.It OUT
136Number of characters in output queue.
137.It HWT
138High water mark for output.
139.It LWT
140Low water mark for output.
141.It COL
142Calculated column position of terminal.
143.It STATE
144Miscellaneous state variables encoded thus:
145.Pp
146.Bl -tag -width indent -compact
147.It T
148delay timeout in progress
149.\" .It W
150.\" waiting for open to complete
151.It O
152open
153.It F
154outq has been flushed during DMA
155.It C
156carrier is on
157.It B
158busy doing output
159.It A
160process is awaiting output
161.It X
162open for exclusive use
163.It S
164output stopped
165.It K
166further input blocked
167.It Y
168tty in async I/O mode
169.It D
170state for lowercase
171.Ql \e
172work
173.It E
174within a
175.Ql \e.../
176for PRTRUB
177.It L
178next character is literal
179.It P
180retyping suspended input
181.Pq PENDIN
182.It N
183counting tab width, ignore FLUSHO
184.It \&>
185tty used for dialout
186.El
187.It SESS
188Session for which this is controlling terminal.
189.It PGID
190Current foreground process group associated with this terminal.
191.It DISC
192Line discipline;
193.Ql term
194for
195TTYDISC (see
196.Xr termios 4 ) ,
197.Ql tab
198for TABLDISC (see
199.Xr tb 4 ) ,
200.Ql slip
201for SLIPDISC (see
202.Xr sl 4 ) ,
203.Ql ppp
204for PPPDISC (see
205.Xr ppp 4 ) ,
206.Ql strip
207for STRIPDISC (see
208.Xr strip 4 ) ,
209.Ql hdlc
210for HDLCDISC.
211.El
212.It Fl v
213Print the active vnodes.  Each group of vnodes corresponding
214to a particular filesystem is preceded by a two line header.  The
215first line consists of the following:
216.Pp
217.Df I
218.No *** MOUNT Em fstype from
219on
220.Em on fsflags
221.De
222.Pp
223where
224.Em fstype
225is one of
226.Em adosfs , afs , cd9660 , fdesc ,
227.Em ffs , ext2fs , kernfs , lfs , lofs ,
228.Em mfs , msdos , nfs , null ,
229.Em portal , procfs , umap , union ;
230.Em from
231is the filesystem mounted from;
232.Em on
233is the directory
234the filesystem is mounted on; and
235.Em fsflags
236is a list
237of optional flags applied to the mount (see
238.Xr mount 8 ) .
239The second line is a header for the individual fields ,
240the first part of which are fixed, and the second part are filesystem
241type specific.  The headers common to all vnodes are:
242.Bl -tag -width indent
243.It ADDR
244Location of this vnode.
245.It TYP
246File type.
247.It VFLAG
248A list of letters representing vnode flags:
249.Pp
250.Bl -tag -width indent -compact
251.It R
252VROOT root of its file system.
253.It T
254VTEXT pure text prototype.
255.It S
256VSYSTEM vnode being used by kernel.
257.It I
258VISTTY vnode is a tty.
259.It L
260VXLOCK locked to change underlying type.
261.It W
262VXWANT process is waiting for vnode.
263.It B
264VBWAIT waiting for output to complete.
265.It A
266VALIASED vnode has an alias.
267.It D
268VDIROP lfs vnode involved in directory op.
269.It Y
270VLAYER vnode is on layer filesystem.
271.It O
272VONWORKLST vnode is on syncer work-list.
273.El
274.Pp
275.It USE
276The number of references to this vnode.
277.It HOLD
278The number of I/O buffers held by this vnode.
279.It FILEID
280The vnode fileid.
281In the case of
282.Em ffs
283or
284.Em ext2fs
285this is the inode number.
286.It IFLAG
287Miscellaneous filesystem specific state variables encoded thus:
288.Bl -tag -width indent
289.It "For ffs, lfs or ext2fs:"
290.Bl -tag -width indent -compact
291.It A
292access time must be corrected
293.It C
294changed time must be corrected
295.It U
296update time
297.Pq Xr fs 5
298must be corrected
299.It M
300contains modifications
301.It a
302has been accessed
303.It R
304has a rename in progress
305.It S
306shared lock applied
307.It E
308exclusive lock applied
309.It c
310is being cleaned (LFS)
311.It a
312directory operation in progress (LFS)
313.El
314.It "For nfs:"
315.Bl -tag -width indent -compact
316.It W
317waiting for I/O buffer flush to complete
318.It P
319I/O buffers being flushed
320.It M
321locally modified data exists
322.It E
323an earlier write failed
324.It X
325non-cacheable lease (nqnfs)
326.It O
327write lease (nqnfs)
328.It G
329lease was evicted (nqnfs)
330.It A
331special file accessed
332.It U
333special file updated
334.It C
335special file times changed
336.El
337.El
338.It SIZ/RDEV
339Number of bytes in an ordinary file, or
340major and minor device of special file.
341.El
342.El
343.Sh ENVIRONMENT VARIABLES
344.Bl -tag -width BLOCKSIZE
345.It Ev BLOCKSIZE
346If the environment variable
347.Ev BLOCKSIZE
348is set, and the
349.Fl k
350option is not specified, the block counts will be displayed in units of that
351size block.
352.El
353.Sh FILES
354.Bl -tag -width /dev/kmemxxx -compact
355.It Pa /netbsd
356namelist
357.It Pa /dev/kmem
358default source of tables
359.El
360.Sh SEE ALSO
361.Xr ps 1 ,
362.Xr systat 1 ,
363.Xr vmstat 1 ,
364.Xr stat 2 ,
365.Xr fs 5 ,
366.Xr iostat 8
367.Rs
368.Rt Tn UNIX Rt Implementation ,
369.Ra K. Thompson
370.Re
371.Sh BUGS
372Swap statistics are reported for all swap partitions compiled into the kernel,
373regardless of whether those partitions are being used.
374.Pp
375Does not understand NFS swap servers.
376.Sh HISTORY
377The
378.Nm
379command appeared in
380.Bx 4.0 .
381