Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15357608
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类:

2010-04-05 22:14:18

Help for Interactive Commands - procps version 3.2.8
Window 1:Def: Cumulative mode Off.  System: Delay 3.0 secs; Secure mode Off.

  Z,B       Global: 'Z' change color mappings; 'B' disable/enable bold
  l,t,m     Toggle Summaries: 'l' load avg; 't' task/cpu stats; 'm' mem info
  1,I       Toggle SMP view: '1' single/separate states; 'I' Irix/Solaris mode

  f,o     . Fields/Columns: 'f' add or remove; 'o' change display order
  F or O  . Select sort field
  <,>     . Move sort field: '<' next col left; '>' next col right
  R,H     . Toggle: 'R' normal/reverse sort; 'H' show threads
  c,i,S   . Toggle: 'c' cmd name/line; 'i' idle tasks; 'S' cumulative time
  x,y     . Toggle highlights: 'x' sort field; 'y' running tasks
  z,b     . Toggle: 'z' color/mono; 'b' bold/reverse (only if 'x' or 'y')
  u       . Show specific user only
  n or #  . Set maximum tasks displayed

  k,r       Manipulate tasks: 'k' kill; 'r' renice
  d or s    Set update interval
  W         Write configuration file
  q         Quit
          ( commands shown with '.' require a visible task display window )
Press 'h' or '?' for help with Windows,
any other key to continue

top命令和ps命令的基本作用是相同的,显示系统当前的进程和其它状况;但是top是 一个动态显示过程,即可以通过用户按键来不断刷新当前状态。如果在前台执行该命令,它将独占前台,直到用户终止该程序为止。比较准确的说,top命令提供 了实时的对系统处理器的状态监视。它将显示系统中CPU最“敏感”的任务列表。该命令可以按CPU使用。内存使用和执行时间对任务进行排序;而且该命令的 很多特性都可以通过交互式命令或者在个人定制文件中进行设定。在后面的介绍中将把命令参数和交互命令分开讲述。

下面是该命令的语法格式:
top [-] [d delay] [q] [c] [s] [S]
d 指定每两次屏幕信息刷新之间的时间间隔。当然用户可以使用s交互命令来改变之。
q 该选项将使top没有任何延迟的进行刷新。如果调用程序有超级用户权限,那幺top将以尽可能高的优先级运行。
S 指定累计模式。
s 使top命令在安全模式中运行。这将去除交互命令所带来的潜在危险。
i 使top不显示任何闲置或者僵死进程。
c 显示整个命令行而不只是显示命令名
top命令显示的项目很多,默认值是每5秒更新一次,当然这是可以设置的。显示的各项目为:
uptime 该项显示的是系统启动时间、已经运行的时间和三个平均负载值(最近1秒,5秒,15秒的负载值)。
processes

自最近一次刷新以来的运行进程总数。当然这些进程被分为正在运行的,休眠的,停止的等很多种类。进程和状态显示可以通过交互命令t来实现。

CPU states

显示用户模式,系统模式,优先级进程(只有优先级为负的列入考虑)和闲置等各种情况所占用CPU时间的百分比。优先级进程所消耗的时间也被列入到 用户 和系统的时间中,所以总的百分比将大于100%。Mem 内存使用情况统计,其中包括总的可用内存,空闲内存,已用内存,共享内存和缓存所占内存的情况。
Swap 交换空间统计,其中包括总的交换空间,可用交换空间,已用交换空间。
PID 每个进程的ID。
PPID 每个进程的父进程ID。
UID 每个进程所有者的UID 。
USER 每个进程所有者的用户名。
PRI 每个进程的优先级别。
NI 该进程的优先级值。
SIZE 该进程的代码大小加上数据大小再加上堆栈空间大小的总数。单位是KB。
TSIZE 该进程的代码大小。对于内核进程这是一个很奇怪的值。
DSIZE 数据和堆栈的大小。
TRS 文本驻留大小。
D 被标记为“不干净”的页项目。
LIB 使用的库页的大小。对于ELF进程没有作用。
RSS 该进程占用的物理内存的总数量,单位是KB。
SHARE 该进程使用共享内存的数量。
STAT 该进程的状态。其中S代表休眠状态;D代表不可中断的休眠状态;R代表运行状态;Z代表僵死状态;T代表停止或跟踪状态。
TIME 该进程自启动以来所占用的总CPU时间。如果进入的是累计模式,那幺该时间还包括这个进程子进程所占用的时间。且标题会变成CTIME。%CPU 该进程自最近一次刷新以来所占用的CPU时间和总时间的百分比。%MEM 该进程占用的物理内存占总内存的百分比。
COMMAND 该进程的命令名称,如果一行显示不下,则会进行截取。内存中的进程会有一个完整的命令行。

