好好爱自己!

ps 命令

WCHAN in ‘ps -l’

on Linux/x86, ps -l command gives a long listing. Field WCHAN in the listing caught my interest.

-bash-2.05b# ps -l
F S   UID   PID  PPID  C PRI  NI ADDR    SZ WCHAN  TTY          TIME CMD
4 S     0    21597 21595  0  76   0    –           1096 wait4  pts/2    00:00:00 bash
4 R     0   21677 21597  0  80   0    –            794    –      pts/2    00:00:00 ps

looking at the man page, I could find out what it displays –

WCHAN    address of the kernel function where the process is sleeping (use wchan if   you want the kernel function name). Running tasks will display a dash (’-’) in this column.

‘ps -l’ uses System.Map file for reading the symbols.

------------------------------------------

ps -el

 

 

 

 

 

ps -e -o pid,wchan=WIDE-WCHAN-COLUMN -o comm

 

posted @ 2017-11-23 01:03  立志做一个好的程序员  阅读(335)  评论(0编辑  收藏  举报

不断学习创作,与自己快乐相处