xref: /freebsd/usr.sbin/pstat/pstat.8 (revision 2e3f49888ec8851bafb22011533217487764fdb0)
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. 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.Dd July 8, 2022
36.Dt PSTAT 8
37.Os
38.Sh NAME
39.Nm pstat ,
40.Nm swapinfo
41.Nd display system data structures
42.Sh SYNOPSIS
43.Nm
44.Op Fl Tfghkmnst
45.Op Fl M Ar core Op Fl N Ar system
46.Nm swapinfo
47.Op Fl ghkm
48.Op Fl M Ar core Op Fl N Ar system
49.Sh DESCRIPTION
50The
51.Nm
52utility displays open file entry, swap space utilization,
53terminal state, and vnode data structures.
54.Pp
55If invoked as
56.Nm swapinfo
57the
58.Fl s
59option is implied, and only the
60.Fl k , m , g ,
61and
62.Fl h
63options are legal.
64.Pp
65If the
66.Fl M
67option is not specified, information is obtained from
68the currently running kernel via the
69.Xr sysctl 3
70interface.
71Otherwise, information is read from the specified core file,
72using the name list from the specified kernel image (or from
73the default image).
74.Pp
75The following options are available:
76.Bl -tag -width indent
77.It Fl n
78Print devices out by major/minor instead of name.
79.It Fl h
80.Dq Human-readable
81output.
82Use unit suffixes when printing swap partition sizes:
83Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte.
84.It Fl k
85Print sizes in kilobytes, regardless of the setting of the
86.Ev BLOCKSIZE
87environment variable.
88.It Fl m
89Print sizes in megabytes, regardless of the setting of the
90.Ev BLOCKSIZE
91environment variable.
92.It Fl g
93Print sizes in gigabytes, regardless of the setting of the
94.Ev BLOCKSIZE
95environment variable.
96.It Fl T
97Print the number of used and free slots in several system tables.
98This is useful for checking to see how large system tables have become
99if the system is under heavy load.
100.It Fl f
101Print the open file table with these headings:
102.Bl -tag -width indent
103.It LOC
104The core location of this table entry.
105.It TYPE
106The type of object the file table entry points to.
107.It FLG
108Miscellaneous state variables encoded thus:
109.Pp
110.Bl -tag -width indent -compact
111.It R
112open for reading
113.It W
114open for writing
115.It A
116open for appending
117.It I
118signal pgrp when data ready
119.El
120.It CNT
121Number of processes that know this open file.
122.It MSG
123Number of messages outstanding for this file.
124.It DATA
125The location of the vnode table entry or socket structure for this file.
126.It OFFSET
127The file offset (see
128.Xr lseek 2 ) .
129.El
130.It Fl s
131Print information about swap space usage on all the
132swap areas compiled into the kernel.
133The first column is the device name of the partition.
134The next column is
135the total space available in the partition.
136The
137.Ar Used
138column indicates the total blocks used so far; the
139.Ar Available
140column indicates how much space is remaining on each partition.
141The
142.Ar Capacity
143reports the percentage of space used.
144.Pp
145If more than one partition is configured into the system, totals for all
146of the statistics will be reported in the final line of the report.
147.It Fl t
148Print table for terminals
149with these headings:
150.Bl -tag -width indent
151.It LINE
152Device name.
153.It INQ
154Number of characters that can be stored in the input queue.
155.It CAN
156Number of characters in the input queue which can be read.
157.It LIN
158Number of characters in the input queue which cannot be read yet.
159.It LOW
160Low water mark for input.
161.It OUTQ
162Number of characters that can be stored in the output queue.
163.It USE
164Number of bytes in the output queue.
165.It LOW
166Low water mark for output.
167.It COL
168Calculated column position of terminal.
169.It SESS
170Process ID of the session leader.
171.It PGID
172Process group for which this is the controlling terminal.
173.It STATE
174Miscellaneous state variables encoded thus:
175.Pp
176.Bl -tag -width indent -compact
177.It I
178init/lock-state device nodes present
179.It C
180callout device nodes present
181.It O
182opened
183.It c
184console in use
185.It G
186gone
187.It B
188busy in
189.Xr open 2
190.It Y
191send SIGIO for input events
192.It L
193next character is literal
194.It H
195high watermark reached
196.It X
197open for exclusive use
198.It S
199output stopped (ixon flow control)
200.It l
201block mode input routine in use
202.It Z
203connection lost
204.It s
205i/o being snooped
206.It b
207busy in
208.Xr read 2
209or
210.Xr write 2
211.El
212.Pp
213The
214.Ql i
215and
216.Ql o
217characters refer to the previous character, to differentiate between
218input and output.
219.El
220.It Fl M
221Extract values associated with the name list from the specified core.
222.It Fl N
223If
224.Fl M
225is also specified,
226extract the name list from the specified system instead of the default,
227which is the kernel image the system has booted from.
228.El
229.Sh ENVIRONMENT
230.Bl -tag -width BLOCKSIZE
231.It Ev BLOCKSIZE
232If the environment variable
233.Ev BLOCKSIZE
234is set, and the
235.Fl h , k ,
236or
237.Fl m
238options are not specified, the block counts will be displayed in units of
239that block size.
240If
241.Ev BLOCKSIZE
242is not set, and the
243.Fl h , k ,
244or
245.Fl m
246options are not specified, the block counts will be displayed in 512-byte
247blocks.
248.El
249.Sh SEE ALSO
250.Xr ps 1 ,
251.Xr systat 1 ,
252.Xr stat 2 ,
253.Xr fs 5 ,
254.Xr iostat 8 ,
255.Xr vmstat 8
256.Rs
257.%T UNIX Implementation
258.%A K. Thompson
259.Re
260.Sh HISTORY
261The
262.Nm
263utility appeared in
264.Bx 4.0 .
265.Sh BUGS
266Does not understand
267.Tn NFS
268swap servers.
269