Linux – How to know thread names that run on specific core

linuxprocesspsthread

I am working in Java code. My code makes specific Java threads run on specific cores. In this code, I give names to Java threads. I need a Linux command that enables me to know the threads' names that run on a specific core.

I use ps -mo pid,tid,fname,user,psr -p command, so I know the name of the process (java), but I do not know the name corresponding to tid to check if the specific thread runs on the core that I determine for that thread.

Best Answer

How about ps -eL -o user,pid,psr,comm,args.

psr field gives you the processor currently assigned to that thread.

Related Question