Main Menu

Search

LINUX: PS COMMAND / SCRIPT TO CHECK PROCESSES USING PARTICULAR CPU CORE OR VCPU


Following command can be used to find processes using particular, core. In below command example we are finding processes running on CPU core 4. Replace CPU/Core Number as needed for CORENUM argument

CORENUM=4; ps -e -o pid,psr,cpu,cmd | grep -E  "^[[:space:]][[:digit:]]+[[:space:]]+${CORENUM}


Below is sample output of above command.
 

 1027   4   - [scsi_eh_6]

 1779   4   - /bin/bash /usr/sbin/OSWatcher -i 30 -m 48 -l /var/log/oswatcher/log /var/log/oswatcher

 3002   4   - [kworker/4:1H]

 3620   4   - [alias_guid1]

 3651   4   - [mcast_wq]

 4187   4   - [krds_cp_wq_14]

 5542   4   - [fcoethread/4]

 5563   4   - [bnx2fc_thread/4]

 5643   4   - [o2net]

 5702   4   - [nfsiod]

 7114   4   - /usr/bin/python /usr/lib64/python2.6/site-packages/agent/daemon/stats.py

 7372   4   - /sbin/mingetty /dev/tty3

Products to which Article Applies

All Linux Operating Systems

 
Article Author: Tarun Boyella

No comments:

Post a Comment