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