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:
I will look at it.
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?
A commit references this bug:
Date: Sat Jun 9 02:14:35 UTC 2018
New revision: 334864
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, firstname.lastname@example.org, bapt
PR: 139389 (for the record)