xref: /freebsd/usr.sbin/pstat/pstat.8 (revision 0b46bb97a70bdad7178c2ab77335adb89a1926fd)
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.\" 3. All advertising materials mentioning features or use of this software
20.\"    must display the following acknowledgement:
21.\"	This product includes software developed by the University of
22.\"	California, Berkeley and its contributors.
23.\" 4. Neither the name of the University nor the names of its contributors
24.\"    may be used to endorse or promote products derived from this software
25.\"    without specific prior written permission.
26.\"
27.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37.\" SUCH DAMAGE.
38.\"
39.\"     @(#)pstat.8	8.5 (Berkeley) 5/13/94
40.\" $FreeBSD$
41.\"
42.Dd May 23, 2002
43.Dt PSTAT 8
44.Os
45.Sh NAME
46.Nm pstat ,
47.Nm swapinfo
48.Nd display system data structures
49.Sh SYNOPSIS
50.Nm
51.Op Fl Tfknst
52.Op Fl M Ar core
53.Op Fl N Ar system
54.Pp
55.Nm swapinfo
56.Op Fl k
57.Op Fl M Ar core
58.Op Fl N Ar system
59.Sh DESCRIPTION
60The
61.Nm
62utility displays open file entry, swap space utilization,
63terminal state, and vnode data structures.
64.Pp
65If invoked as
66.Nm swapinfo
67the
68.Fl s
69option is implied, and only the
70.Fl k
71option is legal.
72.Pp
73If neither the
74.Fl N
75nor the
76.Fl M
77option is specified, information is obtained from
78the currently running kernel via the
79.Xr sysctl 3
80interface.
81Otherwise, information is read from the specified core file,
82using the name list from the specified kernel image (or from
83the default image).
84.Pp
85The following options are available:
86.Bl -tag -width indent
87.It Fl n
88Print devices out by major/minor instead of name.
89.It Fl k
90Print sizes in kilobytes, regardless of the setting of the
91.Ev BLOCKSIZE
92environment variable.
93.It Fl T
94Print the number of used and free slots in several system tables.
95This is useful for checking to see how large system tables have become
96if the system is under heavy load.
97.It Fl f
98Print the open file table with these headings:
99.Bl -tag -width indent
100.It LOC
101The core location of this table entry.
102.It TYPE
103The type of object the file table entry points to.
104.It FLG
105Miscellaneous state variables encoded thus:
106.Pp
107.Bl -tag -width indent -compact
108.It R
109open for reading
110.It W
111open for writing
112.It A
113open for appending
114.It I
115signal pgrp when data ready
116.El
117.It CNT
118Number of processes that know this open file.
119.It MSG
120Number of messages outstanding for this file.
121.It DATA
122The location of the vnode table entry or socket structure for this file.
123.It OFFSET
124The file offset (see
125.Xr lseek 2 ) .
126.El
127.It Fl s
128Print information about swap space usage on all the
129swap areas compiled into the kernel.
130The first column is the device name of the partition.  The next column is
131the total space available in the partition.  The
132.Ar Used
133column indicates the total blocks used so far;  the
134.Ar Available
135column indicates how much space is remaining on each partition.
136The
137.Ar Capacity
138reports the percentage of space used.
139.Pp
140If more than one partition is configured into the system, totals for all
141of the statistics will be reported in the final line of the report.
142.It Fl t
143Print table for terminals
144with these headings:
145.Bl -tag -width indent
146.It RAW
147Number of characters in raw input queue.
148.It CAN
149Number of characters in canonicalized input queue.
150.It OUT
151Number of characters in output queue.
152.It MODE
153See
154.Xr tty 4 .
155.It ADDR
156Physical device address.
157.It DEL
158Number of delimiters (newlines) in canonicalized input queue.
159.It COL
160Calculated column position of terminal.
161.It STATE
162Miscellaneous state variables encoded thus:
163.Pp
164.Bl -tag -width indent -compact
165.It T
166delay timeout in progress
167.It W
168waiting for open to complete
169.It O
170open
171.It F
172outq has been flushed during DMA
173.It C
174carrier is on
175.It c
176connection open
177.It B
178busy doing output
179.It A
180process is waiting for space in output queue
181.It a
182process is waiting for output to complete
183.It X
184open for exclusive use
185.It S
186output stopped (ixon flow control)
187.It m
188output stopped (carrier flow control)
189.It o
190output stopped (CTS flow control)
191.It d
192output stopped (DSR flow control)
193.It K
194input stopped
195.It Y
196send SIGIO for input events
197.It D
198state for lowercase
199.Ql \e
200work
201.It E
202within a
203.Ql \e.../
204for PRTRUB
205.It L
206next character is literal
207.It P
208retyping suspended input (PENDIN)
209.It N
210counting tab width, ignore FLUSHO
211.It l
212block mode input routine in use
213.It s
214i/o being snooped
215.It Z
216connection lost
217.El
218.It SESS
219Kernel address of the session structure.
220.It PGID
221Process group for which this is controlling terminal.
222.It DISC
223Line discipline;
224.Ql term
225for
226TTYDISC
227or
228.Ql ntty
229for
230NTTYDISC
231or
232.Ql tab
233for
234TABLDISC
235or
236.Ql slip
237for
238SLIPDISC
239or
240.Ql ppp
241for
242PPPDISC.
243.El
244.It Fl M
245Extract values associated with the name list from the specified core.
246.It Fl N
247Extract the name list from the specified system instead of the default,
248which is the kernel image the system has booted from.
249.El
250.Sh SEE ALSO
251.Xr ps 1 ,
252.Xr systat 1 ,
253.Xr stat 2 ,
254.Xr fs 5 ,
255.Xr iostat 8 ,
256.Xr vmstat 8
257.Rs
258.%T UNIX Implementation
259.%A K. Thompson
260.Re
261.Sh BUGS
262Does not understand
263.Tn NFS
264swap servers.
265.Sh HISTORY
266The
267.Nm
268utility appeared in
269.Bx 4.0 .
270