PING: RFR: 8241439: jdk.NativeLibraryEvent hooks all opened regular files
Yasumasa Suenaga
suenaga at oss.nttdata.com
Sun Jun 7 13:31:08 UTC 2020
Thanks Chihiro!
Yasumasa
On 2020/06/07 22:12, Chihiro Ito wrote:
> Hi Yasumasa,
>
> I looked at your patch again. It looks good for me.
>
> Regards,
> Chihiro
>
> 2020年6月7日(日) 12:26 Yasumasa Suenaga <suenaga at oss.nttdata.com>:
>>
>> Hi Chihiro,
>>
>> Thanks for your comment!
>>
>> On 2020/06/06 22:04, Chihiro Ito wrote:
>>> Hi Yasumasa,
>>>
>>> In the following code, like the if statement in the base variable, you
>>> should strictly use 0 and NULL.
>>> if (top < phdr _ top) {
>>
>> I think you mean I should add NULL check to conditions for `top`.
>> I uploaded new webrev. Is it ok?
>>
>> http://cr.openjdk.java.net/~ysuenaga/JDK-8241439/webrev.02/
>>
>>
>> Thanks,
>>
>> Yasumasa
>>
>>
>>> Regards,
>>> Chihiro
>>>
>>> 2020年6月4日(木) 20:26 Yasumasa Suenaga <suenaga at oss.nttdata.com>:
>>>>
>>>> Hi all,
>>>>
>>>> Could you review this change?
>>>>
>>>>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8241439
>>>>>> webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8241439/webrev.01/
>>>>
>>>> I want to merge it to JDK 15.
>>>> I've got a reviewer, then I need one more reviewer to push.
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Yasumasa
>>>>
>>>>
>>>> On 2020/05/26 9:25, Yasumasa Suenaga wrote:
>>>>> Hi all,
>>>>>
>>>>> I've sent review request last month, but nobody has reviewed. Could you review it?
>>>>>
>>>>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8241439
>>>>>> webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8241439/webrev.01/
>>>>>
>>>>> os::get_loaded_modules_info() has introduced in JDK-8056242, and it says this function is for dll/so/dylibs.
>>>>> In fact, os::get_loaded_modules_info() uses EnumProcessModules() in Windows.
>>>>>
>>>>> In Linux, get_loaded_modules_info() depends on /proc/<PID>/maps, so it hooks regular files (e.g. JAR, CDS archive), and hooks multiple memory regions by one shared library.
>>>>> We should merge same library to one event, and should not hook regular files (not shared library).
>>>>>
>>>>> All comments are welcome.
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Yasumasa
>>>>>
>>>>>
>>>>> On 2020/04/16 9:30, Yasumasa Suenaga wrote:
>>>>>> PING: Could you review it?
>>>>>>
>>>>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8241439
>>>>>> webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8241439/webrev.01/
>>>>>>
>>>>>>
>>>>>> Yasumasa
>>>>>>
>>>>>>
>>>>>> On 2020/04/09 16:00, Yasumasa Suenaga wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> Please review this change:
>>>>>>>
>>>>>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8241439
>>>>>>> webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8241439/webrev.00/
>>>>>>>
>>>>>>> HotSpot has os::get_loaded_modules_info() to get all loaded native libraries, however it would call callback in twice on same library on Linux. Also it would call callback even if the file is not a library.
>>>>>>>
>>>>>>> We can see this problem in jdk.NativeLibrary JFR event as below:
>>>>>>>
>>>>>>>
>>>>>>> ```
>>>>>>> jdk.NativeLibrary {
>>>>>>> startTime = 16:59:06.621
>>>>>>> name = "/usr/lib64/libc-2.30.so"
>>>>>>> baseAddress = 0x7FDB06ACC000
>>>>>>> topAddress = 0x7FDB06AF1000
>>>>>>> }
>>>>>>>
>>>>>>> jdk.NativeLibrary {
>>>>>>> startTime = 16:59:06.621
>>>>>>> name = "/usr/lib64/libc-2.30.so"
>>>>>>> baseAddress = 0x7FDB06AF1000
>>>>>>> topAddress = 0x7FDB06C40000
>>>>>>> }
>>>>>>>
>>>>>>> :
>>>>>>>
>>>>>>> ```
>>>>>>>
>>>>>>> ```
>>>>>>> jdk.NativeLibrary {
>>>>>>> startTime = 16:59:06.621
>>>>>>> name = "/home/ysuenaga/OpenJDK/jdk/build/linux-x86_64-server-fastdebug/images/jdk/lib/server/classes.jsa"
>>>>>>> baseAddress = 0x800000000
>>>>>>> topAddress = 0x800007000
>>>>>>> }
>>>>>>> ```
>>>>>>>
>>>>>>> This change uses dl_iterate_phdr() to get them, so these problem has gone.
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Yasumasa
More information about the hotspot-jfr-dev
mailing list