Processes running on a particular core

4k Views Asked by At

I used taskset to pin a process to a particular core but there are other processes as well which share that core. Is it possible to know which processes share which cores explicitly? For example to get an information like "core 0 has processes 1, 202, 4043, etc.. running on it" .

1

There are 1 best solutions below

1
On BEST ANSWER

ps has a way to display processor associated with every number. You must use the custom output option '-o' and give it the psr format that will display core id.

For instance
ps -A -o pid,psr,args
displays process pid, core and args of all running processes.

There are many options available to -o. See ps man page for details.

AFAIK, there is no option to get information on process running on a specific core, but you can use something like
ps -A -o psr,pid,args | grep '^ *3'
to get the list of processes running on core #3.