xref: /netbsd-src/usr.sbin/pstat/pstat.8 (revision 274254cdae52594c1aa480a736aef78313d15c9c)
1.\"	$NetBSD: pstat.8,v 1.37 2006/12/28 04:17:51 xtraeme 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 28, 2006
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.
67This option is useful for checking to see how large system tables
68become if the system is under heavy load.
69.It Fl f
70Print the open file table with these headings:
71.Bl -tag -width indent
72.It LOC
73The core location of this table entry.
74.It TYPE
75The type of object the file table entry points to.
76.It FLG
77Miscellaneous state variables encoded thus:
78.Pp
79.Bl -tag -width indent -compact
80.It R
81open for reading
82.It W
83open for writing
84.It A
85open for appending
86.It S
87shared lock present
88.It X
89exclusive lock present
90.It I
91signal pgrp when data ready
92.El
93.It CNT
94Number of processes that know this open file.
95.It MSG
96Number of messages outstanding for this file.
97.It DATA
98The location of the vnode table entry or socket structure for this file.
99.It USE
100Number of active users of this open file.
101.It IFLG
102Value of internal flags.
103.It OFFSET
104The file offset (see
105.Xr lseek 2 ) .
106.El
107.It Fl g
108The
109.Fl g
110option uses (1024 * 1024 * 1024) byte blocks instead of the default 512 byte.
111.It Fl h
112Use
113.Xr humanize_number 3
114to display (swap) sizes.
115.It Fl k
116Use 1K-byte blocks.
117.It Fl m
118The
119.Fl m
120option uses (1024 * 1024) byte blocks instead of the default 512 byte.
121.It Fl n
122Print devices by major/minor number rather than by name.
123.It Fl s
124Print information about swap space usage on all the
125swap areas compiled into the kernel.
126The first column is the device name of the partition.
127The next column is the total space available in the partition.
128The
129.Ar Used
130column indicates the total blocks used so far;  the
131.Ar Available
132column indicates how much space is remaining on each partition.
133The
134.Ar Capacity
135reports the percentage of space used.
136.Pp
137If more than one partition is configured into the system, totals for all
138of the statistics will be reported in the final line of the report.
139.It Fl t
140Print table for terminals
141with these headings:
142.Bl -tag -width indent
143.It LINE
144Physical device name.
145.It RAW
146Number of characters in raw input queue.
147.It CAN
148Number of characters in canonicalized input queue.
149.It OUT
150Number of characters in output queue.
151.It HWT
152High water mark for output.
153.It LWT
154Low water mark for output.
155.It COL
156Calculated column position of terminal.
157.It STATE
158Miscellaneous state variables encoded thus:
159.Pp
160.Bl -tag -width indent -compact
161.It T
162delay timeout in progress
163.\" .It W
164.\" waiting for open to complete
165.It O
166open
167.It F
168outq has been flushed during DMA
169.It C
170carrier is on
171.It B
172busy doing output
173.It A
174process is awaiting output
175.It X
176open for exclusive use
177.It S
178output stopped
179.It K
180further input blocked
181.It Y
182tty in async I/O mode
183.It D
184state for lowercase
185.Ql \e
186work
187.It E
188within a
189.Ql \e.../
190for PRTRUB
191.It L
192next character is literal
193.It P
194retyping suspended input
195.Pq PENDIN
196.It N
197counting tab width, ignore FLUSHO
198.It \&\*[Gt]
199tty used for dialout
200.El
201.It SESS
202Session for which this is controlling terminal.
203.It PGID
204Current foreground process group associated with this terminal.
205.It DISC
206Line discipline;
207.Ql term
208for
209TTYDISC (see
210.Xr termios 4 ) ,
211.Ql tab
212for TABLDISC (see
213.Xr tb 4 ) ,
214.Ql slip
215for SLIPDISC (see
216.Xr sl 4 ) ,
217.Ql ppp
218for PPPDISC (see
219.Xr ppp 4 ) ,
220.Ql strip
221for STRIPDISC (see
222.Xr strip 4 ) ,
223.Ql hdlc
224for HDLCDISC.
225.El
226.It Fl v
227Print the active vnodes.
228Each group of vnodes corresponding to a particular filesystem is preceded
229by a two line header.
230The first line consists of the following:
231.Pp
232.Df I
233.No *** MOUNT Em fstype from
234on
235.Em on fsflags
236.De
237.Pp
238where
239.Em fstype
240is one of
241.Em adosfs , afs , cd9660 , fdesc ,
242.Em ffs , ext2fs , kernfs , lfs , lofs ,
243.Em mfs , msdos , nfs , null ,
244.Em portal , procfs , umap , union ;
245.Em from
246is the filesystem mounted from;
247.Em on
248is the directory
249the filesystem is mounted on; and
250.Em fsflags
251is a list
252of optional flags applied to the mount (see
253.Xr mount 8 ) .
254The second line is a header for the individual fields,
255the first part of which are fixed, and the second part are filesystem
256type specific.
257The headers common to all vnodes are:
258.Bl -tag -width indent
259.It ADDR
260Location of this vnode.
261.It TYP
262File type.
263.It VFLAG
264A list of letters representing vnode flags:
265.Pp
266.Bl -tag -width indent -compact
267.It R
268VROOT root of its file system.
269.It T
270VTEXT pure text prototype.
271.It S
272VSYSTEM vnode being used by kernel.
273.It I
274VISTTY vnode is a tty.
275.It E
276VEXECMAP vnode has PROT_EXEC mappings.
277.It L
278VXLOCK locked to change underlying type.
279.It W
280VXWANT process is waiting for vnode.
281.It B
282VBWAIT waiting for output to complete.
283.It A
284VALIASED vnode has an alias.
285.It D
286VDIROP lfs vnode involved in directory op.
287.It Y
288VLAYER vnode is on layer filesystem.
289.It O
290VONWORKLST vnode is on syncer work-list.
291.El
292.Pp
293.It USE
294The number of references to this vnode.
295.It HOLD
296The number of I/O buffers held by this vnode.
297.It TAG
298The type of underlying data.
299.It NPAGE
300The number of pages in this vnode.
301.It FILEID
302The vnode fileid.
303In the case of
304.Em ffs
305or
306.Em ext2fs
307this is the inode number.
308.It IFLAG
309Miscellaneous filesystem specific state variables encoded thus:
310.Bl -tag -width indent
311.It "For ffs, lfs or ext2fs:"
312.Bl -tag -width indent -compact
313.It A
314access time must be corrected
315.It C
316changed time must be corrected
317.It U
318update time
319.Pq Xr fs 5
320must be corrected
321.It M
322contains modifications
323.It a
324has been accessed
325.It R
326has a rename in progress
327.It S
328shared lock applied
329.It E
330exclusive lock applied
331.It c
332is being cleaned (LFS)
333.It D
334directory operation in progress (LFS)
335.It s
336blocks to be freed in free count
337.El
338.It "For nfs:"
339.Bl -tag -width indent -compact
340.It W
341waiting for I/O buffer flush to complete
342.It P
343I/O buffers being flushed
344.It M
345locally modified data exists
346.It E
347an earlier write failed
348.It A
349special file accessed
350.It U
351special file updated
352.It C
353special file times changed
354.El
355.El
356.It SIZ/RDEV
357Number of bytes in an ordinary file, or
358major and minor device of special file.
359.El
360.El
361.Sh ENVIRONMENT
362.Bl -tag -width BLOCKSIZE
363.It Ev BLOCKSIZE
364If the environment variable
365.Ev BLOCKSIZE
366is set, and the
367.Fl k
368option is not specified, the block counts will be displayed in units of that
369size block.
370.El
371.Sh FILES
372.Bl -tag -width /dev/kmemxxx -compact
373.It Pa /netbsd
374namelist
375.It Pa /dev/kmem
376default source of tables
377.El
378.Sh SEE ALSO
379.Xr ps 1 ,
380.Xr systat 1 ,
381.Xr vmstat 1 ,
382.Xr stat 2 ,
383.Xr fs 5 ,
384.Xr iostat 8
385.Rs
386.Rt Tn UNIX Rt Implementation ,
387.Ra K. Thompson
388.Re
389.Sh HISTORY
390The
391.Nm
392command appeared in
393.Bx 4.0 .
394.Sh BUGS
395Swap statistics are reported for all swap partitions compiled into the kernel,
396regardless of whether those partitions are being used.
397.Pp
398Does not understand NFS swap servers.
399