aves
aves

Reputation: 31

How to collect information of every single CPU?

If my PC has four CPUs(CPU0, CPU1, CPU2, CPU3), how can I know the number of running processes and the queue length of each CPU?

Upvotes: 1

Views: 4680

Answers (3)

Soleco
Soleco

Reputation: 191

Look at /sys/kernel/debug/sched/debug file. Same as /proc/sched_debug from the previous answer. In my case in proc folder there was no sched_debug, but found the same content in the mentioned path.

Upvotes: 3

Klaas van Gend
Klaas van Gend

Reputation: 1130

Look at the /proc/stat and /proc/schedstat files. There is also information per process in /proc/<pid>/stat.

Upvotes: 0

Andrei Epure
Andrei Epure

Reputation: 1828

In /proc/sched_debug you can see for each cpu:

  • the number of running processes (cfs_rq[0].nr_running)
  • the runnable processes (runnable tasks)

    cat /proc/sched_debug | less
    

Upvotes: 2

Related Questions