xref: /freebsd/usr.sbin/pstat/pstat.8 (revision a1215e37a4a98f22c84d4512dd380761376e8231)
1.\" Copyright (c) 1980, 1991, 1993, 1994
2.\"	The Regents of the University of California.  All rights reserved.
3.\" Copyright (c) 2002 Networks Associates Technology, Inc.
4.\" All rights reserved.
5.\"
6.\" Portions of this software was developed for the FreeBSD Project by
7.\" ThinkSec AS and NAI Labs, the Security Research Division of Network
8.\" Associates, Inc.  under DARPA/SPAWAR contract N66001-01-C-8035
9.\" ("CBOSS"), as part of the DARPA CHATS research program.
10.\"
11.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions
13.\" are met:
14.\" 1. Redistributions of source code must retain the above copyright
15.\"    notice, this list of conditions and the following disclaimer.
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\"    notice, this list of conditions and the following disclaimer in the
18.\"    documentation and/or other materials provided with the distribution.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\"     @(#)pstat.8	8.5 (Berkeley) 5/13/94
36.\" $FreeBSD$
37.\"
38.Dd August 20, 2008
39.Dt PSTAT 8
40.Os
41.Sh NAME
42.Nm pstat ,
43.Nm swapinfo
44.Nd display system data structures
45.Sh SYNOPSIS
46.Nm
47.Op Fl Tfghkmnst
48.Op Fl M Ar core Op Fl N Ar system
49.Nm swapinfo
50.Op Fl ghkm
51.Op Fl M Ar core Op Fl N Ar system
52.Sh DESCRIPTION
53The
54.Nm
55utility displays open file entry, swap space utilization,
56terminal state, and vnode data structures.
57.Pp
58If invoked as
59.Nm swapinfo
60the
61.Fl s
62option is implied, and only the
63.Fl k , m , g ,
64and
65.Fl h
66options are legal.
67.Pp
68If the
69.Fl M
70option is not specified, information is obtained from
71the currently running kernel via the
72.Xr sysctl 3
73interface.
74Otherwise, information is read from the specified core file,
75using the name list from the specified kernel image (or from
76the default image).
77.Pp
78The following options are available:
79.Bl -tag -width indent
80.It Fl n
81Print devices out by major/minor instead of name.
82.It Fl h
83.Dq Human-readable
84output.
85Use unit suffixes when printing swap partition sizes:
86Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte.
87.It Fl k
88Print sizes in kilobytes, regardless of the setting of the
89.Ev BLOCKSIZE
90environment variable.
91.It Fl m
92Print sizes in megabytes, regardless of the setting of the
93.Ev BLOCKSIZE
94environment variable.
95.It Fl g
96Print sizes in gigabytes, regardless of the setting of the
97.Ev BLOCKSIZE
98environment variable.
99.It Fl T
100Print the number of used and free slots in several system tables.
101This is useful for checking to see how large system tables have become
102if the system is under heavy load.
103.It Fl f
104Print the open file table with these headings:
105.Bl -tag -width indent
106.It LOC
107The core location of this table entry.
108.It TYPE
109The type of object the file table entry points to.
110.It FLG
111Miscellaneous state variables encoded thus:
112.Pp
113.Bl -tag -width indent -compact
114.It R
115open for reading
116.It W
117open for writing
118.It A
119open for appending
120.It I
121signal pgrp when data ready
122.El
123.It CNT
124Number of processes that know this open file.
125.It MSG
126Number of messages outstanding for this file.
127.It DATA
128The location of the vnode table entry or socket structure for this file.
129.It OFFSET
130The file offset (see
131.Xr lseek 2 ) .
132.El
133.It Fl s
134Print information about swap space usage on all the
135swap areas compiled into the kernel.
136The first column is the device name of the partition.
137The next column is
138the total space available in the partition.
139The
140.Ar Used
141column indicates the total blocks used so far; the
142.Ar Available
143column indicates how much space is remaining on each partition.
144The
145.Ar Capacity
146reports the percentage of space used.
147.Pp
148If more than one partition is configured into the system, totals for all
149of the statistics will be reported in the final line of the report.
150.It Fl t
151Print table for terminals
152with these headings:
153.Bl -tag -width indent
154.It LINE
155Device name.
156.It INQ
157Number of characters that can be stored in the input queue.
158.It CAN
159Number of characters in the input queue which can be read.
160.It LIN
161Number of characters in the input queue which cannot be read yet.
162.It LOW
163Low water mark for input.
164.It OUTQ
165Number of characters that can be stored in the output queue.
166.It USE
167Number of bytes in the output queue.
168.It LOW
169Low water mark for output.
170.It COL
171Calculated column position of terminal.
172.It SESS
173Kernel address of the session structure.
174.It PGID
175Process group for which this is the controlling terminal.
176.It STATE
177Miscellaneous state variables encoded thus:
178.Pp
179.Bl -tag -width indent -compact
180.It I
181init/lock-state device nodes present
182.It C
183callout device nodes present
184.It O
185opened
186.It G
187gone
188.It B
189busy in
190.Xr open 2
191.It Y
192send SIGIO for input events
193.It L
194next character is literal
195.It H
196high watermark reached
197.It X
198open for exclusive use
199.It S
200output stopped (ixon flow control)
201.It l
202block mode input routine in use
203.It Z
204connection lost
205.It s
206i/o being snooped
207.El
208.Pp
209The
210.Ql i
211and
212.Ql o
213characters refer to the previous character, to differentiate between
214input and output.
215.El
216.It Fl M
217Extract values associated with the name list from the specified core.
218.It Fl N
219If
220.Fl M
221is also specified,
222extract the name list from the specified system instead of the default,
223which is the kernel image the system has booted from.
224.El
225.Sh SEE ALSO
226.Xr ps 1 ,
227.Xr systat 1 ,
228.Xr stat 2 ,
229.Xr fs 5 ,
230.Xr iostat 8 ,
231.Xr vmstat 8
232.Rs
233.%T UNIX Implementation
234.%A K. Thompson
235.Re
236.Sh HISTORY
237The
238.Nm
239utility appeared in
240.Bx 4.0 .
241.Sh BUGS
242Does not understand
243.Tn NFS
244swap servers.
245