下面介绍在top命令执行过程中可以使用的一些交互命令。从使用角度来看,熟练的掌握这些命令比掌握选项还重要一些。这些命令都是单字母的,如果 在命令行选项中使用了s选项,则可能其中一些命令会被屏蔽掉。
<空格>; 立即刷新显示。
Ctrl+L 擦除并且重写屏幕。
h或者? 显示帮助画面,给出一些简短的命令总结说明。
k 终止一个进程。系统将提示用户输入需要终止的进程PID,以及需要发送给该进程什幺样的信号。一般的终止进程可以使用15信号;如果不能正常结束那就使用 信号9强制结束该进程。默认值是信号15。在安全模式中此命令被屏蔽。
i 忽略闲置和僵死进程。这是一个开关式命令。
q 退出程序。
r 重新安排一个进程的优先级别。系统提示用户输入需要改变的进程PID以及需要设置的进程优先级值。输入一个正值将使优先级降低,反之则可以使该进程拥有更 高的优先权。默认值是10。
S 切换到累计模式。
s 改变两次刷新之间的延迟时间。系统将提示用户输入新的时间,单位为s。如果有小数,就换算成ms。输入0值则系统将不断刷新,默认值是5 s。需要注意的是如果设置太小的时间,很可能会引起不断刷新,从而根本来不及看清显示的情况,而且系统负载也会大大增加。
f或者F 从当前显示中添加或者删除项目。
o或者O 改变显示项目的顺序。
l 切换显示平均负载和启动时间信息。
m 切换显示内存信息。
t 切换显示进程和CPU状态信息。
c 切换显示命令名称和完整命令行。
M 根据驻留内存大小进行排序。
P 根据CPU使用百分比大小进行排序。
T 根据时间/累计时间进行排序。
W 将当前设置写入~/.toprc文件中。这是写top配置文件的推荐方法。
从上面的介绍中可以看到,top命令是一个功能十分强大的监控系统的工具,尤其对于系统管理员而言更是如此。一般的用户可能会觉得ps命令其实就 够用了,但是top命令的强劲功能确实提供了不少方便。下面来看看实际使用的情况。

[例] 键入top命令查看系统状况
第一行的项目依次为当前时间、系统启动时间、当前系统登录用户数目、平均负载。
第二行为进程情况,依次为进程总数、休眠进程数、运行进程数、僵死进程数、终止进程数。
第三行为CPU状态,依次为用户占用、系统占用、优先进程占用、闲置进程占用。
第四行为内存状态,依次为平均可用内存、已用内存、空闲内存、共享内存、缓存使用内存。
第五行为交换状态,依次为平均可用交换容量、已用容量、闲置容量、高速缓存容量。然后下面就是和ps相仿的各进程情况列表了。总的来说,top命 令的功能强于ps,但需要长久占用前台,所以用户应该根据自己的情况来使用这个命令。
$ top
1:55pm up 7 min, 4 user, load average:0.07,0.09,0.06
29 processes:28 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 4.5% user, 3.6% system, 0.0% nice, 91.9%
idle
Mem: 38916K av, 18564K used, 20352K free, 11660K shrd,
1220K buff
Swap: 33228K av, 0K used, 33228K free, 11820K cached
PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME
COMMAND
363 root 14 0 708 708 552 R 0 8.1 1.8 0:00 top
1 root 0 0 404 404 344 S 0 0.0 1.0 0:03 init
2 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kflushd
3 root -12 -12 0 0 0 SW< 0 0.0 0.0 0:00 kswapd
4 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 md_thread
5 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 md_thread
http://tonyxu841106.javaeye.com/blog/569532
=============================================

Linux top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器。这个工具也可以在 VMware ESX上使用,和ESX上的esxtop有异曲同工的效果,下边的内容某些和esxtop适用


