Bug 393182 - Add support for pthread_setname_np() to set thread name
Summary: Add support for pthread_setname_np() to set thread name
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.12.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
: 323046 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-04-16 07:57 UTC by Daniel
Modified: 2021-02-28 23:55 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2018-04-16 07:57:54 UTC
Some versions of pthreads (e.g. on Linux x86_64) have pthread_setname_np(), which allows to set thread name. Some tools like gdb can use it to display friendly name for thread. Please add support for it in Valgrind too, to capture and display thread names in helgrind and drd tools.

BTW, Valgrind currently supports ANNOTATE_THREAD_NAME() which provide similar functionality. However this is limited to drd tool only, and requires modification to user program.
Comment 1 Julian Seward 2018-09-03 06:05:11 UTC
I thought we already did support this, by intercepting the underlying system
call.  Are you sure this doesn't work?
Comment 2 Daniel 2018-10-08 13:31:13 UTC
I use Valgrind 3.13.0 (shipped with CentOS 7.5) and it does not work there. Looks that something is still broken, at least in Helgrind.

BTW, I found that I logged Bug 323046 few years ago for the same issue. You can mark is as a duplicate.
Comment 3 Mark Wielaard 2021-02-28 23:55:13 UTC
*** Bug 323046 has been marked as a duplicate of this bug. ***