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