pstree ( process tree)
- ps ¿¡ ÀÇÇØ Ãâ·ÂµÇ´Â ÇÁ·Î¼¼½º Á¤º¸¸¦ Æ®¸® ÇüÅ·Π³ªÅ¸³À´Ï´Ù.
¸Å´º¾ó
NAME
pstree - display a tree of processes
SYNOPSIS
pstree [-a] [-c] [-h|-Hpid] [-l] [-n] [-p] [-u] [-Z] [-A|-G|-U]
[pid|user]
pstree -V
DESCRIPTION
pstree shows running processes as a tree. The tree is rooted at either
pid or init if pid is omitted. If a user name is specified, all process
trees rooted at processes owned by that user are shown.
pstree visually merges identical branches by putting
them in square
brackets and prefixing them with the repetition count, e.g.
init-+-getty
|-getty
|-getty
'-getty
becomes
init---4*[getty]
Child threads of a process are found under the parent
process and are
shown with the process name in curly braces, e.g.
icecast2---13*[{icecast2}]
If pstree is called as pstree.x11 then it will prompt the user at the
end of the line to press return and will not return until that has hap-
pened. This is useful for when pstree is run in a xterminal.
OPTIONS
-a Show command line
arguments. If the command line of a process is
swapped out, that process is
shown in parentheses. -a implicitly
disables compaction.
-A Use ASCII characters to
draw the tree.
-c Disable compaction of
identical subtrees. By default, subtrees
are compacted whenever possible.
-G Use VT100 line drawing
characters.
-h Highlight the current
process and its ancestors. This is a no-op
if the terminal doesn't support
highlighting or if neither the
current process
nor any of its
ancestors are in the subtree
being shown.
-H Like -h, but highlight
the specified process
instead. Unlike
with -h,
pstree fails when
using -H if highlighting is not
available.
-l Display long lines. By default, lines are
truncated to the dis-
play width or 132 if output is sent to a non-tty
or if the dis-
play width is unknown.
-n Sort processes with the
same ancestor by PID instead of by name.
(Numeric sort.)
-p Show PIDs.
PIDs are shown
as decimal numbers in parentheses
after each process name. -p
implicitly disables compaction.
-u Show uid transitions.
Whenever the uid of a process differs from
the uid of its parent, the new
uid is shown in parentheses after
the process name.
-U Use UTF-8 (Unicode) line
drawing characters. Under Linux 1.1-54
and above,
UTF-8 mode is entered on the console with echo -e
'\033%8' and left with echo -e
'\033%@'
-V Display version
information.
-Z (SELinux) Show security
context for each process.
FILES
/proc location of the proc
file system
AUTHORS
Werner Almesberger <werner@almesberger.net> Craig
Small
<csmall@small.dropbear.id.au>
BUGS
Some character sets may be incompatible with the VT100 characters.
SEE ALSO
ps(1), top(1).
top
- cpu¿Í ¸Þ¸ð¸®¸¦ »ç¿ëÇÏ´Â ÀÛ¾÷µé¿¡ ´ëÇÑ ½Ã½ºÅÛ Á¤º¸¸¦ Ãâ·ÂÇÕ´Ï´Ù.
[TOP ½ÇÇàÁß Á¤·ÄÇϱâ]
SHIFT+P : CPU »ç¿ë·üÀÌ ¸¹Àº ÇÁ·Î¼¼½º ¼ø¼´ë·Î Á¤·Ä
SHIFT+M : MEMORY »ç¿ë·üÀÌ ¸¹Àº ÇÁ·Î¼¼½º ¼ø¼´ë·Î Á¤·Ä
SHIFT+T : ½ÇÇà½Ã°£ÀÌ ¿À·¡µÈ ÇÁ·Î¼¼½º ¼ø¼´ë·Î Á¤·Ä
SHIFT + b : ÁÖ¿ä°ªÀ» ¹à°ÔÇ¥½Ã
[TOP ½ÇÇàÁß »ç¿ë°¡´É ¸í·É¾î]
i : idle ÇÁ·Î¼¼½º¸¦ º¸ÀÌÁö¾Ê´Â´Ù. (Running »óÅÂÀÇ ÇÁ·Î¼¼½ºµé¸¸ È®ÀÎ)
k : ÇÁ·Î¼¼½º¸¦ Á×À϶§ »ç¿ë. PID¸¦ ÀÔ·ÂÇÏ¿© ÇÁ·Î¼¼½º¸¦ Á¾·á½ÃŲ´Ù.
r : ÇÁ·Î¼¼½º ¿ì¼±¼øÀ§ º¯°æ. PID¸¦ ÀÔ·ÂÇÏ¿© ÇÁ·Î¼¼½º ¿ì¼±¼øÀ§¸¦ º¯°æÇÑ´Ù. ¿ì¼±¼øÀÇ °ªÀº (+20 ~ -20±îÁö), renice ¸í·É¾î¿Í °°Àº¿ªÇÒ.
u : ƯÁ¤»ç¿ëÀÚ°¡ ½ÇÇàÇÑ ÇÁ·Î¼¼½º È®ÀÎ. UID¸¦ ÀÔ·ÂÇÏ¿© ÇÁ·Î¼¼½º¸¦ È®ÀÎÇÑ´Ù.
[Çʵå]
ÇʵåÆíÁý : ½ÇÇàÁß
'o' ÀÔ·Â
PRI : ÇÁ·Î¼¼½ºÀÇ ¿ì¼±¼øÀ§
NI : ÇÁ·Î¼¼½ºÀÇ NICE °ª
RES : Resident Size (»óÁÖ¸Þ¸ð¸®)
MAN ÆäÀÌÁöÂü°í
2a.
DESCRIPTIONS of Fields
Listed below are top¡¯s available fields. They are always associated
with the letter shown, regardless of the position you may have
established for them with the ¡¯o¡¯ (Order fields) interactive command.
Any field is selectable as the sort field, and you
control whether they are sorted high-to-low or low-to-high. For
additional information on sort provisions see topic 3c. TASK Area Commands.
a: PID
-- Process Id
The task¡¯s unique process ID, which
periodically wraps, though never restarting at zero.
b: PPID
-- Parent Process Pid
The process ID of a task¡¯s parent.
c: RUSER
-- Real User Name
The real user name of the task¡¯s owner.
d: UID
-- User Id
The effective user ID of the task¡¯s
owner.
e: USER
-- User Name
The effective user name of the task¡¯s
owner.
f: GROUP
-- Group Name
The effective group name of the task¡¯s
owner.
g: TTY --
Controlling Tty
The name of the
controlling terminal. This is usually the device (serial port, pty, etc.)
from which the process was started, and which it uses
for input or output. However, a task need not be associated with a
terminal, in which case you¡¯ll see ¡¯?¡¯ displayed.
h: PR
-- Priority
The priority of the task.
i: NI -- Nice value
The nice
value of the task. A negative nice value means higher priority,
whereas a positive nice value means lower priority. Zero in this field
simply means priority will not be adjusted in determining a task¡¯s dispatchability.
j: #C
-- Last used CPU (SMP)
A number representing the last used processor. In a true SMP environment
this will likely change frequently since the kernel
intentionally uses weak affinity. Also,
the very act of running top may break this weak
affinity and cause more processes to change CPUs more often (because of
the extra demand for cpu time).
k: %CPU
-- CPU usage
The task¡¯s share of the elapsed CPU time
since the last screen update, expressed as a percentage of total CPU
time. In a true SMP environ-ment, if ¡¯Irix mode¡¯ is Off, top will
operate in ´Solaris mode¡¯ where
a task¡¯s cpu usage will be divided by the total number
of CPUs. You toggle ¡¯Irix/Solaris¡¯ modes with the ¡¯I¡¯
interactive command.
l: TIME
-- CPU Time
Total CPU time the task has used since it started. When ¡¯Cumulative mode¡¯ is On, each
process is listed with the cpu time that it and
its dead children has used. You toggle ¡¯Cumulative
mode¡¯ with ¡¯S¡¯, which is a command-line option and an interactive command.
See the ¡¯S¡¯ inter-active
command for additional information regarding this mode.
m: TIME+
-- CPU Time, hundredths
The same as ¡¯TIME¡¯, but reflecting more
granularity through hundredths of a second.
n: %MEM
-- Memory usage (RES)
A task¡¯s currently used share of available
physical memory.
o: VIRT
-- Virtual Image (kb)
The total amount of virtual memory used by the task. It includes all
code, data and shared libraries plus pages that have been swapped out.
VIRT = SWAP + RES.
p: SWAP
-- Swapped size (kb)
The swapped out portion of a task¡¯s
total virtual memory image.
q: RES
-- Resident size (kb)
The non-swapped physical
memory a task has used.
RES = CODE + DATA.
r: CODE
-- Code size (kb)
The amount of physical memory devoted to executable code, also known as the ¡¯text resident set¡¯ size or TRS.
s: DATA
-- Data+Stack size (kb)
The amount of physical memory devoted to other than executable code, also known
as the ¡¯data resident set¡¯ size or DRS.
t: SHR -- Shared Mem
size (kb)
The amount of shared memory used by a task. It simply reflects memory
that could be potentially shared with other processes.
u: nFLT
-- Page Fault count
The number of major page faults that have occurred for a task. A page
fault occurs when a process attempts to read from or write to a
virtual page that is not currently present in its address space. A
major page fault is when disk access is involved in making that page available.
v: nDRT
-- Dirty Pages count
The number of pages that have been modified since they were last written
to disk. Dirty pages must be written to disk before the corresponding
physical memory location can be used for some other virtual page.
w: S
-- Process Status
The status of the task which can be one of:
¡¯D¡¯ = uninterruptible sleep
¡¯R¡¯ = running
¡¯S¡¯ = sleeping
¡¯T¡¯ = traced or stopped
¡¯Z¡¯ = zombie
Tasks shown as running should be more properly thought of as ¡¯ready to run¡¯ --
their task_struct is simply represented on the Linux
run queue. Even without a true SMP machine, you may see numerous
tasks in this state depending on top¡¯s delay interval
and nice value.
x: Command --
Command line or Program name
Display the command line used to start a task or the name of the associated
program. You toggle between command line and name with ¡¯c¡¯, which is both a
command-line option and an interactive command.
When you¡¯ve chosen to display command lines,
processes without a command line (like kernel threads) will be shown with only
the program name in parentheses, as in this example: (
mdrecoveryd )
Either form of display is subject to potential
truncation if it¡¯s too long to fit in this field¡¯s current width. That width depends upon other fields
selected, their order and the current screen width.
Note: The ¡¯Command¡¯
field/column is unique, in that it is not fixed-width. When displayed,
this column will be allocated all remaining screen width (up to the
maximum 512 characters) to provide for the potential growth of program names
into command lines.
y: WCHAN
-- Sleeping in Function
Depending on
the availability of the kernel link map (¡¯System.map¡¯), this field will show the name
or the address of the kernel function in which the task is currently
sleeping. Running tasks will display a dash (¡¯-¡¯) in this column.
Note: By displaying this field, top¡¯s
own working set will be increased by over 700Kb. Your only means of
reducing that overhead will be to
stop and restart top.
z: Flags
-- Task Flags
This column represents the task¡¯s current
scheduling flags which are expressed in hexadecimal notation and with zeros
suppressed. These flags are officially documented in
<linux/sched.h>. Less formal documentation can also be found on the
¡¯Fields select¡¯ and ¡¯Order fields¡¯ screens.
2b. SELECTING and ORDERING
Columns
After pressing the interactive commands ¡¯f¡¯ (Fields select) or ´o¡¯ (Order fields) you will be shown a screen containing the current
fields string followed by names and descriptions for all fields.
Here is a sample fields string from one of top¡¯s four windows/field groups and an explanation of the conventions
used:
- Sample fields string:
ANOPQRSTUVXbcdefgjlmyzWHIK
- The order of displayed fields corresponds to the order of the letters
in that string.
- If the letter is upper case the corresponding field itself will then be
shown as part of the task display (screen width
permitting). This will also be indicated by a leading
asterisk (¡¯*¡¯), as in
this excerpt:
...
* K: %CPU = CPU usage
l: TIME = CPU Time
m: TIME+ = CPU Time, hundredths
* N: %MEM = Memory usage (RES)
* O: VIRT = Virtual Image (kb)
...
Fields select screen -- the ¡¯f¡¯ interactive command
You toggle the display
of a field by simply pressing the corresponding letter.
Order fields screen -- the ¡¯o¡¯ interactive command
You move a field to the
left by pressing the corresponding upper case letter and to the right with the
lower case letter.
[Ãâó] [LINUX]
top|ÀÛ¼ºÀÚ À¸¶ùÂ÷Â÷