{msgrcv total messages received (reads from pipes/sockets)}
{msgsnd total messages sent (writes on pipes/sockets)}
{vsz virtual size in Kbytes (alias vsize)}
{nice nice value (alias ni)}
{nsigs total signals taken (alias nsignals)}
{nswap total swaps in/out}
{pgid process group number}
{pid process ID}
{ppid parent process ID}
{rgid real group ID}
{ruid real user ID}
{ruser user name (from ruid)}
{start time started}
{time accumulated cpu time, user + system (alias cputime)}
{tpgid control terminal process group ID}
{tsiz text size (in Kbytes)}
{tty full name of control terminal}
{lim memoryuse limit}
{logname login name of user who started the process}
}
set ALL_ps_keywords {
{%cpu percentage cpu usage (alias pcpu)}
{%mem percentage memory usage (alias pmem)}
{acflag accounting flag (alias acflg)}
{cpu short-term cpu usage factor (for scheduling)}
{inblk total blocks read (alias inblock)}
{jobc job control count}
{ktrace tracing flags}
{ktracep tracing vnode}
{lim memoryuse limit}
{lstart time started}
{majflt total page faults}
{minflt total page reclaims}
{msgrcv total messages received (reads from pipes/sockets)}
{msgsnd total messages sent (writes on pipes/sockets)}
{nice nice value (alias ni)}
{nivcsw total involuntary context switches}
{nsigs total signals taken (alias nsignals)}
{nswap total swaps in/out}
{nvcsw total voluntary context switches}
{nwchan wait channel (as an address)}
{oublk total blocks written (alias oublock)}
{p_ru resource usage (valid only for zombie)}
{paddr swap address}
{pagein pageins (same as majflt)}
{pgid process group number}
{pid process ID}
{ppid parent process ID}
{pri scheduling priority}
{re core residency time (in seconds; 127 = infinity)}
{rgid real group ID}
{rlink reverse link on run queue, or 0}
{rss resident set size}
{rsz resident set size + (text size / text use count) (alias rs- size)}
{ruid real user ID}
{ruser user name (from ruid)}
{sess session pointer}
{sig pending signals (alias pending)}
{sigcatch caught signals (alias caught)}
{sigignore ignored signals (alias ignored)}
{sigmask blocked signals (alias blocked)}
{sl sleep time (in seconds; 127 = infinity)}
{start time started}
{svgid saved gid from a setgid executable}
{svuid saved uid from a setuid executable}
{tdev control terminal device number}
{time accumulated cpu time, user + system (alias cputime)}
{tpgid control terminal process group ID}
{tsess control terminal session pointer}
{tsiz text size (in Kbytes)}
{tt control terminal name (two letter abbreviation)}
{tty full name of control terminal}
{ucomm name to be used for accounting}
{uid effective user ID}
{upr scheduling priority on return from system call (alias usrpri)}
{user user name (from uid)}
{vsz virtual size in Kbytes (alias vsize)}
{wchan wait channel (as a symbolic name)}
{xstat exit or stop status (valid only for stopped or zombie process)}
{logname login name of user who started the process}
}
set state_fields {
{D Process in disk (or other short term, uninterruptable) wait.}
{I Process that is idle (sleeping for longer than about 20 seconds).}
{P Process in page wait.}
{R Process is Runnable.}
{S Process is sleeping for less than about 20 seconds.}
{T Process is stopped.}
{Z Process is dead (a ``zombie'').}
{+ Process is in the foreground process group of its control terminal.}
{< Process has raised CPU scheduling priority.}
{> Process has specified a soft limit on memory requirements and is currently exceeding that limit; such a pro cess is (necessarily) not swapped.}
{A Process has asked for random page replacement (VA_ANOM, from vadvise(2), for example, lisp(1) in a garbage collect).}
{E The process is trying to exit.}
{L The process has pages locked in core (for example, for raw I/O).}
{N The process has reduced CPU scheduling priority (see setpriority(2)).}
{S The process has asked for FIFO page replacement (VA_SEQL, from vadvise(2), for example, a large image processing program using virtual memory to sequentially address voluminous data).}
{s The process is a session leader.}
{V The process is suspended during a vfork.}
{W The process is swapped out.}
{X The process is being traced or debugged.}
}
# get the doc string for a process state character (from ps -o state)
proc lookup_proc_state {char} {
global state_fields
foreach entry $state_fields {
if {$char == [string index $entry 0]} {
return $entry;
}
}
return {}
}
set PROCESS_FLAGS {
{SLOAD 0x0000001 in core}
{SSYS 0x0000002 swapper or pager process}
{SLOCK 0x0000004 process being swapped out}
{SSWAP 0x0000008 save area flag}
{STRC 0x0000010 process is being traced}
{SWTED 0x0000020 another tracing flag}
{SSINTR 0x0000040 sleep is interruptible}
{SPAGE 0x0000080 process in page wait state}
{SKEEP 0x0000100 another flag to prevent swap out}
{SOMASK 0x0000200 restore old mask after taking signal}
{SWEXIT 0x0000400 working on exiting}
{SPHYSIO 0x0000800 doing physical I/O}
{SVFORK 0x0001000 process resulted from vfork(2)}
{SVFDONE 0x0002000 another vfork flag}
{SNOVM 0x0004000 no vm, parent in a vfork}
{SPAGV 0x0008000 init data space on demand, from vnode}
{SSEQL 0x0010000 user warned of sequential vm behavior}
{SUANOM 0x0020000 user warned of random vm behavior}
{STIMO 0x0040000 timing out during sleep}
{SNOCLDSTOP 0x0080000 no SIGCHLD when children stop}
{SCTTY 0x0100000 has a controlling terminal}
{SOWEUPC 0x0200000 owe process an addupc() call at next}
{SSEL 0x0400000 selecting; wakeup/waiting danger}
{SEXEC 0x0800000 process called exec(2)}
{SHPUX 0x1000000 HP-UX process (HPUXCOMPAT)}
{SULOCK 0x2000000 locked in core after swap error}
{SPTECHG 0x4000000 pte's for process have changed}