How can I see which CPU core a thread is running in?

前端 未结 7 1251
悲&欢浪女
悲&欢浪女 2020-12-07 14:09

In Linux, supposing a thread\'s pid is [pid], from the directory /proc/[pid] we can get many useful information. For example, these proc files, /proc/[pid]/status,/proc/[pid

7条回答
  •  天涯浪人
    2020-12-07 14:46

    The "top" command may help towards this, it does not have CPU-grouped list of threads but rather you can see the list of threads (probably for a single process) and which CPU cores the threads are running on by

    top -H -p {PROC_ID}

    then pressing f to go into field selection, j to enable the CPU core column, and Enter to display.

提交回复
热议问题