linux - :
pidstat -hluwrt | grep "processname"
"tid" (# 3) "gettid()", , . , , gettid(): printf ( "% lul", gettid()).
2 , , "cswtch/s" () "nvcswtch/s" () .
"cswtch/s" (1000), "" "". , - , . ex: , . , , .
"nvswtch/s" (1000), , , . , : "" "htop" - .
script / ( 20 ):
stdbuf -oL pidstat -hluwrt 20 | stdbuf -oL grep -e "processname" -e "^#"
gettid: (doc here)
pidstat: (doc here)
stdbuf: (doc )