[PATCH:xserver] Use pthread_setname_np to set thread names if available

Alan Coopersmith alan.coopersmith at oracle.com
Tue Oct 18 01:48:45 UTC 2016


On 10/17/16 06:36 PM, Peter Hutterer wrote:
> On Sat, Sep 10, 2016 at 09:14:19PM -0700, Alan Coopersmith wrote:
>> I have only tested this on Solaris, not MacOS or Linux, but since the
>> similar code in glib works on both, hope this will too.
>
>
> this broke a few scripts here, e.g. ps -C Xorg won't work anymore because
> the program name is now MainThread. I understand why we'd want to label the
> input thread but do we get any benefit out of labelling the main thread?

Oh, I didn't know it would do that on Linux - Solaris still shows the process
name for the process, and the thread names only when looking at the threads.

I just figured it was handy when libraries spawn their own threads, so we could
tell the difference between our thread and theirs, but if it's causing problems,
I don't think it's useful enough to force the issue and am okay seeing the main
thread name dropped.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list