1.\" $OpenBSD: pstat.8,v 1.47 2014/03/19 04:17:33 guenther Exp $ 2.\" $NetBSD: pstat.8,v 1.9.4.1 1996/06/02 09:08:17 mrg Exp $ 3.\" 4.\" Copyright (c) 1980, 1991, 1993, 1994 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" from: @(#)pstat.8 8.4 (Berkeley) 4/19/94 32.\" 33.Dd $Mdocdate: March 19 2014 $ 34.Dt PSTAT 8 35.Os 36.Sh NAME 37.Nm pstat 38.Nd display system data structures 39.Sh SYNOPSIS 40.Nm pstat 41.Op Fl fknsTtv 42.Op Fl d Ar format 43.Op Fl M Ar core 44.Op Fl N Ar system 45.Op Ar symbols 46.Sh DESCRIPTION 47.Nm 48displays open file entry, swap space utilization, 49terminal state, and vnode data structure information. 50If 51.Ar core 52is given, the information is sought there, otherwise 53in the running kernel via 54.Pa /dev/kmem . 55The required namelist is taken from the running kernel unless 56.Ar system 57is specified. 58.Pp 59The options are as follows: 60.Bl -tag -width Ds 61.It Fl d Ar format 62Print the values of 63.Ar symbols 64using the specified format. 65.Ar format 66is a 67.Xr printf 3 Ns -style 68format, without the leading percent or precision specifiers, 69such as 70.Ar s , 71.Ar p , 72or 73.Ar llx . 74Symbol names are read from the remaining command line arguments. 75Addresses may also be specified in hex. 76.It Fl f 77Print the open file table with these headings: 78.Bl -tag -width indent 79.It LOC 80The core location of this table entry. 81.It TYPE 82The type of object the file table entry points to. 83.It FLG 84Miscellaneous state variables encoded thus: 85.Pp 86.Bl -tag -width indent -compact 87.It R 88open for reading 89.It W 90open for writing 91.It A 92open for appending 93.It L 94exclusive or shared lock present 95.It I 96signal pgrp when data ready 97.It d 98deferred for next AF_UNIX garbage collection pass 99.It l 100file descriptor slot is larval 101.It m 102marked during AF_UNIX garbage collection pass 103.El 104.It CNT 105Number of processes that know this open file. 106.It MSG 107Number of messages outstanding for this file. 108.It DATA 109The location of the vnode table entry or socket structure for this file. 110.It OFFSET 111The file offset (see 112.Xr lseek 2 ) . 113This information is only visible to the user or superuser. 114.El 115.It Fl k 116Use 1K-byte blocks. 117.It Fl M Ar core 118Extract values associated with the name list from the specified core 119instead of the running kernel. 120.It Fl N Ar system 121Extract the name list from the specified system 122instead of the running kernel. 123.It Fl n 124Print devices by major/minor number rather than by name. 125.It Fl s 126Print information about swap space usage on all the 127swap areas compiled into the kernel. 128The first column is the device name of the partition. 129The next column is the total space available in the partition. 130The 131.Ar Used 132column indicates the total blocks used so far; 133the 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 143Prints the number of used and free slots for open files, used vnodes, and swap 144space. 145It is useful for checking to see how large system tables become 146if the system is under heavy load. 147.It Fl t 148Print table for terminals 149with these headings: 150.Bl -tag -width indent 151.It LINE 152Physical device name. 153.It RAW 154Number of characters in raw input queue. 155.It CAN 156Number of characters in canonicalized input queue. 157.It OUT 158Number of characters in output queue. 159.It HWT 160High water mark for output. 161.It LWT 162Low water mark for output. 163.It COL 164Calculated column position of terminal. 165.It STATE 166Miscellaneous state variables encoded thus: 167.Pp 168.Bl -tag -width indent -compact 169.It W 170waiting for open to complete 171.It O 172open 173.It C 174carrier is on 175.It T 176delay timeout in progress 177.It F 178outq has been flushed during DMA 179.It B 180busy doing output 181.It A 182process is awaiting output 183.It X 184open for exclusive use 185.It S 186output stopped 187.It K 188further input blocked 189.It Y 190tty in async I/O mode 191.It D 192next character is escaped lowercase special 193.It E 194printing erase sequence 195.It L 196next character is literal 197.It P 198retyping suspended input 199.It N 200counting tab width, ignoring output flush 201.El 202.It SESS 203Enclosing session. 204.It PGID 205Process group for which this is controlling terminal. 206.It DISC 207Line discipline: 208.Ql term 209for 210TTYDISC (see 211.Xr termios 4 ) , 212.Ql slip 213for SLIPDISC (see 214.Xr sl 4 ) , 215.Ql ppp 216for PPPDISC (see 217.Xr ppp 4 ) , 218.Ql strip 219for STRIPDISC, 220.\" (see 221.\" .Xr strip 4 ) . 222and 223.Ql nmea 224for NMEADISC (see 225.Xr nmea 4 ) . 226.El 227.It Fl v 228Print the active vnodes. 229Each group of vnodes corresponding 230to a particular filesystem is preceded by a two line header. 231The first line consists of the following: 232.Pp 233.No *** MOUNT Em fstype from 234on 235.Em on fsflags 236.Pp 237where 238.Em fstype 239is one of the file systems supported by the kernel; 240.Em from 241is the partition the filesystem is mounted from; 242.Em on 243is the directory 244the filesystem is mounted on; and 245.Em fsflags 246is a list 247of optional flags applied to the mount (see 248.Xr mount 8 ) . 249The second line is a header for the individual fields, 250the first part of which are fixed, and the second part are filesystem 251type specific. 252The headers common to all vnodes are: 253.Bl -tag -width indent 254.It ADDR 255Location of this vnode. 256.It TYP 257File type. 258.It VFLAG 259A list of letters representing vnode flags: 260.Pp 261.Bl -tag -width indent -compact 262.It R 263VROOT root of its file system. 264.It T 265VTEXT pure text prototype. 266.It S 267VSYSTEM vnode being used by kernel. 268.It I 269VISTTY vnode represents a tty. 270.It L 271VXLOCK locked to change underlying type. 272.It W 273VXWANT process is waiting for vnode. 274.It B 275VBWAIT waiting for output to complete. 276.It A 277VALIASED vnode has an alias. 278.It F 279VONFREELIST vnode is on a free list. 280.It l 281VLOCKSWORK FS supports locking discipline. 282.It s 283VONSYNCLIST vnode is on syncer worklist. 284.El 285.It USE 286The number of references to this vnode. 287.It HOLD 288The number of I/O buffers held by this vnode. 289.It FILEID 290The vnode fileid. 291In the case of 292.Em ffs 293this is the inode number. 294.It IFLAG 295Miscellaneous filesystem specific state variables encoded thus: 296.Bl -tag -width indent 297.It "For ffs:" 298.Bl -tag -width indent -compact 299.It A 300access time must be corrected 301.It C 302changed time must be corrected 303.It U 304modification time must be corrected 305.It R 306has a rename in progress 307.It M 308contains modifications 309.It m 310contains lazy modifications 311.It S 312shared lock applied 313.It E 314exclusive lock applied 315.El 316.It "For nfs:" 317.Bl -tag -width indent -compact 318.It W 319waiting for I/O buffer flush to complete 320.It P 321I/O buffers being flushed 322.It M 323locally modified data exists 324.It E 325an earlier write failed 326.It X 327non-cacheable lease (nqnfs) 328.It O 329write lease (nqnfs) 330.It G 331lease was evicted (nqnfs) 332.It A 333special file accessed 334.It U 335special file updated 336.It C 337special file times changed 338.El 339.El 340.It SIZ/RDEV 341Number of bytes in an ordinary file, or 342major and minor device of special file. 343.El 344.El 345.Sh ENVIRONMENT 346.Bl -tag -width BLOCKSIZE 347.It Ev BLOCKSIZE 348If the environment variable 349.Ev BLOCKSIZE 350is set, and the 351.Fl k 352option is not specified, the block counts will be displayed in units of that 353size block. 354.El 355.Sh SEE ALSO 356.Xr fstat 1 , 357.Xr netstat 1 , 358.Xr procmap 1 , 359.Xr ps 1 , 360.Xr systat 1 , 361.Xr tcpbench 1 , 362.Xr top 1 , 363.Xr stat 2 , 364.Xr printf 3 , 365.Xr fs 5 , 366.Xr iostat 8 , 367.Xr vmstat 8 368.Rs 369.%T UNIX Implementation 370.%A Ken Thompson 371.%J Bell System Technical Journal 372.%V Volume 57 373.%N Number 6 374.%D 1978 375.%P 1931\(en1946 376.Re 377.Sh HISTORY 378The 379.Nm 380command appeared in 381.Bx 4.0 . 382.Sh BUGS 383Swap statistics are reported for all swap partitions compiled into the kernel, 384regardless of whether those partitions are being used. 385.Pp 386Does not understand NFS swap servers. 387