The program top(1) does not display thread IDs when listing threads (in "-H" mode). Displaying the thread ID can be very useful when using the tool cpuset, as this takes a thread ID as an argument. The attached patch adds a new column after PID which displays the Thread ID. Fix: Patch attached with submission follows:
Responsible Changed From-To: freebsd-bugs->pluknet I will look at it.
Responsible Changed From-To: pluknet->freebsd-bugs Back to the pool. I have no idea how to best fit thread IDs (requires 6+1 characters) and not exceed 80 characters terminal.
(In reply to Sergey Kandaurov from comment #2) What about replacing PID column with TID when -H is specified?
r334474
A commit references this bug: Author: eadler Date: Sat Jun 9 02:14:35 UTC 2018 New revision: 334864 URL: https://svnweb.freebsd.org/changeset/base/334864 Log: top(1): use a different command to toggle tid vs pid - By popular demand, implement a different switch ("T") for toggling between thread id and process id. - Add an assert that the size of command chars is as expected. - Also clean up some messiness I found when implementing this. - Further document the new flag. Requested by: flo, ronald-lists@klop.ws, bapt PR: 139389 (for the record) X-MFC-With: r334474 Changes: head/usr.bin/top/commands.c head/usr.bin/top/machine.c head/usr.bin/top/machine.h head/usr.bin/top/top.1 head/usr.bin/top/top.c head/usr.bin/top/top.h