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 October 11, 2014 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 Tfghkmnst 48.Op Fl M Ar core Op Fl N Ar system 49.Nm swapinfo 50.Op Fl ghkm 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 k , m , g , 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 INQ 157Number of characters that can be stored in the input queue. 158.It CAN 159Number of characters in the input queue which can be read. 160.It LIN 161Number of characters in the input queue which cannot be read yet. 162.It LOW 163Low water mark for input. 164.It OUTQ 165Number of characters that can be stored in the output queue. 166.It USE 167Number of bytes in the output queue. 168.It LOW 169Low water mark for output. 170.It COL 171Calculated column position of terminal. 172.It SESS 173Process ID of the session leader. 174.It PGID 175Process group for which this is the controlling terminal. 176.It STATE 177Miscellaneous state variables encoded thus: 178.Pp 179.Bl -tag -width indent -compact 180.It I 181init/lock-state device nodes present 182.It C 183callout device nodes present 184.It O 185opened 186.It c 187console in use 188.It G 189gone 190.It B 191busy in 192.Xr open 2 193.It Y 194send SIGIO for input events 195.It L 196next character is literal 197.It H 198high watermark reached 199.It X 200open for exclusive use 201.It S 202output stopped (ixon flow control) 203.It l 204block mode input routine in use 205.It Z 206connection lost 207.It s 208i/o being snooped 209.It b 210busy in 211.Xr read 2 212or 213.Xr write 2 214.El 215.Pp 216The 217.Ql i 218and 219.Ql o 220characters refer to the previous character, to differentiate between 221input and output. 222.El 223.It Fl M 224Extract values associated with the name list from the specified core. 225.It Fl N 226If 227.Fl M 228is also specified, 229extract the name list from the specified system instead of the default, 230which is the kernel image the system has booted from. 231.El 232.Sh SEE ALSO 233.Xr ps 1 , 234.Xr systat 1 , 235.Xr stat 2 , 236.Xr fs 5 , 237.Xr iostat 8 , 238.Xr vmstat 8 239.Rs 240.%T UNIX Implementation 241.%A K. Thompson 242.Re 243.Sh HISTORY 244The 245.Nm 246utility appeared in 247.Bx 4.0 . 248.Sh BUGS 249Does not understand 250.Tn NFS 251swap servers. 252