统计信息区
     前五行是系统整体的统计信息。第一行是任务队列信息,同 uptime 命令的执行结果。其内容如下:

13:44:29 当前时间
up 12 days, 1:57 系统运行时间,格式为时:分
5 user 当前登录用户数
load average: 0.14, 0.06, 0.01 系统负载,即任务队列的平均长度。
三个数值分别为 1分钟、5分钟、15分钟前到现在的平均值。

Note:load average:1.00 则该服务器CPU得到充分利用,如果数值是0.50则是利用到一半的CPU.2.00表示CPU正忙. load average:4.00这时候CPU处在高利用的阶段,同时系统性能也会受到影响.

第二、三行为进程和CPU的信息。当有多个CPU时,这些内容可能会超过两行。内容如下:
Tasks: 210 total 进程总数
        207 sleeping 睡眠的进程数
        3 running 正在运行的进程数
        0 zombie 僵尸进程数
           0 stopped 停止的进程数

0.1% user 用户空间占用CPU百分比
         0.0% nice 用户进程空间内改变过优先级的进程占用CPU百分比
         0.0% system 内核空间占用CPU百分比
0.0% irq 处理硬件中断请求的CPU处理时间百分比
1.3% softirq处理软件中断请求的CPU处理时间百分比
        12.1% iowait 等待输入输出的CPU时间百分比
        86.2% idle 空闲CPU百分比
下面这个截屏是空闲CPU为0%的状态:

从这个截屏中看到CPU被消耗在iowait,如果CPU是否消耗在iowait.可以检查磁盘子系统, 检查磁盘子系统,在存储子系统确定是什么引起响应延迟原因.

最后两行为内存信息。内容如下:
    Mem: 268248k total 物理内存总量
    183384k used 使用的物理内存总量
    84864k free 空闲内存总量
    17616k buffers 用作内核缓存的内存量
    Swap: 554168k total 交换区总量
    51016 used 使用的交换区总量
    503152k free 空闲交换区总量
    49908k cached 缓冲的交换区总量。
    内存中的内容被换出到交换区,而后又被换入到内存,但使用过的交换区尚未被覆盖,
    该数值即为这些内容已存在于内存中的交换区的大小。
    相应的内存再次被换出时可不必再对交换区写入。
进程信息区
    统计信息区域的下方显示了各个进程的详细信息。首先来认识一下各列的含义。
    序号 列名 含义
    a PID 进程id
    b PPID 父进程id
    c RUSER Real user name
    d UID 进程所有者的用户id
    e USER 进程所有者的用户名
    f GROUP 进程所有者的组名
    g TTY 启动进程的终端名。不是从终端启动的进程则显示为 ?
    h PR 优先级
    i NI nice值。负值表示高优先级,正值表示低优先级
    j P 最后使用的CPU,仅在多CPU环境下有意义
    k %CPU 上次更新到现在的CPU时间占用百分比
    l TIME 进程使用的CPU时间总计,单位秒
    m TIME+ 进程使用的CPU时间总计,单位1/100秒
    n %MEM 进程使用的物理内存百分比
    o VIRT 进程使用的虚拟内存总量,单位kb。VIRT=SWAP+RES
    p SWAP 进程使用的虚拟内存中,被换出的大小,单位kb。
    q RES 进程使用的、未被换出的物理内存大小,单位kb。RES=CODE+DATA
    r CODE 可执行代码占用的物理内存大小,单位kb
    s DATA 可执行代码以外的部分(数据段+栈)占用的物理内存大小,单位kb
    t SHR 共享内存大小,单位kb
    u nFLT 页面错误次数
    v nDRT 最后一次写入到现在,被修改过的页面数。
    w S 进程状态。
    D=不可中断的睡眠状态
    R=运行
    S=睡眠
    T=跟踪/停止
    Z=僵尸进程
    x COMMAND 命令名/命令行
    y WCHAN 若该进程在睡眠,则显示睡眠中的系统函数名
    z Flags 任务标志,参考 sched.h
    默认情况下仅显示比较重要的 PID、USER、PR、NI、VIRT、RES、SHR、S、%CPU、%MEM、TIME+、COMMAND 列。可以通过下面的快捷键来更改显示内容。
