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