1.\" $OpenBSD: pstat.8,v 1.50 2016/06/03 20:38:48 deraadt 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: June 3 2016 $ 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 M Ar core 43.Op Fl N Ar system 44.Op Fl d Ar format Ar symbol ... 45.Sh DESCRIPTION 46.Nm 47displays open file entry, swap space utilization, 48terminal state, and vnode data structure information. 49If 50.Ar core 51is given, the information is sought there, otherwise 52in the running kernel via 53.Pa /dev/kmem . 54The required namelist is taken from the running kernel unless 55.Ar system 56is specified. 57.Pp 58The options are as follows: 59.Bl -tag -width Ds 60.It Fl d Ar format Ar symbol ... 61Print the values of 62.Ar symbol 63using the specified format. 64.Ar format 65is a 66.Xr printf 3 Ns -style 67format, without the leading percent or precision specifiers, 68such as 69.Ar s , 70.Ar p , 71or 72.Ar llx . 73Symbol names are read from the remaining command line arguments. 74Addresses may also be specified in hex. 75.It Fl f 76Print the open file table with these headings: 77.Bl -tag -width indent 78.It LOC 79The core location of this table entry. 80.It TYPE 81The type of object the file table entry points to. 82.It FLG 83Miscellaneous state variables encoded thus: 84.Pp 85.Bl -tag -width indent -compact 86.It R 87open for reading 88.It W 89open for writing 90.It A 91open for appending 92.It L 93exclusive or shared lock present 94.It I 95signal pgrp when data ready 96.It l 97file descriptor slot is larval 98.El 99.It CNT 100Number of processes that know this open file. 101.It MSG 102Number of messages outstanding for this file. 103.It DATA 104The location of the vnode table entry or socket structure for this file. 105.It OFFSET 106The file offset (see 107.Xr lseek 2 ) . 108This information is only visible to the user or superuser. 109.El 110.It Fl k 111Use 1K-byte blocks. 112.It Fl M Ar core 113Extract values associated with the name list from the specified core 114instead of the running kernel. 115.It Fl N Ar system 116Extract the name list from the specified system 117instead of the running kernel. 118.It Fl n 119Print devices by major/minor number rather than by name. 120.It Fl s 121Print information about swap space usage on all the 122swap areas compiled into the kernel. 123The first column is the device name of the partition. 124The next column is the total space available in the partition. 125The 126.Ar Used 127column indicates the total blocks used so far; 128the 129.Ar Available 130column indicates how much space is remaining on each partition. 131The 132.Ar Capacity 133reports the percentage of space used. 134.Pp 135If more than one partition is configured into the system, totals for all 136of the statistics will be reported in the final line of the report. 137.It Fl T 138Prints the number of used and free slots for open files, used vnodes, and swap 139space. 140It is useful for checking to see how large system tables become 141if the system is under heavy load. 142.It Fl t 143Print table for terminals 144with these headings: 145.Bl -tag -width indent 146.It LINE 147Physical device name. 148.It RAW 149Number of characters in raw input queue. 150.It CAN 151Number of characters in canonicalized input queue. 152.It OUT 153Number of characters in output queue. 154.It HWT 155High water mark for output. 156.It LWT 157Low water mark for output. 158.It COL 159Calculated column position of terminal. 160.It STATE 161Miscellaneous state variables encoded thus: 162.Pp 163.Bl -tag -width indent -compact 164.It W 165waiting for open to complete 166.It O 167open 168.It C 169carrier is on 170.It T 171delay timeout in progress 172.It F 173outq has been flushed during DMA 174.It B 175busy doing output 176.It A 177process is awaiting output 178.It X 179open for exclusive use 180.It S 181output stopped 182.It K 183further input blocked 184.It Y 185tty in async I/O mode 186.It D 187next character is escaped lowercase special 188.It E 189printing erase sequence 190.It L 191next character is literal 192.It P 193retyping suspended input 194.It N 195counting tab width, ignoring output flush 196.El 197.It SESS 198Enclosing session. 199.It PGID 200Process group for which this is controlling terminal. 201.It DISC 202Line discipline: 203.Ql term 204for 205TTYDISC (see 206.Xr termios 4 ) , 207.Ql slip 208for SLIPDISC , 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.It USE 280The number of references to this vnode. 281.It HOLD 282The number of I/O buffers held by this vnode. 283.It FILEID 284The vnode fileid. 285In the case of 286.Em ffs 287this is the inode number. 288.It IFLAG 289Miscellaneous filesystem specific state variables encoded thus: 290.Bl -tag -width indent 291.It "For ffs:" 292.Bl -tag -width indent -compact 293.It A 294access time must be corrected 295.It C 296changed time must be corrected 297.It U 298modification time must be corrected 299.It R 300has a rename in progress 301.It M 302contains modifications 303.It m 304contains lazy modifications 305.It S 306shared lock applied 307.It E 308exclusive lock applied 309.El 310.It "For nfs:" 311.Bl -tag -width indent -compact 312.It W 313waiting for I/O buffer flush to complete 314.It P 315I/O buffers being flushed 316.It M 317locally modified data exists 318.It E 319an earlier write failed 320.It X 321non-cacheable lease (nqnfs) 322.It O 323write lease (nqnfs) 324.It G 325lease was evicted (nqnfs) 326.It A 327special file accessed 328.It U 329special file updated 330.It C 331special file times changed 332.El 333.El 334.It SIZ/RDEV 335Number of bytes in an ordinary file, or 336major and minor device of special file. 337.El 338.El 339.Sh ENVIRONMENT 340.Bl -tag -width BLOCKSIZE 341.It Ev BLOCKSIZE 342If the environment variable 343.Ev BLOCKSIZE 344is set, and the 345.Fl k 346option is not specified, the block counts will be displayed in units of that 347size block. 348.El 349.Sh SEE ALSO 350.Xr fstat 1 , 351.Xr netstat 1 , 352.Xr procmap 1 , 353.Xr ps 1 , 354.Xr systat 1 , 355.Xr tcpbench 1 , 356.Xr top 1 , 357.Xr stat 2 , 358.Xr printf 3 , 359.Xr fs 5 , 360.Xr iostat 8 , 361.Xr vmstat 8 362.Rs 363.%T UNIX Implementation 364.%A Ken Thompson 365.%J Bell System Technical Journal 366.%V Volume 57 367.%N Number 6 368.%D 1978 369.%P 1931\(en1946 370.Re 371.Sh HISTORY 372The 373.Nm 374command appeared in 375.Bx 4.0 . 376.Sh BUGS 377Swap statistics are reported for all swap partitions compiled into the kernel, 378regardless of whether those partitions are being used. 379.Pp 380Does not understand NFS swap servers. 381