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