|
From: Matthias S. <zz...@ge...> - 2012-11-07 15:54:48
|
Hi! I wonder if it would be good to have valgrind remember the names of the threads. Our application sets the name of the threads using pthread_setname_np and that is implemented by calling the syscall prctl(PR_SET_NAME). Using plain gdb, info threads also lists these user-defined names. But valgrind and gdb+vgdb only show the thread-ids. The only place in valgrind that already handles thread names is a helgrind client request. I think it would be a good idea if valgrind could also show the thread name. My first attempt is to add more code to POST(sys_prctl) and in case of VKI_PR_SET_NAME is called, store the set name into a new field of ThreadState. Then in every user visible place where a threadid is printed, also print the name. How could this look like? ==123== Thread 5 (MyThread1): ==123== Invalid read of size 1: ... I will send a patch once this is done. The other option would be to call prctl(PR_GET_NAME) at every place that needs a thread name. Regards Matthias |