TransWikia.com

How to find out on which core a thread is running on?

Unix & Linux Asked by Michel Gokan on February 22, 2021

Let’s say we have a CPU-intensive application called multi-threaded-application.out that is running on top of Ubuntu with a PID of 10000. It has 4 threads with tid 10001, 10002, 10003, and 10004. I want to know, at any given time, on which core each of these threads is being scheduled?

I tried /proc/<pid>/tasks/<tid>/status, but I couldn’t find any information regarding the core ID that is responsible for running the given thread.

This question is somehow related to this one.

Any help would be much appreciated.

One Answer

The following command did the trick:

ps -mo pid,tid,%cpu,psr -p <main process ID>

Answered by Michel Gokan on February 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP