1.\" $OpenBSD: pstat.8,v 1.18 2001/11/09 00:56:24 miod 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. All advertising materials mentioning features or use of this software 16.\" must display the following acknowledgement: 17.\" This product includes software developed by the University of 18.\" California, Berkeley and its contributors. 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.\" from: @(#)pstat.8 8.4 (Berkeley) 4/19/94 36.\" 37.Dd April 19, 1994 38.Dt PSTAT 8 39.Os 40.Sh NAME 41.Nm pstat 42.Nd display system data structures 43.Sh SYNOPSIS 44.Nm pstat 45.Op Fl Tfknstv 46.Op Fl M Ar core 47.Op Fl N Ar system 48.Sh DESCRIPTION 49.Nm 50displays open file entry, swap space utilization, 51terminal state, and vnode data structure information. 52If 53.Ar corefile 54is given, the information is sought there, otherwise 55in the running kernel via 56.Pa /dev/kmem . 57The required namelist is taken from the running kernel unless 58.Ar system 59is specified. 60.Pp 61The options are as follows: 62.Bl -tag -width Ds 63.It Fl T 64Prints the number of used and free slots for open files, used vnodes, and swap 65space. 66It is useful for checking to see how large system tables become 67if the system is under heavy load. 68.It Fl f 69Print the open file table with these headings: 70.Bl -tag -width indent 71.It LOC 72The core location of this table entry. 73.It TYPE 74The type of object the file table entry points to. 75.It FLG 76Miscellaneous state variables encoded thus: 77.Pp 78.Bl -tag -width indent -compact 79.It R 80open for reading 81.It W 82open for writing 83.It A 84open for appending 85.It S 86shared lock present 87.It X 88exclusive lock present 89.It I 90signal pgrp when data ready 91.El 92.It CNT 93Number of processes that know this open file. 94.It MSG 95Number of messages outstanding for this file. 96.It DATA 97The location of the vnode table entry or socket structure for this file. 98.It OFFSET 99The file offset (see 100.Xr lseek 2 ) . 101.El 102.It Fl k 103Use 1K-byte blocks. 104.It Fl n 105Print devices by major/minor number rather than by name. 106.It Fl s 107Print information about swap space usage on all the 108swap areas compiled into the kernel. 109The first column is the device name of the partition. 110The next column is the total space available in the partition. 111The 112.Ar Used 113column indicates the total blocks used so far; 114the 115.Ar Available 116column indicates how much space is remaining on each partition. 117The 118.Ar Capacity 119reports the percentage of space used. 120.Pp 121If more than one partition is configured into the system, totals for all 122of the statistics will be reported in the final line of the report. 123.It Fl t 124Print table for terminals 125with these headings: 126.Bl -tag -width indent 127.It LINE 128Physical device name. 129.It RAW 130Number of characters in raw input queue. 131.It CAN 132Number of characters in canonicalized input queue. 133.It OUT 134Number of characters in output queue. 135.It HWT 136High water mark for output. 137.It LWT 138Low water mark for output. 139.It COL 140Calculated column position of terminal. 141.It STATE 142Miscellaneous state variables encoded thus: 143.Pp 144.Bl -tag -width indent -compact 145.It W 146waiting for open to complete 147.It O 148open 149.It C 150carrier is on 151.It T 152delay timeout in progress 153.It F 154outq has been flushed during DMA 155.It B 156busy doing output 157.It A 158process is awaiting output 159.It X 160open for exclusive use 161.It S 162output stopped 163.It K 164further input blocked 165.It Y 166tty in async I/O mode 167.It D 168next character is escaped lowercase special 169.It E 170printing erase sequence 171.It L 172next character is literal 173.It P 174retyping suspended input 175.It N 176counting tab width, ignoring output flush 177.El 178.It SESS 179Enclosing session. 180.El 181.It PGRP 182Process group for which this is controlling terminal. 183.It DISC 184Line discipline; 185.Ql term 186for 187TTYDISC (see 188.Xr termios 4 ) , 189.Ql tab 190for TABLDISC (see 191.Xr tb 4 ) , 192.Ql slip 193for SLIPDISC (see 194.Xr sl 4 ) , 195.Ql ppp 196for PPPDISC (see 197.Xr ppp 4 ) , 198.Ql strip 199for STRIPDISC (see 200.Xr strip 4 ) . 201.It Fl v 202Print the active vnodes. 203Each group of vnodes corresponding 204to a particular filesystem is preceded by a two line header. 205The first line consists of the following: 206.Pp 207.Df I 208.No *** MOUNT Em fstype from 209on 210.Em on fsflags 211.De 212.Pp 213where 214.Em fstype 215is one of 216.Em adosfs , afs , cd9660 , ext2fs , 217.Em fdesc , ffs, kernfs , lfs , 218.Em lofs , mfs , msdos , nfs , 219.Em null , portal , procfs , 220.Em umap , union ; 221.Em from 222is the filesystem is mounted from; 223.Em on 224is the directory 225the filesystem is mounted on; and 226.Em fsflags 227is a list 228of optional flags applied to the mount (see 229.Xr mount 8 ) . 230The second line is a header for the individual fields, 231the first part of which are fixed, and the second part are filesystem 232type specific. 233The headers common to all vnodes are: 234.Bl -tag -width indent 235.It ADDR 236Location of this vnode. 237.It TYP 238File type. 239.It VFLAG 240A list of letters representing vnode flags: 241.Pp 242.Bl -tag -width indent -compact 243.It R 244VROOT root of its file system. 245.It T 246VTEXT pure text prototype. 247.It S 248VSYSTEM vnode being used by kernel. 249.It I 250VISTTY vnode represents a tty 251.It L 252VXLOCK locked to change underlying type. 253.It W 254VXWANT process is waiting for vnode. 255.It B 256VBWAIT waiting for output to complete 257.It A 258VALIASED vnode has an alias 259.It D 260VDIROP lfs vnode involved in directory op. 261.It F 262VONFREELIST vnode is on a free list 263.It l 264VLOCKSWORK FS supports locking discipline 265.It s 266VONSYNCLIST vnode is on syncer worklist 267.El 268.Pp 269.It USE 270The number of references to this vnode. 271.It HOLD 272The number of I/O buffers held by this vnode. 273.It FILEID 274The vnode fileid. 275In the case of 276.Em ffs 277this is the inode number. 278.It IFLAG 279Miscellaneous filesystem specific state variables encoded thus: 280.Bl -tag -width indent 281.It "For ffs:" 282.Bl -tag -width indent -compact 283.It A 284access time must be corrected 285.It C 286changed time must be corrected 287.It U 288update time 289.Pq Xr fs 5 290must be corrected 291.It R 292has a rename in progress 293.It M 294contains modifications 295.It S 296shared lock applied 297.It E 298exclusive lock applied 299.El 300.It "For nfs:" 301.Bl -tag -width indent -compact 302.It W 303waiting for I/O buffer flush to complete 304.It P 305I/O buffers being flushed 306.It M 307locally modified data exists 308.It E 309an earlier write failed 310.It X 311non-cacheable lease (nqnfs) 312.It O 313write lease (nqnfs) 314.It G 315lease was evicted (nqnfs) 316.It A 317special file accessed 318.It U 319special file updated 320.It C 321special file times changed 322.El 323.It SIZ/RDEV 324Number of bytes in an ordinary file, or 325major and minor device of special file. 326.El 327.El 328.Sh ENVIRONMENT 329.Bl -tag -width BLOCKSIZE 330.It Ev BLOCKSIZE 331If the environment variable 332.Ev BLOCKSIZE 333is set, and the 334.Fl k 335option is not specified, the block counts will be displayed in units of that 336size block. 337.El 338.Sh SEE ALSO 339.Xr ps 1 , 340.Xr systat 1 , 341.Xr stat 2 , 342.Xr fs 5 , 343.Xr iostat 8 , 344.Xr vmstat 8 345.Rs 346.Rt Tn UNIX Rt Implementation , 347.Ra K. Thompson 348.Re 349.Sh BUGS 350Swap statistics are reported for all swap partitions compiled into the kernel, 351regardless of whether those partitions are being used. 352.Pp 353Does not understand NFS swap servers. 354.Sh HISTORY 355The 356.Nm 357command appeared in 358.Bx 4.0 . 359