RFR: Make Serviceability Agent attach functionality optional
David Holmes
david.holmes at oracle.com
Tue Apr 18 22:13:08 UTC 2017
On 19/04/2017 7:55 AM, Mikael Vidstedt wrote:
>
>> On Apr 14, 2017, at 10:26 AM, Jini George <jini.george at oracle.com> wrote:
>>
>> Looks ok to me, a couple of nits though:
>>
>> * in Lib-jdk.hotspot.agent.gmk, a space would be needed after the comma at lines 60 and 102:
>>
>> ifeq ($(INCLUDE_SA_ATTACH),true)
>
> Fixed.
>
>> * In proc_service.h, we have the following lines:
>>
>> 76 // new libthread_db of NPTL seem to require this symbol
>> 77 ps_err_e ps_get_thread_area();
>>
>> So might make sense to have this too under #ifdef INCLUDE_SA_ATTACH
>
> As a matter of fact, ps_get_thread_area() seems to be dead code (AFAICT it’s not used anywhere) so the right course of action is probably just to remove it? Perhaps something we can do in mainline/jdk10?
Sounds to me like they were getting a link error if that symbol did not
exist.
David
-----
>> * Looks like the inclusion of thread_db.h and the corresponding functions will have to be guarded with INCLUDE_SA_ATTACH in libproc_impl.c too.
>
> I’m assuming that you’re asking for the guards I added in the first, incomplete change I made:
>
> http://hg.openjdk.java.net/portola/portola/hotspot/rev/6860d59d26f4 <http://hg.openjdk.java.net/portola/portola/hotspot/rev/6860d59d26f4>
>
> Cheers,
> Mikael
>
>>
>>
>> Thanks,
>> Jini.
>>
>> On 4/14/2017 5:06 AM, Mikael Vidstedt wrote:
>>> Here’s an ugly incremental fix to get things building again:
>>>
>>> hotspot: http://cr.openjdk.java.net/~mikael/webrevs/portola/attachfix/webrev.00/hotspot/webrev/
>>>
>>> I’m going to file an enhancement to follow up on this to see if it can be cleaned up. Meanwhile, please have a look at the changes - both the ones I send out earlier, and the above fix.
>>>
>>> Cheers,
>>> Mikael
>>>
>>>> On Apr 13, 2017, at 3:31 PM, Mikael Vidstedt <mikael.vidstedt at oracle.com> wrote:
>>>>
>>>>
>>>> FYI: I messed up the details of the patch. Working on fixing it.
>>>>
>>>> Cheers,
>>>> Mikael
>>>>
>>>>> On Apr 13, 2017, at 9:19 AM, Mikael Vidstedt <mikael.vidstedt at oracle.com> wrote:
>>>>>
>>>>>
>>>>> The Serviceability Agent (aka. SA) has functionality to attach to running processes forcefully/without the cooperation of the VM, allowing “live” debugging even when the processes is stuck. On linux the implementation relies on the functionality provided by the thread_db.h header file.
>>>>>
>>>>> musl doesn’t support thread_db.h (or any other thread debugging library for that sake). This patch makes the inclusion of the attach/live debugging support optional, and only includes it if the thread_db.h header file is available.
>>>>>
>>>>> Note that the core debugging functionality still works without the attach/live debugging functionality in the SA (at least in theory, I haven’t taken core debugging for a spin yet).
>>>>>
>>>>> top: http://cr.openjdk.java.net/~mikael/webrevs/portola/sathreaddb/webrev.00/webrev/
>>>>> hotspot: http://cr.openjdk.java.net/~mikael/webrevs/portola/sathreaddb/webrev.00/hotspot/webrev/
>>>>>
>>>>> Cheers,
>>>>> Mikael
>>>>>
>>
>
More information about the portola-dev
mailing list