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.\" From: @(#)pstat.8 8.4 (Berkeley) 4/19/94 34.\" $Id$ 35.\" 36.Dd October 7, 1995 37.Dt PSTAT 8 38.Os BSD 4 39.Sh NAME 40.Nm pstat 41.Nd display system data structures 42.Sh SYNOPSIS 43.Nm pstat 44.Op Fl Tfknstv 45.Op Fl M Ar core 46.Op Fl N Ar system 47.Pp 48.Nm swapinfo 49.Op Fl k 50.Sh DESCRIPTION 51.Nm Pstat 52displays open file entry, swap space utilization, 53terminal state, and vnode data structures. 54If 55.Ar corefile 56is given, the information is sought there, otherwise 57in 58.Pa /dev/kmem . 59The required namelist is taken from 60.Pa /kernel 61unless 62.Ar system 63is specified. 64.Pp 65If invoked as 66.Nm swapinfo 67the 68.Fl s 69option is implied, and only the 70.Fl k 71option is legal. 72.Pp 73Options are 74.Bl -tag -width indent 75.It Fl n 76Print devices out by major/minor instead of name. 77.It Fl k 78Print sizes in kilobytes, regardless of the setting of the BLOCKSIZE 79environment variable. 80.It Fl T 81Prints the number of used and free slots in the several system tables 82and is useful for checking to see how large system tables have become 83if the system is under heavy load. 84.It Fl f 85Print the open file table with these headings: 86.Bl -tag -width indent 87.It LOC 88The core location of this table entry. 89.It TYPE 90The type of object the file table entry points to. 91.It FLG 92Miscellaneous state variables encoded thus: 93.Bl -tag -width indent 94.It R 95open for reading 96.It W 97open for writing 98.It A 99open for appending 100.It S 101shared lock present 102.It X 103exclusive lock present 104.It I 105signal pgrp when data ready 106.El 107.It CNT 108Number of processes that know this open file. 109.It MSG 110Number of messages outstanding for this file. 111.It DATA 112The location of the vnode table entry or socket structure for this file. 113.It OFFSET 114The file offset (see 115.Xr lseek 2 ) . 116.El 117.It Fl s 118Print information about swap space usage on all the 119swap areas compiled into the kernel. 120The first column is the device name of the partition. The next column is 121the total space available in the partition. The 122.Ar Used 123column indicates the total blocks used so far; the 124.Ar Available 125column indicates how much space is remaining on each partition. 126The 127.Ar Capacity 128reports the percentage of space used. 129.Pp 130If more than one partition is configured into the system, totals for all 131of the statistics will be reported in the final line of the report. 132.It Fl t 133Print table for terminals 134with these headings: 135.Bl -tag -width indent 136.It RAW 137Number of characters in raw input queue. 138.It CAN 139Number of characters in canonicalized input queue. 140.It OUT 141Number of characters in putput queue. 142.It MODE 143See 144.Xr tty 4 . 145.It ADDR 146Physical device address. 147.It DEL 148Number of delimiters (newlines) in canonicalized input queue. 149.It COL 150Calculated column position of terminal. 151.It STATE 152Miscellaneous state variables encoded thus: 153.Bl -tag -width indent 154.It T 155delay timeout in progress 156.It W 157waiting for open to complete 158.It O 159open 160.It F 161outq has been flushed during DMA 162.It C 163carrier is on 164.It c 165connection open 166.It B 167busy doing output 168.It A 169process is waiting for space in output queue 170.It a 171process is waiting for output to complete 172.It X 173open for exclusive use 174.It S 175output stopped (ixon flow control) 176.It m 177output stopped (carrier flow control) 178.It o 179output stopped (CTS flow control) 180.It d 181output stopped (DSR flow control) 182.It K 183input stopped 184.It Y 185send SIGIO for input events 186.It D 187state for lowercase 188.Ql \e 189work 190.It E 191within a 192.Ql \e.../ 193for PRTRUB 194.It L 195next character is literal 196.It P 197retyping suspended input (PENDIN) 198.It N 199counting tab width, ignore FLUSHO 200.It l 201block mode input routine in use 202.It s 203i/o being snooped 204.It Z 205connection lost 206.El 207.It SESS 208Kernel address of the session structure. 209.It PGID 210Process group for which this is controlling terminal. 211.It DISC 212Line discipline; 213.Ql term 214for 215TTYDISC 216or 217.Ql ntty 218for 219NTTYDISC 220or 221.Ql tab 222for 223TABLDISC 224or 225.Ql slip 226for 227SLIPDISC 228or 229.Ql ppp 230for 231PPPDISC. 232.El 233.It Fl v 234Print the active vnodes. Each group of vnodes corresponding 235to a particular filesystem is preceded by a two line header. The 236first line consists of the following: 237.Pp 238.Df I 239.No *** MOUNT Em fstype from 240on 241.Em on fsflags 242.De 243.Pp 244where 245.Em fstype 246is one of 247.Em ufs , nfs , mfs , or pc ; 248.Em from 249is the filesystem is mounted from; 250.Em on 251is the directory 252the filesystem is mounted on; and 253.Em fsflags 254is a list 255of optional flags applied to the mount (see 256.Xr mount 8 ) . 257.The second line is a header for the individual fields , 258the first part of which are fixed, and the second part are filesystem 259type specific. The headers common to all vnodes are: 260.Bl -tag -width indent 261.It ADDR 262Location of this vnode. 263.It TYP 264File type. 265.It VFLAG 266.Pp 267A list of letters representing vnode flags: 268.Bl -tag -width indent 269.It R 270\- VROOT 271.It T 272\- VTEXT 273.It L 274\- VXLOCK 275.It W 276\- VXWANT 277.It E 278\- VEXLOCK 279.It S 280\- VSHLOCK 281.It T 282\- VLWAIT 283.It A 284\- VALIASED 285.It B 286\- VBWAIT 287.El 288.Pp 289.It USE 290The number of references to this vnode. 291.It HOLD 292The number of I/O buffers held by this vnode. 293.It FILEID 294The vnode fileid. 295In the case of 296.Em ufs 297this is the inode number. 298.It IFLAG 299Miscellaneous filesystem specific state variables encoded thus: 300.Bl -tag -width indent 301.It "For ufs:" 302.Pp 303.Bl -tag -width indent 304.It L 305locked 306.It U 307update time 308.Pq Xr fs 5 309must be corrected 310.It A 311access time must be corrected 312.It W 313wanted by another process (L flag is on) 314.It C 315changed time must be corrected 316.It S 317shared lock applied 318.It E 319exclusive lock applied 320.It Z 321someone waiting for a lock 322.It M 323contains modifications 324.It R 325has a rename in progress 326.El 327.It "For nfs:" 328.Bl -tag -width indent 329.It W 330waiting for I/O buffer flush to complete 331.It P 332I/O buffers being flushed 333.It M 334locally modified data exists 335.It E 336an earlier write failed 337.It X 338non-cacheable lease (nqnfs) 339.It O 340write lease (nqnfs) 341.It G 342lease was evicted (nqnfs) 343.El 344.El 345.It SIZ/RDEV 346Number of bytes in an ordinary file, or 347major and minor device of special file. 348.El 349.El 350.Sh FILES 351.Bl -tag -width /dev/kmemxxx -compact 352.It Pa /kernel 353namelist 354.It Pa /dev/kmem 355default source of tables 356.El 357.Sh SEE ALSO 358.Xr iostat 1 , 359.Xr ps 1 , 360.Xr systat 1 , 361.Xr vmstat 1 , 362.Xr stat 2 , 363.Xr fs 5 , 364.Rs 365.Rt Tn UNIX Rt Implementation , 366.Ra K. Thompson 367.Re 368.Sh BUGS 369Does not understand NFS swap servers. 370.Sh HISTORY 371The 372.Nm pstat 373command appeared in 4.0BSD. 374