1.\" Copyright (c) 1980, 1991, 1993, 1994 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" @(#)pstat.8 8.4 (Berkeley) 4/19/94 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. All advertising materials mentioning features or use of this software 14.\" must display the following acknowledgement: 15.\" This product includes software developed by the University of 16.\" California, Berkeley and its contributors. 17.\" 4. Neither the name of the University nor the names of its contributors 18.\" may be used to endorse or promote products derived from this software 19.\" without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" SUCH DAMAGE. 32.\" 33.\" @(#)pstat.8 8.4 (Berkeley) 4/19/94 34.\" 35.Dd April 19, 1994 36.Dt PSTAT 8 37.Os BSD 4 38.Sh NAME 39.Nm pstat 40.Nd display system data structures 41.Sh SYNOPSIS 42.Nm pstat 43.Op Fl Tfnstv 44.Op Fl M Ar core 45.Op Fl N Ar system 46.Sh DESCRIPTION 47.Nm Pstat 48displays open file entry, swap space utilization, 49terminal state, and vnode data structures. 50If 51.Ar corefile 52is given, the information is sought there, otherwise 53in 54.Pa /dev/kmem . 55The required namelist is taken from 56.Pa /kernel 57unless 58.Ar system 59is specified. 60The 61.Fl n 62option specifies that devices should be printed out by major/minor 63number rather than by name. 64.Pp 65Options are 66.Bl -tag -width indent 67.It Fl T 68Prints the number of used and free slots in the several system tables 69and is useful for checking to see how large system tables have become 70if the system is under heavy load. 71.It Fl f 72Print the open file table with these headings: 73.Bl -tag -width indent 74.It LOC 75The core location of this table entry. 76.It TYPE 77The type of object the file table entry points to. 78.It FLG 79Miscellaneous state variables encoded thus: 80.Bl -tag -width indent 81.It R 82open for reading 83.It W 84open for writing 85.It A 86open for appending 87.It S 88shared lock present 89.It X 90exclusive lock present 91.It I 92signal pgrp when data ready 93.El 94.It CNT 95Number of processes that know this open file. 96.It MSG 97Number of messages outstanding for this file. 98.It DATA 99The location of the vnode table entry or socket structure for this file. 100.It OFFSET 101The file offset (see 102.Xr lseek 2 ) . 103.El 104.It Fl s 105Print information about swap space usage on all the 106swap areas compiled into the kernel. 107The first column is the device name of the partition. The next column is 108the total space available in the partition. The 109.Ar Used 110column indicates the total blocks used so far; the 111.Ar Available 112column indicates how much space is remaining on each partition. 113The 114.Ar Capacity 115reports the percentage of space used. 116.Pp 117If more than one partition is configured into the system, totals for all 118of the statistics will be reported in the final line of the report. 119.It Fl t 120Print table for terminals 121with these headings: 122.Bl -tag -width indent 123.It RAW 124Number of characters in raw input queue. 125.It CAN 126Number of characters in canonicalized input queue. 127.It OUT 128Number of characters in putput queue. 129.It MODE 130See 131.Xr tty 4 . 132.It ADDR 133Physical device address. 134.It DEL 135Number of delimiters (newlines) in canonicalized input queue. 136.It COL 137Calculated column position of terminal. 138.It STATE 139Miscellaneous state variables encoded thus: 140.Bl -tag -width indent 141.It T 142delay timeout in progress 143.It W 144waiting for open to complete 145.It O 146open 147.It F 148outq has been flushed during DMA 149.It C 150carrier is on 151.It B 152busy doing output 153.It A 154process is awaiting output 155.It X 156open for exclusive use 157.It S 158output stopped 159.It H 160hangup on close 161.El 162.It PGRP 163Process group for which this is controlling terminal. 164.It DISC 165Line discipline; blank is old tty 166OTTYDISC 167or 168.Ql new tty 169for 170NTTYDISC 171or 172.Ql net 173for 174NETLDISC 175(see 176.Xr bk 4 ) . 177.El 178.It Fl v 179Print the active vnodes. Each group of vnodes corresponding 180to a particular filesystem is preceded by a two line header. The 181first line consists of the following: 182.Pp 183.Df I 184.No *** MOUNT Em fstype from 185on 186.Em on fsflags 187.De 188.Pp 189where 190.Em fstype 191is one of 192.Em ufs , nfs , mfs , or pc ; 193.Em from 194is the filesystem is mounted from; 195.Em on 196is the directory 197the filesystem is mounted on; and 198.Em fsflags 199is a list 200of optional flags applied to the mount (see 201.Xr mount 8 ) . 202.The second line is a header for the individual fields , 203the first part of which are fixed, and the second part are filesystem 204type specific. The headers common to all vnodes are: 205.Bl -tag -width indent 206.It ADDR 207Location of this vnode. 208.It TYP 209File type. 210.It VFLAG 211.Pp 212A list of letters representing vnode flags: 213.Bl -tag -width indent 214.It R 215\- VROOT 216.It T 217\- VTEXT 218.It L 219\- VXLOCK 220.It W 221\- VXWANT 222.It E 223\- VEXLOCK 224.It S 225\- VSHLOCK 226.It T 227\- VLWAIT 228.It A 229\- VALIASED 230.It B 231\- VBWAIT 232.El 233.Pp 234.It USE 235The number of references to this vnode. 236.It HOLD 237The number of I/O buffers held by this vnode. 238.It FILEID 239The vnode fileid. 240In the case of 241.Em ufs 242this is the inode number. 243.It IFLAG 244Miscellaneous filesystem specific state variables encoded thus: 245.Bl -tag -width indent 246.It "For ufs:" 247.Pp 248.Bl -tag -width indent 249.It L 250locked 251.It U 252update time 253.Pq Xr fs 5 254must be corrected 255.It A 256access time must be corrected 257.It W 258wanted by another process (L flag is on) 259.It C 260changed time must be corrected 261.It S 262shared lock applied 263.It E 264exclusive lock applied 265.It Z 266someone waiting for a lock 267.It M 268contains modifications 269.It R 270has a rename in progress 271.El 272.It "For nfs:" 273.Bl -tag -width indent 274.It W 275waiting for I/O buffer flush to complete 276.It P 277I/O buffers being flushed 278.It M 279locally modified data exists 280.It E 281an earlier write failed 282.It X 283non-cacheable lease (nqnfs) 284.It O 285write lease (nqnfs) 286.It G 287lease was evicted (nqnfs) 288.El 289.El 290.It SIZ/RDEV 291Number of bytes in an ordinary file, or 292major and minor device of special file. 293.El 294.El 295.Sh FILES 296.Bl -tag -width /dev/kmemxxx -compact 297.It Pa /kernel 298namelist 299.It Pa /dev/kmem 300default source of tables 301.El 302.Sh SEE ALSO 303.Xr iostat 1 , 304.Xr ps 1 , 305.Xr systat 1 , 306.Xr vmstat 1 , 307.Xr stat 2 , 308.Xr fs 5 , 309.Rs 310.Rt Tn UNIX Rt Implementation , 311.Ra K. Thompson 312.Re 313.Sh BUGS 314Swap statistics are reported for all swap partitions compiled into the kernel, 315regardless of whether those partitions are being used. 316.Pp 317Does not understand NFS swap servers. 318.Sh HISTORY 319The 320.Nm pstat 321command appeared in 4.0BSD. 322