ps display thread name

前端 未结 3 706
梦谈多话
梦谈多话 2021-02-07 23:12

Is there a way for ps (or similar tool) to display the pthread\'s name? I wrote the following simple program:

// th_name.c
#include 
         


        
3条回答
  •  孤街浪徒
    2021-02-07 23:34

    With procps-ng (https://gitlab.com/procps-ng/procps) there are output option -L and -T which will print threads names:

    $ ps -eL
    $ ps -eT
    

    -l long format may be used with them:

    $ ps -eLl
    $ ps -eTl
    

    but -f option will replace thread name with full command line which is the same for all threads.

提交回复
热议问题