OSX - How can I see the TID of all threads from my process?

坚强是说给别人听的谎言 提交于 2019-12-05 23:53:14

问题


On Linux ps -eLf | grep my-process-name gives a list of the threads within my process along with the TID of each thread.

On OSX ps -M pid gives me the list of the threads but does not show the TID of each thread.

How can I see thread TIDs under a single process from the command line?


回答1:


You can't see the TIDs with the ps on Mac OS as you can experience while listing all the possible column options with ps L.

Anyway, if you dont mind exploring the threads as a root, you can use dtruss, which is primarily for processing syscall details, but it will at least show you the TIDs in the PID/LWPID (PID/THRD) column.

sudo dtruss -ap pid


来源:https://stackoverflow.com/questions/28047653/osx-how-can-i-see-the-tid-of-all-threads-from-my-process

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!