| psh | Index Level | pverify |
| Syntax | psr {port.number} {(options} |
| Category | TCL |
| Type | Verb |
| Description |
displays formatted output of the status of the currently active Unix and/or Pick processes.
Whenever possible, this command tries to identify the Pick process from the status returned by the Unix command "ps". If "port.number" is specified, the output shows process information related to the Pick process port and its child processes. This argument supersedes the "r" and "k" options. This command displays the following: "PID" is the Unix Process-id. "PPID" is the Unix process id of the parent process. "TTY" is the device name where the process is connected. "CPU" is the cumulative Unix CPU time in minutes:seconds, or '+n' where n is the number of seconds accumulated in the given sampling period if the (D) option was used (release 6.1 only). "S" is the Unix process status: R : running S : suspended T : terminated W : Waiting for IO Z : zombie (defunct). "PORT.NUMBER" is the Pick port number. "USER" If the process is connected to the current virtual machine, this is its user-id. "ACCOUNT" If the process is connected to the current virtual machine, this is its master dictionary. "STAT" If the process is connected to the current virtual machine, this is its Pick status (See the "where" verb). "MODE/COMMAND" If the process is connected to the current virtual machine, this is the name of the virtual mode it is currently executing. If not, it is the name of the Unix command it is executing. Note that if this command is "ap", this probably means that the process is connected to another virtual machine. The form, "psr port.number", is useful to identify all processes spawned by a Pick process. For example, if a process pushes a level and executes another "ap" command, it is not easy to find the relationship between the two Pick processes (one is actually the grand child of the other). The form "psr (r" allows detecting processes which are consuming CPU. By repeating this command after a few second intervals, it is easy to identify processes looping or having hardware related problems (too many serial interrupts, for instance). On releases 6.1 and later, the form 'psr (sr' is an alternative to 'psr (r' to show running processes. It allows taking a sample on a longer period, thus catching processes running often, but not for a long time. |
| Options |
d{n} Show the delta (accumulated) time, instead of the absolute running time, within the specified period. This option implies (R) and (S) options. Valid on on 6.1.
k Shows only the processes running in Pick. p Directs output to system printer, via the Spooler. r Shows only the Running processes. s{n} Select running processes by a doing two 'ps' commands, separated by a specified sampling period 'n' (default 1s), and comparing the CPU usage of the processes. |
| See Also | d3 pid port.number where pid kill (D3/Unix) ! (Unix) pick |
| Example |
psr
PID PPID TTY CPU S PORT USER ACCOUNT STAT MODE/COMMAND 1 0 - 18:08 S init 1973 1 - 1:04 S syncd 3071 1 10/0 421:23 R ap 3255 1 - 0:01 S errdemon 3762 1 112/0 0:00 S 072 F310 md0:00C 4270 1 108/0 0:00 S 068 F310 md0:00C 4368 1 - 0:00 S srcmstr 5028 4368 - 0:00 S writesrv 5283 1 89/0 0:00 S 057 dm dm F310 tcl.input:000 5615 1 102/0 0:20 S pxproute 6053 1 91/0 0:15 S 059 F310 rdl.getchar:000 6314 4368 - 0:00 S qdaemon 6513 1 2/0 0:00 S 002 F310 rdl.getchar:000 7110 1 0 0:00 S 128 BF10 sp.sleep:040 psr (d3 PID PPID TTY CPU S PORT USER ACCOUNT STAT MODE/COMMAND 3071 1 10/0 +3 R ap This command takes two samples at 3 second interval and show the time accumulated by the running process. In this example, the process 'ap' has consumed 3 seconds (the whole sampling period), which is an indication of a potential problem. |
| Warnings |
The psr command can be intrusive.
The options (S{n}) and (D{n}) are valid only on release 6.1. |
| Compatibility | D3/Unix |
| psh | Index Level | pverify |