Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1268866
  • 博文数量: 389
  • 博客积分: 2874
  • 博客等级: 少校
  • 技术积分: 3577
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-24 10:34
文章分类

全部博文(389)

文章存档

2020年(2)

2018年(39)

2017年(27)

2016年(3)

2015年(55)

2014年(92)

2013年(54)

2012年(53)

2011年(64)

分类: 嵌入式

2012-09-08 09:16:48

ps -eLo pid,tid,class,rtprio,ni,pri,psr,pcpu,pmem,stat,wchan:30,comm
-e 显示所有进程
-L 是现实线程信息
-o 表示使用用户定义格式打印信息

tid 表示线程id
pcpu 表示cpu使用率

pmem 参照%cpu
%cpu      %CPU   cpu utilization of the process in "##.#" format. Currently, it is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a
 percentage. It will not add up to 100% unless you are lucky. (alias pcpu).
pmem 参照%mem
%mem      %MEM   ratio of the process's resident set size  to the physical memory on the machine, expressed as a percentage. (alias pmem).

wchan:30 WCHAN  name of the kernel function in which the process is sleeping, a "-" if the process is running, or a "*" if the process is multi-threaded and ps is not displaying threads.

程序状态字段解释:

       D    Uninterruptible sleep (usually IO) 不可中断睡眠
       R    Running or runnable (on run queue) 正在执行或可执行,表示目前在运行队列里面
       S    Interruptible sleep (waiting for an event to complete) 可中断睡眠
       T    Stopped, either by a job control signal or because it is being traced.停止
       W    paging (not valid since the 2.6.xx kernel)
       X    dead (should never be seen)
       Z    Defunct ("zombie") process, terminated but not reaped by its parent.僵尸进程

       For BSD formats and when the stat keyword is used, additional characters may be displayed:附加字段
       <    high-priority (not nice to other users) 高优先级
       N    low-priority (nice to other users) 低优先级
       L    has pages locked into memory (for real-time and custom IO)
       s    is a session leader
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
       +    is in the foreground process group



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