xref: /freebsd/usr.sbin/pstat/pstat.8 (revision 7e8409a7a97e9064b922827a6197085fc6b839a5)
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 March 21, 2005
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 Tfhknst
48.Op Fl M Ar core Op Fl N Ar system
49.Nm swapinfo
50.Op Fl hk
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 [kmg]
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 RAW
157Number of characters in raw input queue.
158.It CAN
159Number of characters in canonicalized input queue.
160.It OUT
161Number of characters in output queue.
162.It IHIWT
163High water mark for input.
164.It ILOWT
165Low water mark for input.
166.It OHWT
167High water mark for output.
168.It LWT
169Low water mark for output.
170.It COL
171Calculated column position of terminal.
172.It STATE
173Miscellaneous state variables encoded thus:
174.Pp
175.Bl -tag -width indent -compact
176.It T
177delay timeout in progress
178.It W
179waiting for open to complete
180.It O
181open
182.It F
183outq has been flushed during DMA
184.It C
185carrier is on
186.It c
187connection open
188.It B
189busy doing output
190.It A
191process is waiting for space in output queue
192.It a
193process is waiting for output to complete
194.It X
195open for exclusive use
196.It S
197output stopped (ixon flow control)
198.It m
199output stopped (carrier flow control)
200.It o
201output stopped (CTS flow control)
202.It d
203output stopped (DSR flow control)
204.It K
205input stopped
206.It Y
207send SIGIO for input events
208.It D
209state for lowercase
210.Ql \e
211work
212.It E
213within a
214.Ql \e.../
215for PRTRUB
216.It L
217next character is literal
218.It P
219retyping suspended input (PENDIN)
220.It N
221counting tab width, ignore FLUSHO
222.It l
223block mode input routine in use
224.It s
225i/o being snooped
226.It Z
227connection lost
228.El
229.It SESS
230Kernel address of the session structure.
231.It PGID
232Process group for which this is the controlling terminal.
233.It DISC
234Line discipline;
235.Ql term
236for
237TTYDISC
238or
239.Ql ntty
240for
241NTTYDISC
242or
243.Ql slip
244for
245SLIPDISC
246or
247.Ql ppp
248for
249PPPDISC.
250.El
251.It Fl M
252Extract values associated with the name list from the specified core.
253.It Fl N
254If
255.Fl M
256is also specified,
257extract the name list from the specified system instead of the default,
258which is the kernel image the system has booted from.
259.El
260.Sh SEE ALSO
261.Xr ps 1 ,
262.Xr systat 1 ,
263.Xr stat 2 ,
264.Xr fs 5 ,
265.Xr iostat 8 ,
266.Xr vmstat 8
267.Rs
268.%T UNIX Implementation
269.%A K. Thompson
270.Re
271.Sh HISTORY
272The
273.Nm
274utility appeared in
275.Bx 4.0 .
276.Sh BUGS
277Does not understand
278.Tn NFS
279swap servers.
280