1. 程式人生 > 實用技巧 >ps檢視執行緒所在的cpu

ps檢視執行緒所在的cpu

[root@localhost kni]# ps -elf | grep kni
4 R root      32791  27964 99  80   0 - 8410299 -    05:12 pts/0    00:00:14 ./examples/kni/build/app/kni -c 0xFFFFF -n 4 -- -P -p 0x1 --config=(0,1,2,3,4)
1 S root      32813      2  0  80   0 -     0 kni_th 05:12 ?        00:00:00 [kni_vEth0_0]
1 S root      32817      2  0  80   0 -     0
kni_th 05:12 ? 00:00:00 [kni_vEth0_1]

[root@localhost kni]# ps -mo pid,tid,%cpu,psr -p  32813
   PID    TID %CPU PSR
 32813      -  0.1   -
     -  32813  0.1   3
[root@localhost kni]# ps -mo pid,tid,%cpu,psr -p  32817
   PID    TID %CPU PSR
 32817      -  0.4   -
     -  32817  0.4   4
 
[root@localhost kni]# ps 
-mo pid,tid,%cpu,psr -p 32791 PID TID %CPU PSR 32791 - 298 - - 32791 99.6 0 - 32792 0.0 60 - 32793 0.0 20 - 32794 99.3 1 - 32795 99.4 2 - 32796 0.0 3 - 32797 0.0 4 - 32798 0.0 5 - 32799 0.0 6 - 32800 0.0 7 - 32801
0.0 8 - 32802 0.0 9 - 32803 0.0 10 - 32804 0.0 11 - 32805 0.0 12 - 32806 0.0 13 - 32807 0.0 14 - 32808 0.0 15 - 32809 0.0 16 - 32810 0.0 17 - 32811 0.0 18 - 32812 0.0 19 [root@localhost kni]#

[root@localhost kni]# ps -T -p  32791
   PID   SPID TTY          TIME CMD
 32791  32791 pts/0    00:05:29 kni
 32791  32792 pts/0    00:00:00 eal-intr-thread
 32791  32793 pts/0    00:00:00 rte_mp_handle
 32791  32794 pts/0    00:05:28 lcore-slave-1
 32791  32795 pts/0    00:05:29 lcore-slave-2
 32791  32796 pts/0    00:00:00 lcore-slave-3
 32791  32797 pts/0    00:00:00 lcore-slave-4
 32791  32798 pts/0    00:00:00 lcore-slave-5
 32791  32799 pts/0    00:00:00 lcore-slave-6
 32791  32800 pts/0    00:00:00 lcore-slave-7
 32791  32801 pts/0    00:00:00 lcore-slave-8
 32791  32802 pts/0    00:00:00 lcore-slave-9
 32791  32803 pts/0    00:00:00 lcore-slave-10
 32791  32804 pts/0    00:00:00 lcore-slave-11
 32791  32805 pts/0    00:00:00 lcore-slave-12
 32791  32806 pts/0    00:00:00 lcore-slave-13
 32791  32807 pts/0    00:00:00 lcore-slave-14
 32791  32808 pts/0    00:00:00 lcore-slave-15
 32791  32809 pts/0    00:00:00 lcore-slave-16
 32791  32810 pts/0    00:00:00 lcore-slave-17
 32791  32811 pts/0    00:00:00 lcore-slave-18
 32791  32812 pts/0    00:00:00 lcore-slave-19