Manual browser: pstat(8)
|PSTAT(8)||System Manager's Manual||PSTAT(8)|
NAMEpstat — display system data structures
|pstat||[-T | -f | -s | -t | -v] [-ghkmn] [-M core] [-N system]|
DESCRIPTIONpstat displays open file entry, swap space utilization, terminal state, and vnode data structures. If corefile is given, the information is sought there, otherwise in /dev/kmem. The required namelist is taken from /netbsd unless system is specified.
The following options are available:
- Prints the number of used and free slots for open files, used vnodes, and swap space. This option is useful for checking to see how large system tables become if the system is under heavy load.
Print the open file table with these headings:
- The core location of this table entry.
- The type of object the file table entry points to.
Miscellaneous state variables encoded thus:
- open for reading
- open for writing
- open for appending
- shared lock present
- exclusive lock present
- signal pgrp when data ready
- Number of processes that know this open file.
- Number of messages outstanding for this file.
- The location of the vnode table entry or socket structure for this file.
- Number of active users of this open file.
- Value of internal flags.
- The file offset (see lseek(2)).
- The -g option uses (1024 * 1024 * 1024) byte blocks instead of the default 512 byte.
- Use humanize_number(3) to display (swap) sizes.
- Use 1K-byte blocks.
- The -m option uses (1024 * 1024) byte blocks instead of the default 512 byte.
- Print devices by major/minor number rather than by name.
Print information about swap space usage on all the swap areas compiled into the kernel. The first column is the device name of the partition. The next column is the total space available in the partition. The Used column indicates the total blocks used so far; the Available column indicates how much space is remaining on each partition. The Capacity reports the percentage of space used.
If more than one partition is configured into the system, totals for all of the statistics will be reported in the final line of the report.
Print table for terminals with these headings:
- Physical device name.
- Number of characters in raw input queue.
- Number of characters in canonicalized input queue.
- Number of characters in output queue.
- High water mark for output.
- Low water mark for output.
- Calculated column position of terminal.
Miscellaneous state variables encoded thus:
- delay timeout in progress
- outq has been flushed during DMA
- carrier is on
- busy doing output
- process is awaiting output
- open for exclusive use
- output stopped
- further input blocked
- tty in async I/O mode
state for lowercase ‘
within a ‘
\.../’ for PRTRUB
- next character is literal
- retyping suspended input (PENDIN)
- counting tab width, ignore FLUSHO
- tty used for dialout
- Session for which this is controlling terminal.
- Current foreground process group associated with this terminal.
Line discipline; ‘
term’ for TTYDISC (see termios(4)), ‘
tab’ for TABLDISC (see tb(4)), ‘
slip’ for SLIPDISC (see sl(4)), ‘
ppp’ for PPPDISC (see ppp(4)), ‘
strip’ for STRIPDISC (see strip(4)), ‘
hdlc’ for HDLCDISC.
Print the active vnodes. Each group of vnodes corresponding to a particular filesystem is preceded by a two line header. The first line consists of the following:
*** MOUNT fstype from
where fstype is one of adosfs, afs, cd9660, fdesc, ffs, ext2fs, kernfs, lfs, lofs, mfs, msdos, nfs, null, procfs, umap, union; from is the filesystem mounted from; on is the directory the filesystem is mounted on; and fsflags is a list of optional flags applied to the mount (see mount(8)). The second line is a header for the individual fields, the first part of which are fixed, and the second part are filesystem type specific. The headers common to all vnodes are:
- Location of this vnode.
- File type.
A list of letters representing vnode flags:
- VROOT root of its file system.
- VTEXT pure text prototype.
- VSYSTEM vnode being used by kernel.
- VISTTY vnode is a tty.
- VEXECMAP vnode has PROT_EXEC mappings.
- VDIROP lfs vnode involved in directory op.
- VLAYER vnode is on layer filesystem.
- VONWORKLST vnode is on syncer work-list.
- The number of references to this vnode.
- The number of I/O buffers held by this vnode.
- The type of underlying data.
- The number of pages in this vnode.
- The vnode fileid. In the case of ffs or ext2fs this is the inode number.
Miscellaneous filesystem specific state variables encoded thus:
- For ffs, lfs or ext2fs:
- access time must be corrected
- changed time must be corrected
- update time (fs(5)) must be corrected
- contains modifications
- has been accessed
- has a rename in progress
- shared lock applied
- exclusive lock applied
- is being cleaned (LFS)
- directory operation in progress (LFS)
- blocks to be freed in free count
- For nfs:
- waiting for I/O buffer flush to complete
- I/O buffers being flushed
- locally modified data exists
- an earlier write failed
- special file accessed
- special file updated
- special file times changed
- Number of bytes in an ordinary file, or major and minor device of special file.
- If the environment variable BLOCKSIZE is set, and the -k option is not specified, the block counts will be displayed in units of that size block.
- default source of tables
SEE ALSOps(1), systat(1), vmstat(1), stat(2), fs(5), iostat(8)
K. Thompson, Tn UNIX Implementation.
HISTORYThe pstat command appeared in 4.0BSD.
BUGSSwap statistics are reported for all swap partitions compiled into the kernel, regardless of whether those partitions are being used.
Does not understand NFS swap servers.
|March 24, 2014||NetBSD 7.0|