1.\" $NetBSD: pstat.8,v 1.16 1997/06/12 07:45:32 bouyer 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.4 (Berkeley) 4/19/94 35.\" 36.Dd April 19, 1994 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.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 Pstat 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. It is useful for checking to see how large system tables become 71if 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 150waiting 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 T 158delay timeout in progress 159.It F 160outq has been flushed during DMA 161.It B 162busy doing output 163.It A 164process is awaiting output 165.It X 166open for exclusive use 167.It S 168output stopped 169.It K 170further input blocked 171.It Y 172tty in async I/O mode 173.El 174.It SESS 175Session for which this is controlling terminal. 176.It PGID 177Current foreground process group associated with this terminal. 178.It DISC 179Line discipline; 180.Ql term 181for 182TTYDISC (see 183.Xr termios 4 ) , 184.Ql tab 185for TABLDISC (see 186.Xr tb 4 ) , 187.Ql slip 188for SLIPDISC (see 189.Xr sl 4 ) , 190.Ql ppp 191for PPPDISC (see 192.Xr ppp 4 ) , 193.Ql strip 194for STRIPDISC (see 195.Xr strip 4 ) . 196.El 197.It Fl v 198Print the active vnodes. Each group of vnodes corresponding 199to a particular filesystem is preceded by a two line header. The 200first line consists of the following: 201.Pp 202.Df I 203.No *** MOUNT Em fstype from 204on 205.Em on fsflags 206.De 207.Pp 208where 209.Em fstype 210is one of 211.Em adosfs , afs , cd9660 , fdesc , 212.Em ffs , ext2fs , kernfs , lfs , lofs , 213.Em mfs , msdos , nfs , null , 214.Em portal , procfs , umap , union ; 215.Em from 216is the filesystem mounted from; 217.Em on 218is the directory 219the filesystem is mounted on; and 220.Em fsflags 221is a list 222of optional flags applied to the mount (see 223.Xr mount 8 ) . 224The second line is a header for the individual fields , 225the first part of which are fixed, and the second part are filesystem 226type specific. The headers common to all vnodes are: 227.Bl -tag -width indent 228.It ADDR 229Location of this vnode. 230.It TYP 231File type. 232.It VFLAG 233A list of letters representing vnode flags: 234.Pp 235.Bl -tag -width indent -compact 236.It R 237VROOT root of its file system. 238.It T 239VTEXT pure text prototype. 240.It L 241VXLOCK locked to change underlying type. 242.It W 243VXWANT process is waiting for vnode. 244.It S 245VSYSTEM vnode being used by kernel. 246.It A 247VALIASED vnode has an alias 248.It B 249VBWAIT waiting for output to complete 250.It D 251VDIROP lfs vnode involved in directory op. 252.El 253.Pp 254.It USE 255The number of references to this vnode. 256.It HOLD 257The number of I/O buffers held by this vnode. 258.It FILEID 259The vnode fileid. 260In the case of 261.Em ffs 262or 263.Em ext2fs 264this is the inode number. 265.It IFLAG 266Miscellaneous filesystem specific state variables encoded thus: 267.Bl -tag -width indent 268.It "For ffs or ext2fs:" 269.Bl -tag -width indent -compact 270.It L 271locked 272.It U 273update time 274.Pq Xr fs 5 275must be corrected 276.It A 277access time must be corrected 278.It W 279wanted by another process (L flag is on) 280.It C 281changed time must be corrected 282.It S 283shared lock applied 284.It E 285exclusive lock applied 286.It Z 287someone waiting for a lock 288.It M 289contains modifications 290.It R 291has a rename in progress 292.El 293.It "For nfs:" 294.Bl -tag -width indent -compact 295.It W 296waiting for I/O buffer flush to complete 297.It P 298I/O buffers being flushed 299.It M 300locally modified data exists 301.It E 302an earlier write failed 303.It X 304non-cacheable lease (nqnfs) 305.It O 306write lease (nqnfs) 307.It G 308lease was evicted (nqnfs) 309.El 310.It SIZ/RDEV 311Number of bytes in an ordinary file, or 312major and minor device of special file. 313.El 314.Sh ENVIRONMENT VARIABLES 315.Bl -tag -width BLOCKSIZE 316.It Ev BLOCKSIZE 317If the environment variable 318.Ev BLOCKSIZE 319is set, and the 320.Fl k 321option is not specified, the block counts will be displayed in units of that 322size block. 323.El 324.Sh FILES 325.Bl -tag -width /dev/kmemxxx -compact 326.It Pa /netbsd 327namelist 328.It Pa /dev/kmem 329default source of tables 330.El 331.Sh SEE ALSO 332.Xr ps 1 , 333.Xr systat 1 , 334.Xr stat 2 , 335.Xr fs 5 , 336.Xr iostat 8 , 337.Xr vmstat 8 338.Rs 339.Rt Tn UNIX Rt Implementation , 340.Ra K. Thompson 341.Re 342.Sh BUGS 343Swap statistics are reported for all swap partitions compiled into the kernel, 344regardless of whether those partitions are being used. 345.Pp 346Does not understand NFS swap servers. 347.Sh HISTORY 348The 349.Nm pstat 350command appeared in 4.0BSD. 351