RFR: 8144885: agent/src/os/linux/libproc.h needs to support Linux/SPARC builds

Mikael Vidstedt mikael.vidstedt at oracle.com
Tue Dec 8 20:28:26 UTC 2015



On 2015-12-08 12:22, Dmitry Samersoff wrote:
> Mikael,
>
> 1.
>
> asm/ptrace.h is not an option as it (typically) doesn't define
> PTRACE_GETREGSET.

Not sure I understand what you mean by this. Including either 
linux/ptrace.h or asm/ptrace.h fixes the build problem.

>
> The best approach IMHO is to check for PTRACE_GETREGSET in  {unistd.h,
> sys/ptrace.h, linux/ptrace.h) at configure time and define appropriate
> macro.

That would of course be an option. Question is if it's really worth it 
in this case, but maybe it is.

> 2.
>
> Other part of problem is where register set is defined there are couple
> of places where the system describes platform register set (sys/user.h,
> asm/ptrace.h, sys/procfs.h, linux/elf.h etc). These definitions are
> more-or-less compatible but not exactly the same.
>
> Unfortunately SA uses all possible variants interchangeable. (see
> JDK-8141101)
>
> Personally, I would prefer to use one from asm/ptrace.h

Yeah, the SA is... it's complicated. To me asm/ptrace.h feels a bit more 
"low level" than linux/ptrace.h, but it really doesn't matter in this case.

Cheers,
Mikael

>
> -Dmitry
>
>
> On 2015-12-08 21:05, Mikael Vidstedt wrote:
>> The problem is that this needs to be backporting to jdk8u where there
>> is no devkit, and more importantly, even if there were I believe we
>> would see the same issue: the types needed are not made available by
>> including sys/ptrace.h on this platform. I believe we can choose
>> between linux/ptrace.h or asm/ptrace.h. The former feels slightly
>> better.
>>
>> Cheers, Mikael
>>
>>> On Dec 8, 2015, at 03:15, Dmitry Samersoff
>>> <dmitry.samersoff at oracle.com> wrote:
>>>
>>> Jerry,
>>>
>>>> In which case the devkit needs fixing I think, not the code.
>>> I'm second to David.
>>>
>>> It's better to not include linux/* headers explicitly.
>>>
>>> -Dmitry
>>>
>>>
>>>> On 2015-12-08 08:23, David Holmes wrote:
>>>>> On 8/12/2015 2:59 PM, Gerald Thornbrugh wrote: Hi David,
>>>>>
>>>>> Yes, I believe this is a devkit issue.  Mikael and I have been
>>>>> working to get JDK9 building in JPRT with the lab Linux/SPARC
>>>>> machines that use a devkit and this change was needed. I will
>>>>> update the bug detailing this as a devkit issue.
>>>> In which case the devkit needs fixing I think, not the code.
>>>>
>>>> Cheers, David
>>>>
>>>>> Thanks!
>>>>>
>>>>> Jerry
>>>>>> Hi Jerry,
>>>>>>
>>>>>>> On 8/12/2015 8:58 AM, Gerald Thornbrugh wrote: Hi
>>>>>>> Everyone,
>>>>>>>
>>>>>>> Please review this small change which fixes a JDK9
>>>>>>> Linux/SPARC build problem in
>>>>>>> "hotspot/agent/src/os/linux/libproc.h” so the correct
>>>>>>> “ptrace.h” include file will be used during the build
>>>>>>> process.
>>>>>>>
>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8144885
>>>>>>> <https://bugs.openjdk.java.net/browse/JDK-8144885> Webrev:
>>>>>>> http://cr.openjdk.java.net/~gthornbr/8144885/webrev/
>>>>>>> <http://cr.openjdk.java.net/~gthornbr/8144885/webrev/>
>>>>>> As far as I can see both versions of ptrace.h exist on linux
>>>>>> x86 and linux sparc distributions, so it is not at all clear
>>>>>> why this change is needed. Is it perhaps an issue with a
>>>>>> devkit?
>>>>>>
>>>>>> Thanks, David
>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Jerry
>>>
>>> -- Dmitry Samersoff Oracle Java development team, Saint Petersburg,
>>> Russia * I would love to change the world, but they won't give me
>>> the source code.
>



More information about the hotspot-runtime-dev mailing list