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