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