NAME
ps - display process status information
SYNOPSIS
ps [-k|-u][-s][-p|-c|-t] [pid | taskp | command] ...
DESCRIPTION
This command displays process status for selected, or all, processes
in the system. If no arguments are entered, the process data is
is displayed for all processes. Selected process identifiers can be
entered in the following forms:
pid a process PID.
taskp a hexadecimal task_struct pointer.
command a command name. If a command name is made up of letters that
are all numerical values, precede the name string with a "\".
-k select all kernel threads.
-u select all user tasks.
The process identifier types may be mixed. For each task, the following
items are displayed:
1. the process PID.
2. the parent process PID.
3. the CPU number that the task ran on last.
4. the task_struct address or the kernel stack pointer of the process.
(see -s option below)
5. the task state (RU, IN, UN, ZO, ST, DE, SW).
6. the percentage of physical memory being used by this task.
7. the virtual address size of this task in kilobytes.
8. the resident set size of this task in kilobytes.
9. the command name.
The default output shows the task_struct address of each process under a
column titled "TASK". This can be changed to show the kernel stack
pointer under a column titled "KSTACKP".
-s replace the TASK column with the KSTACKP column.
On SMP machines, the active task on each CPU will be highlighted by an
angle bracket (">") preceding its information.
Alternatively, information regarding parent-child relationships, or
per-task time usage data may be displayed:
-p display the parental hierarchy of selected, or all, tasks.
-c display the children of selected, or all, tasks.
-t display the task run time, start time, and cumulative user
and system times.
EXAMPLES
Show the process status of all current tasks:
crash> ps
PID PPID CPU TASK ST %MEM VSZ RSS COMM
> 0 0 3 c024c000 RU 0.0 0 0 [swapper]
> 0 0 0 c0dce000 RU 0.0 0 0 [swapper]
0 0 1 c0fa8000 RU 0.0 0 0 [swapper]
> 0 0 2 c009a000 RU 0.0 0 0 [swapper]
1 0 1 c0098000 IN 0.0 1096 476 init
2 1 1 c0090000 IN 0.0 0 0 [kflushd]
3 1 1 c000e000 IN 0.0 0 0 [kpiod]
4 1 3 c000c000 IN 0.0 0 0 [kswapd]
5 1 1 c0008000 IN 0.0 0 0 [mdrecoveryd]
253 1 2 fbc4c000 IN 0.0 1088 376 portmap
268 1 2 fbc82000 IN 0.1 1232 504 ypbind
274 268 2 fa984000 IN 0.1 1260 556 ypbind
321 1 1 fabf6000 IN 0.1 1264 608 syslogd
332 1 1 fa9be000 RU 0.1 1364 736 klogd
346 1 2 fae88000 IN 0.0 1112 472 atd
360 1 2 faeb2000 IN 0.1 1284 592 crond
378 1 2 fafd6000 IN 0.1 1236 560 inetd
392 1 0 fb710000 IN 0.1 2264 1468 named
406 1 3 fb768000 IN 0.1 1284 560 lpd
423 1 1 fb8ac000 IN 0.1 1128 528 rpc.statd
434 1 2 fb75a000 IN 0.0 1072 376 rpc.rquotad
445 1 2 fb4a4000 IN 0.0 1132 456 rpc.mountd
460 1 1 fa938000 IN 0.0 0 0 [nfsd]
461 1 1 faa86000 IN 0.0 0 0 [nfsd]
462 1 0 fac48000 IN 0.0 0 0 [nfsd]
463 1 0 fb4ca000 IN 0.0 0 0 [nfsd]
464 1 0 fb4c8000 IN 0.0 0 0 [nfsd]
465 1 2 fba6e000 IN 0.0 0 0 [nfsd]
466 1 1 fba6c000 IN 0.0 0 0 [nfsd]
467 1 2 fac04000 IN 0.0 0 0 [nfsd]
468 461 2 fa93a000 IN 0.0 0 0 [lockd]
469 468 2 fa93e000 IN 0.0 0 0 [rpciod]
486 1 0 fab54000 IN 0.1 1596 880 amd
523 1 2 fa84e000 IN 0.1 1884 1128 sendmail
538 1 0 fa82c000 IN 0.0 1112 416 gpm
552 1 3 fa70a000 IN 0.1 2384 1220 httpd
556 552 3 fa776000 IN 0.1 2572 1352 httpd
557 552 2 faba4000 IN 0.1 2572 1352 httpd
558 552 1 fa802000 IN 0.1 2572 1352 httpd
559 552 3 fa6ee000 IN 0.1 2572 1352 httpd
560 552 3 fa700000 IN 0.1 2572 1352 httpd
561 552 0 fa6f0000 IN 0.1 2572 1352 httpd
562 552 3 fa6ea000 IN 0.1 2572 1352 httpd
563 552 0 fa67c000 IN 0.1 2572 1352 httpd
564 552 3 fa674000 IN 0.1 2572 1352 httpd
565 552 3 fa66a000 IN 0.1 2572 1352 httpd
582 1 2 fa402000 IN 0.2 2968 1916 xfs
633 1 2 fa1ec000 IN 0.2 5512 2248 innd
636 1 3 fa088000 IN 0.1 2536 804 actived
676 1 0 fa840000 IN 0.0 1060 384 mingetty
677 1 1 fa590000 IN 0.0 1060 384 mingetty
678 1 2 fa3b8000 IN 0.0 1060 384 mingetty
679 1 0 fa5b8000 IN 0.0 1060 384 mingetty
680 1 1 fa3a4000 IN 0.0 1060 384 mingetty
681 1 2 fa30a000 IN 0.0 1060 384 mingetty
683 1 3 fa5d8000 IN 0.0 1052 280 update
686 378 1 fa3aa000 IN 0.1 2320 1136 in.rlogind
687 686 2 f9e52000 IN 0.1 2136 1000 login
688 687 0 f9dec000 IN 0.1 1732 976 bash
> 700 688 1 f9d62000 RU 0.0 1048 256 gen12
Display the parental hierarchy of the "crash" process on a live system:
crash> ps -p 4249
PID: 0 TASK: c0252000 CPU: 0 COMMAND: "swapper"
PID: 1 TASK: c009a000 CPU: 1 COMMAND: "init"
PID: 632 TASK: c73b6000 CPU: 1 COMMAND: "prefdm"
PID: 637 TASK: c5a4a000 CPU: 1 COMMAND: "prefdm"
PID: 649 TASK: c179a000 CPU: 0 COMMAND: "kwm"
PID: 683 TASK: c1164000 CPU: 0 COMMAND: "kfm"
PID: 1186 TASK: c165a000 CPU: 0 COMMAND: "xterm"
PID: 1188 TASK: c705e000 CPU: 1 COMMAND: "bash"
PID: 4249 TASK: c6b9a000 CPU: 0 COMMAND: "crash"
Display all children of the "kwm" window manager:
crash> ps -c kwm
PID: 649 TASK: c179a000 CPU: 0 COMMAND: "kwm"
PID: 682 TASK: c2d58000 CPU: 1 COMMAND: "kwmsound"
PID: 683 TASK: c1164000 CPU: 1 COMMAND: "kfm"
PID: 685 TASK: c053c000 CPU: 0 COMMAND: "krootwm"
PID: 686 TASK: c13fa000 CPU: 0 COMMAND: "kpanel"
PID: 687 TASK: c13f0000 CPU: 1 COMMAND: "kbgndwm"
Show the time usage data for pid 18844:
crash> ps -t 18844
PID: 18844 TASK: c3012000 CPU: 0 COMMAND: "bash"
RUN TIME: 00:31:23
START TIME: 51390045
USER TIME: 1
SYSTEM TIME: 3
Show the process status of PID 1, task f9dec000, and all nfsd tasks:
crash> ps 1 f9dec000 nfsd
PID PPID CPU TASK ST %MEM VSZ RSS COMM
1 0 1 c0098000 IN 0.0 1096 476 init
688 687 0 f9dec000 IN 0.1 1732 976 bash
460 1 1 fa938000 IN 0.0 0 0 [nfsd]
461 1 1 faa86000 IN 0.0 0 0 [nfsd]
462 1 0 fac48000 IN 0.0 0 0 [nfsd]
463 1 0 fb4ca000 IN 0.0 0 0 [nfsd]
464 1 0 fb4c8000 IN 0.0 0 0 [nfsd]
465 1 2 fba6e000 IN 0.0 0 0 [nfsd]
466 1 1 fba6c000 IN 0.0 0 0 [nfsd]
467 1 2 fac04000 IN 0.0 0 0 [nfsd]
Show all kernel threads:
crash> ps -k
PID PPID CPU TASK ST %MEM VSZ RSS COMM
0 0 1 c0fac000 RU 0.0 0 0 [swapper]
0 0 0 c0252000 RU 0.0 0 0 [swapper]
2 1 1 c0fa0000 IN 0.0 0 0 [kflushd]
3 1 1 c03de000 IN 0.0 0 0 [kpiod]
4 1 1 c03dc000 IN 0.0 0 0 [kswapd]
5 1 0 c0092000 IN 0.0 0 0 [mdrecoveryd]
336 1 0 c4a9a000 IN 0.0 0 0 [rpciod]
337 1 0 c4830000 IN 0.0 0 0 [lockd]
487 1 1 c4ba6000 IN 0.0 0 0 [nfsd]
488 1 0 c18c6000 IN 0.0 0 0 [nfsd]
489 1 0 c0cac000 IN 0.0 0 0 [nfsd]
490 1 0 c056a000 IN 0.0 0 0 [nfsd]
491 1 0 c0860000 IN 0.0 0 0 [nfsd]
492 1 1 c0254000 IN 0.0 0 0 [nfsd]
493 1 0 c0a86000 IN 0.0 0 0 [nfsd]
494 1 0 c0968000 IN 0.0 0 0 [nfsd]
Show the kernel stack pointer of each user task:
crash> ps -us
PID PPID CPU KSTACKP ST %MEM VSZ RSS COMM
1 0 0 c009bedc IN 0.0 1096 52 init
239 1 0 c15e7ed8 IN 0.2 1332 224 pump
280 1 1 c7cbdedc IN 0.2 1092 208 portmap
295 1 0 c7481edc IN 0.0 1232 0 ypbind
301 295 0 c7c7bf28 IN 0.1 1260 124 ypbind
376 1 1 c5053f28 IN 0.0 1316 40 automount
381 1 0 c34ddf28 IN 0.2 1316 224 automount
391 1 1 c2777f28 IN 0.2 1316 224 automount
...
|