更改显示内容
    通过 f 键可以选择显示的内容。按 f 键之后会显示列的列表,按 a-z 即可显示或隐藏对应的列,最后按回车键确定。
    按 o 键可以改变列的显示顺序。按小写的 a-z 可以将相应的列向右移动,而大写的 A-Z 可以将相应的列向左移动。最后按回车键确定。
    按大写的 F 或 O 键,然后按 a-z 可以将进程按照相应的列进行排序。而大写的 R 键可以将当前的排序倒转。
命令使用
    1. 工具(命令)名称
    top
    2.工具(命令)作用
    显示系统当前的进程和其他状况; top是一个动态显示过程,即可以通过用户按键来不断刷新当前状态.如果在前台执行该命令,它将独占前台,直到用户终止该程序为止. 比较准确的说,top命令提供了实时的对系统处理器的状态监视.它将显示系统中CPU最“敏感”的任务列表.该命令可以按CPU使用.内存使用和执行时间 对任务进行排序;而且该命令的很多特性都可以通过交互式命令或者在个人定制文件中进行设定.
    3.环境设置
    在Linux下使用。
    4.使用方法
    4.1使用格式
    top [-] [d] [p] [q] [c] [C] [S] [s]  [n]
    4.2参数说明
     d 指定每两次屏幕信息刷新之间的时间间隔。当然用户可以使用s交互命令来改变之。
     p 通过指定监控进程ID来仅仅监控某个进程的状态。
     q该选项将使top没有任何延迟的进行刷新。如果调用程序有超级用户权限,那么top将以尽可能高的优先级运行。
     S 指定累计模式
     s 使top命令在安全模式中运行。这将去除交互命令所带来的潜在危险。
     i  使top不显示任何闲置或者僵死进程。
     c  显示整个命令行而不只是显示命令名
    4.3其他
       下面介绍在top命令执行过程中可以使用的一些交互命令。从使用角度来看,熟练的掌握这些命令比掌握选项还重要一些。这些命令都是单字母的,如果在 命令行选项中使用了s选项,则可能其中一些命令会被屏蔽掉。
      Ctrl+L 擦除并且重写屏幕。
      h或者? 显示帮助画面,给出一些简短的命令总结说明。
      k 终止一个进程。系统将提示用户输入需要终止的进程PID,以及需要发送给该进程什么样的信号。一般的终止进程可以使用15信号;如果不能正常结束那就使用 信号9强制结束该进程。默认值是信号15。在安全模式中此命令被屏蔽。
      i 忽略闲置和僵死进程。这是一个开关式命令。
      q 退出程序。
      r 重新安排一个进程的优先级别。系统提示用户输入需要改变的进程PID以及需要设置的进程优先级值。输入一个正值将使优先级降低,反之则可以使该进程拥有更 高的优先权。默认值是10。
      S 切换到累计模式。
      s 改变两次刷新之间的延迟时间。系统将提示用户输入新的时间,单位为s。如果有小数,就换算成m s。输入0值则系统将不断刷新,默认值是5 s。需要注意的是如果设置太小的时间,很可能会引起不断刷新,从而根本来不及看清显示的情况,而且系统负载也会大大增加。
      f或者F 从当前显示中添加或者删除项目。
      o或者O 改变显示项目的顺序。
      l 切换显示平均负载和启动时间信息。
      m 切换显示内存信息。
      t 切换显示进程和CPU状态信息。
      c 切换显示命令名称和完整命令行。
      M 根据驻留内存大小进行排序。
      P 根据CPU使用百分比大小进行排序。
      T 根据时间/累计时间进行排序。
        W 将当前设置写入~/.toprc文件中。这是写top配置文件的推荐方法。

例如要每两秒收集一次TOP里的信息,一共要收集100次.然后输出文件名为123.csv:
top –b –d 2 –n 100 >/tmp/123.csv
这样我们可以把123.csv拿到Windows去做分析,这个方法也适合VMware ESX 上的esxtop,使用方法也是一样:
esxtop –b –d 2 –n 100 >/tmp/123.csv
=====================================
Global_defaults
   'A' - Alt display      Off (full-screen)
 * 'd' - Delay time       3.0 seconds
   'I' - Irix mode        On  (no, 'solaris' smp)
 * 'p' - PID monitoring   Off
 * 's' - Secure mode      Off (unsecured)
   'B' - Bold enable      Off
