PSTAT(8) — UNIX Programmer’s Manual
NAME
pstat − print system facts
SYNOPSIS
/etc/pstat −aipufsTtv [ 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 /dynix unless system is specified. Options are
−a Under −p, describe all process slots rather than just active ones.
−i Print the inode table with the these headings:
LOCThe core location of this table entry.
IFLGMiscellaneous inode specific state variables are encoded as:
Uupdate time (fs(5)) must be corrected
Aaccess time must be corrected
Cchanged time must be corrected
Fon the free list
VFLAGMiscellaneous vnode state flags are encoded as:
Rvnode is the root of a mounted file system
Mvnode is mapped (mmap(2))
Dvnode must be sync’d before being mapped
Nvnode has no links
Sshared lock applied
Eexclusive lock applied
Zsomeone waiting for an exclusive lock
CNTNumber of open file table entries for this inode.
DEVICEMajor and minor device number of file system in which this inode resides.
RDCReference count of shared locks on the inode.
WRCReference count of exclusive locks on the inode (this may be > 1 if, for example, a file descriptor is inherited across a fork).
INOI-number within the device.
MODEMode bits, see chmod(2).
NLKNumber of links to this inode.
UIDUser ID of owner.
SIZ/DEVNumber of bytes in an ordinary file, or major and minor device of special file.
TYPEType of the inode.
−p Print process table for active processes with these headings:
LOCThe core location of this table entry.
SRun state is encoded as:
0no process
1waiting for some event
3runnable
4being created
5being terminated (zombie)
6stopped under trace
7running on a processsor
FMiscellaneous state variables, or-ed together (hexadecimal):
000001loaded
000002the scheduler or pager process
000010traced
000020used in tracing
000040process text may be written during tracing
000080restore old mask after taking signal
000100process resulted from a vfork(2) which is not yet complete
000200process has no virtual memory, as it is a parent in the context of vfork(2)
000400timing out during sleep
000800process used 4.1BSD compatibility mode signal primitives, no system calls will restart.
001000selecting
002000signal woke process up
004000synch with swapper during swapout
008000force swap of self
010000process may not be swapped (vm_ctl(2))
020000process priority will not age (proc_ctl(2))
040000process is a multi-process debugger
080000process is being debugged by a multi-process debugger
100000traced process is stopped for multi-process debugger
200000multi-process debugging state flag
400000process is stopped for old flavor debugger
PRIScheduling priority, see setpriority(2).
SIGSignals received (signals 1-32 coded in bits 0-31),
UIDReal user ID.
SLPAmount of time process has been blocked.
TIMTime resident in seconds; times over 127 coded as 127.
CPUWeighted integral of CPU time, for scheduler.
NINice level, 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.
SIZEVirtual size of process image (data+stack) in multiples of 512 bytes.
WCHANWait channel number of a waiting process.
LINKLink pointer in list of runnable processes.
AFFProcessor affinity.
NOSWAPNumber of reasons not to swap this process.
−u print information about a user process; the next argument is its address as given by ps(1). The process must be in main memory, or the file used can be a core image and the address 0.
−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 are encoded as:
Ropen for reading
Wopen for writing
Aopen for appending
Sshared locked applied
Xexclusive lock applied
Inon-blocking IO
CNTNumber of processes that know this open file.
DATAThe location of the vnode or socket for this file.
OFFSETThe file offset (see lseek(2)), or the core address of the associated socket structure.
−s print information about swap space usage: the number of (512-byte) pages used and free is given.
−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.
−t Print table for terminals with these headings:
TTthe two character abbreviation for the tty (e.g. hc for ttyhc).
DEVICEMajor and minor number for each tty.
RAWNumber of characters in raw input queue.
CANNumber of characters in canonicalized input queue.
OUTNumber of characters in putput queue.
OPENNumber of unique opens of the tty.
PGRPProcess group for which this is controlling terminal.
TTY FLAGS
hexadecimal value of t_flags (use -v to interpret).
STATEhexadecimal value of t_state (use -v to interpret).
SPEED I/O
input/output baud rates.
LDISCLine discipline; otty or ntty
Sample output is:
9 Systech ST Multiplexors.
Board 0: st_info @ 0x60e2c CSR 0x8c0200, 16 lines
TTDEVICERAWCANOUTOPENPGRPTTY FLAGSSTATESPEED I/OLDISC
h07,00001182980x000040f00x02149600/ 9600otty
h17,10001177120x000040f00x02149600/ 9600otty
h27,20001138720x000040f00x021419200/19200otty
h37,300012570x140540f00x020619200/19200otty
h47,4000100x00000cd80x000219200/19200otty
h57,5000100x000040f00x000219200/19200otty
h67,60001260500x140500d80x02149600/ 9600ntty
h77,700012610x140540f00x021419200/19200otty
h87,800012620x140540f00x02149600/ 9600otty
h97,90001165210x000040f00x02149600/ 9600otty
ha7,100001194270x140540f00x02149600/ 9600otty
hb7,110001205720x000040f00x02149600/ 9600otty
hc7,120001122350x540540f00x02149600/ 9600otty
hd7,130001187810x000040f00x02149600/ 9600otty
he7,14000100x000040f00x00029600/ 9600otty
hf7,1500012690x000040f00x02149600/ 9600otty
−v this causes −t to print verbose information about the ttys
Sample output is:
9 Systech ST Multiplexors.
Board 0: st_info @ 0x60e2c CSR 0x8c0200, 16 lines
TTDEVICERAWCANOUTOPENPGRPCOLSPEED I/OLDISC
h37,300012574219200/19200otty
FLAGS: 140540f0
CRMOD0x00000010 map \r to \r\n on output
RAW0x00000020 no i/o processing
ANYP0x000000c0 get any parity/send none
FF10x00004000 tty 37 vertical tab delay
CRTBS0x00010000 do backspacing for crt
CRTERA0x00040000 erasing backspace
CRTKIL0x04000000 kill line with blanks
CTLECH0x10000000 echo control chars as ^X
STATE:00000206
TS_WOPEN0x00000002 waiting for open to complete
TS_ISOPEN0x00000004 device is open
TS_HUPCLS0x00000200 hang up upon last close
FILES
/dynixnamelist
/dev/kmemdefault source of tables
SEE ALSO
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.
4BSD/DYNIX