列出所有实时进程
ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,policy,stat,wchan:14,comm, cmd|awk '$4 !~ /-/{print $0}'
ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm, cmd |awk '$4 !~ /-/{print $0}'
PID TID CLS RTPRIO NI PRI PSR %CPU STAT WCHAN COMMAND
2 2 FF 99 - 139 0 0.1 S< migration_thre migration/0
4 4 FF 99 - 139 1 0.0 S< migration_thre migration/1
列出nice不为0的非实时进程
ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,policy,stat,wchan:14,comm|awk '$4 ~ /-/ &&$5 !~/0/ {print $0}'
nwchan 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.
wchan 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. “-”代表正在运行,“*”代表多线程;
ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,policy,stat,wchan:34,nwchan,pcpu,comm
PID TID CLS RTPRIO NI PRI PSR %CPU POL STAT WCHAN WCHAN %CPU COMMAND
1 1 TS - 0 19 0 0.0 TS Ss poll_schedule_timeout
197069 0.0 init
2 2 TS - 0 19 1 0.0 TS S kthreadd 96875 0.0 kthreadd
3 3 FF 99 - 139 0 0.0 FF S migration_thread 64cc5 0.0 migration/0
4 4 TS - 0 19 0 0.0 TS S ksoftirqd 76b65 0.0 ksoftirqd/0
5 5 FF 99 - 139 0 0.0 FF S cpu_stopper_thread ce535 0.0 migration/0
6 6 FF 99 - 139 0 0.0 FF S watchdog e119a 0.0 watchdog/0
7 7 FF 99 - 139 1 0.0 FF S migration_thread 64cc5 0.0 migration/1
8 8 FF 99 - 139 1 0.0 FF S cpu_stopper_thread ce535 0.0 migration/1
9 9 TS - 0 19 1 0.0 TS S ksoftirqd 76b65 0.0 ksoftirqd/1
10 10 FF 99 - 139 1 0.0 FF S watchdog e119a 0.0 watchdog/1
11 11 TS - 0 19 0 0.1 TS S worker_thread 90b4c 0.1 events/0
12 12 TS - 0 19 1 0.1 TS S - - 0.1 events/1
13 13 TS - 0 19 0 0.0 TS S worker_thread
90b4c 0.0 cgroup
14 14 TS - 0 19 1 0.0 TS S worker_thread 90b4c 0.0 khelper
15 15 TS - 0 19 1 0.0 TS S worker_thread 90b4c 0.0 netns
16 16 TS - 0 19 1 0.0 TS S async_manager_thread 9ebb5 0.0 async/mgr
17 17 TS - 0 19 1 0.0 TS S worker_thread 90b4c 0.0 pm
18 18 TS - 0 19 1 0.0 TS S bdi_sync_supers 13bb6b 0.0 sync_supers
19 19 TS - 0 19 1 0.0 TS S bdi_forker_task 13c993 0.0 bdi-default
20 20 TS - 0 19 0 0.0 TS S worker_thread 90b4c 0.0 kintegrityd/0
21 21 TS - 0 19 1 0.0 TS S worker_thread 90b4c 0.0 kintegrityd/1
22 22 TS - 0 19 0 0.0 TS S worker_thread 90b4c 0.0 kblockd/0