1.\" $OpenBSD: pstat.8,v 1.43 2010/09/19 21:59:23 jmc 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: September 19 2010 $ 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.El 98.It CNT 99Number of processes that know this open file. 100.It MSG 101Number of messages outstanding for this file. 102.It DATA 103The location of the vnode table entry or socket structure for this file. 104.It OFFSET 105The file offset (see 106.Xr lseek 2 ) . 107This information is only visible to the user or superuser. 108.El 109.It Fl k 110Use 1K-byte blocks. 111.It Fl M Ar core 112Extract values associated with the name list from the specified core 113instead of the running kernel. 114.It Fl N Ar system 115Extract the name list from the specified system 116instead of the running kernel. 117.It Fl n 118Print devices by major/minor number rather than by name. 119.It Fl s 120Print information about swap space usage on all the 121swap areas compiled into the kernel. 122The first column is the device name of the partition. 123The next column is the total space available in the partition. 124The 125.Ar Used 126column indicates the total blocks used so far; 127the 128.Ar Available 129column indicates how much space is remaining on each partition. 130The 131.Ar Capacity 132reports the percentage of space used. 133.Pp 134If more than one partition is configured into the system, totals for all 135of the statistics will be reported in the final line of the report. 136.It Fl T 137Prints the number of used and free slots for open files, used vnodes, and swap 138space. 139It is useful for checking to see how large system tables become 140if the system is under heavy load. 141.It Fl t 142Print table for terminals 143with these headings: 144.Bl -tag -width indent 145.It LINE 146Physical device name. 147.It RAW 148Number of characters in raw input queue. 149.It CAN 150Number of characters in canonicalized input queue. 151.It OUT 152Number of characters in output queue. 153.It HWT 154High water mark for output. 155.It LWT 156Low water mark for output. 157.It COL 158Calculated column position of terminal. 159.It STATE 160Miscellaneous state variables encoded thus: 161.Pp 162.Bl -tag -width indent -compact 163.It W 164waiting for open to complete 165.It O 166open 167.It C 168carrier is on 169.It T 170delay timeout in progress 171.It F 172outq has been flushed during DMA 173.It B 174busy doing output 175.It A 176process is awaiting output 177.It X 178open for exclusive use 179.It S 180output stopped 181.It K 182further input blocked 183.It Y 184tty in async I/O mode 185.It D 186next character is escaped lowercase special 187.It E 188printing erase sequence 189.It L 190next character is literal 191.It P 192retyping suspended input 193.It N 194counting tab width, ignoring output flush 195.El 196.It SESS 197Enclosing session. 198.It PGID 199Process group for which this is controlling terminal. 200.It DISC 201Line discipline: 202.Ql term 203for 204TTYDISC (see 205.Xr termios 4 ) , 206.Ql slip 207for SLIPDISC (see 208.Xr sl 4 ) , 209.Ql ppp 210for PPPDISC (see 211.Xr ppp 4 ) , 212.Ql strip 213for STRIPDISC, 214.\" (see 215.\" .Xr strip 4 ) . 216and 217.Ql nmea 218for NMEADISC (see 219.Xr nmea 4 ) . 220.El 221.It Fl v 222Print the active vnodes. 223Each group of vnodes corresponding 224to a particular filesystem is preceded by a two line header. 225The first line consists of the following: 226.Pp 227.No *** MOUNT Em fstype from 228on 229.Em on fsflags 230.Pp 231where 232.Em fstype 233is one of the file systems supported by the kernel; 234.Em from 235is the partition the filesystem is mounted from; 236.Em on 237is the directory 238the filesystem is mounted on; and 239.Em fsflags 240is a list 241of optional flags applied to the mount (see 242.Xr mount 8 ) . 243The second line is a header for the individual fields, 244the first part of which are fixed, and the second part are filesystem 245type specific. 246The headers common to all vnodes are: 247.Bl -tag -width indent 248.It ADDR 249Location of this vnode. 250.It TYP 251File type. 252.It VFLAG 253A list of letters representing vnode flags: 254.Pp 255.Bl -tag -width indent -compact 256.It R 257VROOT root of its file system. 258.It T 259VTEXT pure text prototype. 260.It S 261VSYSTEM vnode being used by kernel. 262.It I 263VISTTY vnode represents a tty. 264.It L 265VXLOCK locked to change underlying type. 266.It W 267VXWANT process is waiting for vnode. 268.It B 269VBWAIT waiting for output to complete. 270.It A 271VALIASED vnode has an alias. 272.It F 273VONFREELIST vnode is on a free list. 274.It l 275VLOCKSWORK FS supports locking discipline. 276.It s 277VONSYNCLIST vnode is on syncer worklist. 278.El 279.Pp 280.It USE 281The number of references to this vnode. 282.It HOLD 283The number of I/O buffers held by this vnode. 284.It FILEID 285The vnode fileid. 286In the case of 287.Em ffs 288this is the inode number. 289.It IFLAG 290Miscellaneous filesystem specific state variables encoded thus: 291.Bl -tag -width indent 292.It "For ffs:" 293.Bl -tag -width indent -compact 294.It A 295access time must be corrected 296.It C 297changed time must be corrected 298.It U 299update time 300.Pq Xr fs 5 301must be corrected 302.It R 303has a rename in progress 304.It M 305contains modifications 306.It S 307shared lock applied 308.It E 309exclusive lock applied 310.El 311.It "For nfs:" 312.Bl -tag -width indent -compact 313.It W 314waiting for I/O buffer flush to complete 315.It P 316I/O buffers being flushed 317.It M 318locally modified data exists 319.It E 320an earlier write failed 321.It X 322non-cacheable lease (nqnfs) 323.It O 324write lease (nqnfs) 325.It G 326lease was evicted (nqnfs) 327.It A 328special file accessed 329.It U 330special file updated 331.It C 332special file times changed 333.El 334.El 335.It SIZ/RDEV 336Number of bytes in an ordinary file, or 337major and minor device of special file. 338.El 339.El 340.Sh ENVIRONMENT 341.Bl -tag -width BLOCKSIZE 342.It Ev BLOCKSIZE 343If the environment variable 344.Ev BLOCKSIZE 345is set, and the 346.Fl k 347option is not specified, the block counts will be displayed in units of that 348size block. 349.El 350.Sh SEE ALSO 351.Xr fstat 1 , 352.Xr netstat 1 , 353.Xr procmap 1 , 354.Xr ps 1 , 355.Xr systat 1 , 356.Xr tcpbench 1 , 357.Xr top 1 , 358.Xr stat 2 , 359.Xr printf 3 , 360.Xr fs 5 , 361.Xr iostat 8 , 362.Xr vmstat 8 363.Rs 364.%T UNIX Implementation 365.%A K. Thompson 366.Re 367.Sh HISTORY 368The 369.Nm 370command appeared in 371.Bx 4.0 . 372.Sh BUGS 373Swap statistics are reported for all swap partitions compiled into the kernel, 374regardless of whether those partitions are being used. 375.Pp 376Does not understand NFS swap servers. 377