查看线程CPU占比信息
使用 top
或 cpuus
命令可以查看线程CPU占比信息,对分析线程运行情况和执行效率有重要参考意义。两个命令调用的是同一个内建命令,所以功能用法完全相同。
[root@sylixos:/root]# help top
show cpu usage information, wait_seconds max is 10s.
top [-n times] [-t wait_seconds]
[root@sylixos:/root]# help cpuus
show cpu usage information, wait_seconds max is 10s.
cpuus [-n times] [-t wait_seconds]
[root@sylixos:/root]#
[root@sylixos:/root]# top
CPU usage checking, please wait...
CPU usage show (measurement accuracy 1.0%) >>
NAME TID PID PRI CPU KERN
---------------- ------- ----- --- ------ ------
t_tshell 4010018 0 150 0.0% 0.0%
t_tshell 4010016 0 150 0.1% 0.0%
t_xinput 4010015 0 199 0.0% 0.0%
t_jobq 4010013 0 200 0.0% 0.0%
t_telnetd 4010011 0 160 0.0% 0.0%
t_ftpd 4010010 0 170 0.0% 0.0%
t_snmp 401000f 0 110 0.0% 0.0%
t_netproto 401000e 0 110 0.0% 0.0%
t_netjob 401000d 0 110 0.0% 0.0%
t_console 401000c 0 150 0.0% 0.0%
t_tpsfs 401000b 0 160 0.0% 0.0%
t_dcwpipe 401000a 0 160 0.0% 0.0%
t_sync 4010009 0 252 0.0% 0.0%
t_reclaim 4010008 0 253 0.0% 0.0%
t_hotplug 4010006 0 250 0.0% 0.0%
t_power 4010005 0 254 0.0% 0.0%
t_log 4010004 0 60 0.0% 0.0%
t_except 4010003 0 0 0.0% 0.0%
t_isrdefer 4010002 0 0 0.0% 0.0%
t_itimer 4010001 0 20 0.0% 0.0%
t_idle0 4010000 0 255 99.8% 0.0%
[root@sylixos:/root]#