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) |