天天看點

linux下如何擷取每個線程的CPU占用率

啥也不說,直接上腳本:

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# 

繼續閱讀