linux下如何獲取每個線程的CPU占用率
睿豐德科技 專注RFID識別技術和條碼識別技術與管理軟件的集成項目。質量追溯系統、MES系統、金蝶與條碼系統對接、用友與條碼系統對接
啥也不說,直接上腳本:
root@Storage:/mnt/mtd# cat cpu.sh
#!/bin/sh
while true
do
ps -H -eo user,pid,ppid,tid,time,%cpu,cmd --sort=%cpu
sleep 1
done
root@Storage:/mnt/mtd#