PSTAT(8)

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

-a  Under -p, describe all process slots rather than just active ones.

-i  Print the inode table with the these headings:

    LOC The core location of this table entry.

    IFLG
        Miscellaneous inode specific state variables are encoded as:

        U   update time (fs(5)) must be corrected

        A   access time must be corrected

        C   changed time must be corrected

        F   on the free list

    VFLAG
        Miscellaneous vnode state flags are encoded as:

        R   vnode is the root of a mounted file system

        M   vnode is mapped (mmap(2))

        D   vnode must be sync'd before being mapped

        N   vnode has no links

        S   shared lock applied

        E   exclusive lock applied

        Z   someone waiting for an exclusive lock

    CNT Number of open file table entries for this inode.

    DEVICE
        Major and minor device number of filesystem in which this inode resides.

    RDC Reference count of shared locks on the inode.

    WRC Reference count of exclusive locks on the inode (this may be > 1 if, for example, a file descriptor is inherited across a fork).

    INO I-number within the device.

    MODE
        Mode bits, see chmod(2).

    NLK Number of links to this inode.

    UID User ID of owner.

    SIZ/DEV
        Number of bytes in an ordinary file, or major and minor device of special file.

    TYPE
        Type of the inode.

-p  Print process table for active processes with these headings:

    LOC The core location of this table entry.

    S   Run state is encoded as:
        0   no process
        1   waiting for some event
        3   runnable
        4   being created
        5   being terminated (zombie)
        6   stopped under trace
        7   running on a processor

    F   Miscellaneous state variables, ORed together (hexadecimal):
        000001
            loaded
        000002
            the scheduler or pager process
        000010
            traced
        000020
            used in tracing
        000040
            process text may be written during tracing
        000080
            restore old mask after taking signal
        000100
            process resulted from a vfork(2) which is not yet complete
        000200
            process has no virtual memory, as it is a parent in the context of vfork(2)
        000400
            timing out during sleep
        000800
            process used 4.1BSD compatibility mode signal primitives, no system calls will restart.
        001000
            selecting
        002000
            signal woke process up
        004000
            synch with swapper during swapout
        008000
            force swap of self
        010000
            process may not be swapped (vm_ctl(2))
        020000
            process priority will not age (proc_ctl(2))
        040000
            process is a multi-process debugger
        080000
            process is being debugged by a multi-process debugger
        100000
            traced process is stopped for multi-process debugger
        200000
            multi-process debugging state flag
        400000
            process is stopped for old-flavor debugger

    PRI Scheduling priority, see setpriority(2).

    SIG Signals received (signals 1-32 coded in bits 0-31),

    UID Real user ID.

    SLP Amount of time process has been blocked.

    TIM Time resident in seconds; times over 127 coded as 127.

    CPU Weighted integral of CPU time, for scheduler.

    NI  Nice level, see setpriority(2).

    PGRP
        Process number of root of process group (the opener of the controlling terminal).

    PID The process ID number.

    PPID
        The process ID of parent process.

    ADDR
        If in core, the page frame number of the first page of the `u-area' of the process.

    RSS Resident set size — the number of physical page frames allocated to this process.

    SIZE
        Virtual size of process image (data+stack) in multiples of 512 bytes.

    WCHAN
        Wait channel number of a waiting process.

    LINK
        Link pointer in list of runnable processes.

    AFF Processor affinity.

    NOSWAP
        Number 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:

    LOC The core location of this table entry.

    TYPE
        The type of object the file table entry points to.

    FLG Miscellaneous state variables are encoded as:

        R   open for reading

        W   open for writing

        A   open for appending

        S   shared locked applied

        X   exclusive lock applied

        I   non-blocking IO

    CNT Number of processes that know this open file.

    DATA
        The location of the vnode or socket for this file.

    OFFSET
        The 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, free pages, and "wasted" pages. A wasted page belongs to an allocated chunk of swap space, but is currently unused within that chunk.

-T  Print the number of used and configured slots in the system tables. Useful for checking how full system tables have become if the system is under a heavy load.

-t  Print table for terminals with these headings:

    TT  the two character abbreviation for the tty (e.g., hc for ttyhc).

    DEVICE
        Major and minor number for each tty.

    RAW Number of characters in raw input queue.

    CAN Number of characters in canonicalized input queue.

    OUT Number of characters in output queue.

    OPEN
        Number of unique opens of the tty.

    PGRP
        Process group for which this is controlling terminal.

    TTY FLAGS
        hexadecimal value of t_flags (use -v to interpret).

    STATE
        hexadecimal value of t_state (use -v to interpret).

    SPEED I/O
        input/output baud rates.

    LDISC
        Line discipline; otty or ntty

    Sample output is:

    9 Systech ST Multiplexors.
    Board 0: st_info @ 0x60e2c CSR 0x8c0200, 16 lines
    TT	DEVICE	RAW	CAN	OUT	OPEN	PGRP	TTY FLAGS	STATE	SPEED I/O	LDISC
    h0	7,	0	0	0	0	1	18298	0x000040f0	0x0214	9600/ 9600	otty
    h1	7,	1	0	0	0	1	17712	0x000040f0	0x0214	9600/ 9600	otty
    h2	7,	2	0	0	0	1	13872	0x000040f0	0x0214	19200/19200	otty
    h3	7,	3	0	0	0	1	257	0x140540f0	0x0206	19200/19200	otty
    h4	7,	4	0	0	0	1	0	0x00000cd8	0x0002	19200/19200	otty
    h5	7,	5	0	0	0	1	0	0x000040f0	0x0002	19200/19200	otty
    h6	7,	6	0	0	0	1	26050	0x140500d8	0x0214	9600/ 9600	ntty
    h7	7,	7	0	0	0	1	261	0x140540f0	0x0214	9200/19200	otty
    h8	7,	8	0	0	0	1	262	0x140540f0	0x0214	9600/ 9600	otty
    h9	7,	9	0	0	0	1	16521	0x000040f0	0x0214	9600/ 9600	otty
    ha	7,	10	0	0	0	1	19427	0x140540f0	0x0214	9600/ 9600	otty
    hb	7,	11	0	0	0	1	20572	0x000040f0	0x0214	9600/ 9600	otty
    hc	7,	12	0	0	0	1	12235	0x540540f0	0x0214	9600/ 9600	otty
    hd	7,	13	0	0	0	1	18781	0x000040f0	0x0214	9600/ 9600	otty
    he	7,	14	0	0	0	1	0	0x000040f0	0x0002	9600/ 9600	otty
    hf	7,	15	0	0	0	1	269	0x000040f0	0x0214	9600/ 9600	otty

-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
TT	DEVICE	RAW	CAN	OUT	OPEN	PGRP	COL	SPEED I/O	LDISC
h3	7,	3	0	0	0	1	257	42	19200/19200	otty
FLAGS: | 140540f0
 | CRMOD | 0x00000010 | Map \r to \r\n on output
 | RAW | 0x00000020 | No i/o processing
 | ANYP | 0x000000c0 | Get any parity/send none
 | FF1 | 0x00004000 | TTY 37 vertical tab delay
 | CRTBS | 0x00010000 | Do backspacing for crt
 | CRTERA | 0x00040000 | Erasing backspace
 | CRTKIL | 0x04000000 | Kill line with blanks
 | CTLECH0 | Ox10000000 | Echo control chars as ^X
STATE: | 00000206
 | TS_WOPEN | 0x00000002 | Waiting for open to complete
 | TS_ISOPEN | 0x00000004 | Device is open
 | TS_HUPCLS | 0x00000200 | Hang up upon last close

FILES
/dynix    namelist
/dev/kmem    default source of tables

SEE ALSO
ps(1), stat(2), fs(5)

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.