[PATCH] Linux implementation for set_native_thread_name()

David Holmes david.holmes at oracle.com
Thu Jul 26 05:00:17 PDT 2012


Roman,

On 25/07/2012 7:10 AM, Roman Kennke wrote:
>> I think it looks fine.
>
> Great! I posted an updated webrev for this (replaced snprint with
> jio_snprintf):

You are assuming that these non-posix pthread extensions will always 
exist. Do we know that is true for all Linux's - including potentially 
custom distributions on embedded systems? I think we need dynamic lookup 
of the function, as done elsewhere, to verify that it exists.

> http://cr.openjdk.java.net/~rkennke/linux_threadname/webrev.01/

This also has the distribute_processes etc changes, which should be 
handled seperately.

>> Do you have a bug number for this?
>
> No. (I don't have access to bugster anymore).

Bugster is nearly dead - long live Jira :) But for now someone will need 
to create a bug for this ... though it may already exist from when this 
function was added.

>>    Also, how do we verify the result?
>
> I verified it using htop and by inspecting /proc/$PID/task/$TID/stat.
> Unfortuntately, I couldn't get top or ps to show the thread name, but
> maybe I'm just stupid (and I did not try very hard).

gdb? Not sure how this shows up on OSX. If the name doesn't appear in 
anything useful then there's not much point implementing the method.


> Also: which of the many repositories do I need to push this to?

It would go into hsx/hotspot-rt forest, but you can't push it directly. 
All hotspot changes must go via JPRT so you will need a sponsor.

Cheers,
David


> Regards,
> Roman
>
>> --
>> - Keith
>>
>> On 7/24/2012 3:42 PM, Roman Kennke wrote:
>>> Hello,
>>>
>>> The following patch implements set_native_thread_name() for Linux, which
>>> was so far unimplemented. The name needs to be truncated to 15 chars,
>>> otherwise it would not be accepted by pthread_setname_np() at all.
>>>
>>> http://cr.openjdk.java.net/~rkennke/linux_threadname/webrev.00/
>>>
>>> This is my first patch to hotspot ever, so please let me know when I did
>>> anything fundamental wrong. I have another patch in the pipeline for
>>> implementing the other 2 missing methods in the same source file
>>> (distribute_processes() and bind_to_processor() ).
>>>
>>> What do you think?
>>>
>>> Kind regards, Roman
>>>
>>>
>
>


More information about the hotspot-dev mailing list