Summary_Area_defaults
   'l' - Load Avg/Uptime  On  (thus program name)
   't' - Task/Cpu states  On  (1+1 lines, see '1')
   'm' - Mem/Swap usage   On  (2 lines worth)
   '1' - Single Cpu       On  (thus 1 line if smp)
Task_Area_defaults
   'b' - Bold hilite      On  (not 'reverse')
 * 'c' - Command line     Off (name, not cmdline)
 * 'H' - Threads          Off (show all threads)
 * 'i' - Idle tasks       On  (show all tasks)
   'R' - Reverse sort     On  (pids high-to-low)
 * 'S' - Cumulative time  Off (no, dead children)
   'x' - Column hilite    Off (no, sort field)
   'y' - Row hilite       On  (yes, running tasks)
   'z' - color/mono       Off (no, colors)

1. COMMAND-LINE Options
The command-line syntax for top consists of:

     -hv | -bcHisS -d delay -n iterations -p pid [,pid...]

The typically mandatory switches ('-') and even whitespace are completely optional.


-b : Batch mode operation
     Starts top in 'Batch mode', which could be useful for sending output from top to other programs or to a file.
     In this mode, top will not accept input and runs until the iterations limit you've set  with  the  '-n'  com‐
     mand-line option or until killed.


-c : Command line/Program name toggle
     Starts  top with the last remembered 'c' state reversed.  Thus, if top was displaying command lines, now that
     field will show program names, and visa versa.  See the 'c' interactive command for additional information.


-d : Delay time interval as:  -d ss.tt (seconds.tenths)
     Specifies the delay between screen updates, and overrides the corresponding value in one's personal  configu‐
     ration file or the startup default.  Later this can be changed with the 'd' or 's' interactive commands.

     Fractional  seconds  are  honored, but a negative number is not allowed.  In all cases, however, such changes
     are prohibited if top is running in 'Secure mode', except for root (unless the 's'  command-line  option  was
     used).  For additional information on 'Secure mode' see topic 5a. SYSTEM Configuration File.



-h : Help
     Show library version and the usage prompt, then quit.


-H : Threads toggle
     Starts  top with the last remembered 'H' state reversed.  When this toggle is On, all individual threads will
     be displayed.  Otherwise, top displays a summation of all threads in a process.


-i : Idle Processes toggle
     Starts top with the last remembered 'i' state reversed.  When this toggle is Off, tasks  that  are  idled  or
     zombied will not be displayed.


-n : Number of iterations limit as:  -n number
     Specifies the maximum number of iterations, or frames, top should produce before ending.


-u : Monitor by user as:  -u somebody
     Monitor only processes with an effective UID or user name matching that given.


-U : Monitor by user as:  -U somebody
     Monitor only processes with a UID or user name matching that given.  This matches real, effective, saved, and
     filesystem UIDs.


-p : Monitor PIDs as:  -pN1 -pN2 ...  or  -pN1, N2 [,...]
     Monitor only processes with specified process IDs.  This option can be given up to 20 times, or you can  pro‐
     vide a comma delimited list with up to 20 pids.  Co-mingling both approaches is permitted.

     This  is  a command-line option only.  And should you wish to return to normal operation, it is not necessary
     to quit and and restart top  --  just issue the '=' interactive command.


-s : Secure mode operation
     Starts top with secure mode forced, even for root.  This mode is far better  controlled  through  the  system
     configuration file (see topic 5. FILES).


-S : Cumulative time mode toggle
     Starts top with the last remembered 'S' state reversed.  When 'Cumulative mode' is On, each process is listed
     with the cpu time that it and its dead children have used.  See the 'S' interactive  command  for  additional
     information regarding this mode.

-v : Version
     Show library version and the usage prompt, then quit.

2. FIELDS / Columns
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 ter‐
   minal, 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  dis‐
   patchability.


j: P  --  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 environment, 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 com‐
   mand-line option and an interactive command.  See  the  'S'  interactive  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.


r: CODE  --  Code size (kb)
   The amount of virtual memory devoted to executable code, also known as the 'text resident set' size or TRS.


s: DATA  --  Data+Stack size (kb)
   The amount of virtual 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 backing storage access (such as a disk) 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 com‐
   mand 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 .   Less  formal  documentation  can
   also be found on the 'Fields select' and 'Order fields' screens.


阅读(3284) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~