pstat(1M)
NAME
pstat − print system facts
SYNOPSIS
/usr/ucb/pstat −airptfksT [ −u ubase ] [ −U pid ] [ system ] [ corefile ]
DESCRIPTION
pstat interprets the contents of certain system tables. If corefile is given, the tables are sought there, otherwise in /dev/kmem. The required namelist is taken from /unix unless system is specified. Options are
−a Under −p, describe all process slots rather than just active ones.
−i Print the inode table with these headings:
ILOCThe core location of this table entry.
IFLAGMiscellaneous inode state variables encoded thus:
Llocked
Uupdate time (fs(4)) must be corrected
Aaccess time must be corrected
Wwanted by another process (L flag is on)
Cchanged time must be corrected
Rreferenced
IDEVICEMajor and minor device number of file system in which this inode resides.
INOI-number within the device.
MODEMode bits, see chmod(2).
NLKNumber of links to this inode.
UIDUser ID of owner.
SIZE/DEVNumber of bytes in an ordinary file, or major and minor device of special file.
VFLAGMiscellaneous vnode state variables encoded thus:
Rroot of its file system
Sshared lock applied
Eexclusive lock applied
Tvnode is a pure text prototype
Zprocess is waiting for a shared or exclusive lock
CNTNumber of open file table entries for this inode.
SHCReference count of shared locks on the inode.
EXCReference count of exclusive locks on the vnode (this may be > 1 if, for example, a file descriptor is inherited across a fork).
TYPEVnode file type, either VNON (no type), VREG (regular), VDIR (directory), VBLK (block device), VCHR (character device), VLNK (symbolic link), VSOC (socket), FIFO (fifo), or VBAD (bad).
−r Print the region table with these headings:
LOCThe core location of this table entry.
FLAGSMiscellaneous state variables encoded thus:
Nfregion is not freed on last detach
Prthe region is private, non-shared
Lkregion is locked
Wthere are processes waiting for this region
Nregion is non-cached
Ststack region
Rregion is read-only
Bregion is bound to physical memory
Ioregion maps I/O address space
Swregion is marked for swap out
Xregion was shared text, is now private
Cbregion is using copyback caching mode
Loregion prefers to load in the local memory of cpu
Hregion must load is the local memory of cpu (Hard)
TYPERegion type which can be PRIV (private), STXT (shared text), or SHRM (shared memory).
SIZESize of the region in pages.
RESIDResident size of the region in pages.
REFCNTNumber of processes attached to this region.
VPTRCore location of corresponding vnode.
RLISTPTRCore location of the list of pointers to page tables and dbd’s.
−p Print process table for active processes with these headings:
LOCThe core location of this table entry.
SCurrent process state encoded thus:
0no process
1waiting for some event
3running or runnable
4intermediate state in process creation
5intermediate state in process termination
6process stopped under trace
7process being xswapped
8fbs wait state
FLAGSMiscellaneous state variables, or-ed together (hexadecimal):
0000002kernel daemon
0000004locked for swap out
0000010process being traced
0000020another tracing flag
0000040user settable lock in core
0000400exiting
0000800doing physical I/O
0001000process resulted from a vfork(2)
0010000user warned of sequential vm behavior
0020000user warned of random vm behavior
0080000sleep may be interrupted by signal
0200000process is owed a profiling tick
0400000selecting; wakeup/waiting danger
2000000record-locking has been done
4000000PROCLOCK’d process
8000000fbs process checked by wait()
RUNCurrent CPU this process is assigned to.
PRIScheduling priority, see setpriority(2).
SIGSignals received (signals 1-32 coded in hex bits 0-31),
UIDReal user ID.
SLPAmount of time (in seconds) process has been blocked.
TIMTime resident in seconds.
CPUWeighted integral of CPU time, for scheduler.
NINice level + 20, see setpriority(2).
PGRPProcess number of root of process group (the opener of the controlling terminal).
PIDThe process ID number.
PPIDThe process ID of parent process.
ADDRIf in core, the page frame number of the first page of the ‘u-area’ of the process.
RSSResident set size − the number of physical page frames allocated to this process.
SRSSRSS at last swap (0 if never swapped).
SIZEVirtual size of process image (data+stack) in multiples of pages.
WCHANSemaphore process is blocked on.
LINKLink pointer in list of runnable processes.
PREGPPointer to location of pregion table for this process.
MEMFLocal Memory Flags (See memory(7).)
0x01text_local: load text region in local memory.
0x02text_hard: "hard" binding of text to local mem.
0x04data_local: load data region in local memory.
0x08data_hard: "hard" binding of data to local mem.
0x10stack_local: load stack region in local memory.
0x20stack_hard: "hard" binding of stack to local mem.
0x40pcb_local: load pcb, kernel stack and u-area in local memory.
0x80pcb_hard: "hard" binding of pcb to local mem.
−t Print table for terminals with these headings:
RAWNumber of characters in raw input queue.
CANNumber of characters in canonicalized input queue.
OUTNumber of characters in output queue.
IFLGInput modes. See termio(7).
OFLGOutput modes. See termio(7).
CFLGControl modes. See termio(7).
LFLGLine discipline modes. See termio(7).
XFLGExtra modes for new tty driver.
ADDRPhysical device address.
DELNumber of delimiters (newlines) in canonicalized input queue.
COLCalculated column position of terminal.
STATEInternal state (hexadecimal mask). (defined in /usr/include/sys/tty.h)
PGRPProcess group for which this is controlling terminal.
LINELine discipline.
−U print information about a user process including a kernal stack walkback; the next argument is its PID. The process must be in main memory.
−u Same as the −U option except the next argument is its address as given by ps(1).
−f Print the open file table with these headings:
LOCThe core location of this table entry.
TYPEThe type of object the file table entry points to.
FLGMiscellaneous state variables encoded thus:
Ropen for reading
Wopen for writing
Aopen for appending
Sshared lock present
Xexclusive lock present
Isignal pgrp when data ready
CNTNumber of processes that know this open file.
MSGNumber of references from message queue.
DATAThe location of the vnode table entry or socket for this file.
OFFSETThe file offset (see lseek(2)), or the core address of the associated socket structure.
−k perform UNIX kernel memory mapping using specified kernel (default /unix). For use in viewing a physical memory image (i.e. core dump) rather than a virtual memory image (i.e. /dev/kmem)
−s print information about swap space usage. The swap table is output with these headings:
LOCThe core location of this table entry.
FLAGSMiscellaneous state variables encoded thus:
Dswap partition in the process of being deleted.
DEVICEMajor and minor device number of the file system associated with this swap device.
DEV VPTRThe address of the vnode associated with this swap device.
SIZETotal size of this swap partition in pages.
FREETotal number of free pages in this swap partition.
−T prints the number of used and free slots in the several system tables and is useful for checking to see how full system tables have become if the system is under heavy load. For the inode table, pstat also prints the number of inode entries which would be used in the Directory Name Lookup Cache were flushed. This number presents a better picture of how many inodes are being used for other purposes.
NOTES
If the high resolution timing facility is configured into the currently executing kernel, the system time reported for a user process will exclude or include time spent servicing interrupts, depending on what the system timing mode is set to. See hirestmode(2) and CX/UX Programmers Guide for more information on the high resolution timing facility.
SEE ALSO
FILES
/unixnamelist
/dev/kmemdefault source of tables
SEE ALSO
ps(1), stat(2), core(4), fs(4)
K. Thompson, UNIX Implementation
BUGS
It would be very useful if the system recorded “maximum occupancy” on the tables reported by −T; even more useful if these tables were dynamically allocated.
CX/UX Administrator’s Reference