RFR: 8264644: Add PrintClassLoaderDataGraphAtExit to print the detailed CLD graph [v3]
Yi Yang
yyang at openjdk.java.net
Wed Apr 7 05:30:30 UTC 2021
On Wed, 7 Apr 2021 05:07:54 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Yi Yang has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - add CLDG_lock
>> - use PTR_FORMAT
>
> src/hotspot/share/classfile/classLoaderData.cpp line 952:
>
>> 950: out->print_cr("");
>> 951: }
>> 952: out->print_cr(" - class loader " PTR_FORMAT, p2i(_class_loader.ptr_raw()));
>
> I'm surprised the p2i's were added. If the values are pointers then p2i should not be needed. If using p2i then INTPTR_FORMAT is the correct format specifier to use.
I'm not sure the original intentions of these two macros. It looks like the definitions of PRT_FORMAT and INTPTR_FORMAT are identical:
https://github.com/openjdk/jdk/blob/c3abdc9aadc734053dbcc43d5294d5f16a0b0ce3/src/hotspot/share/utilities/globalDefinitions.hpp#L129-L132
Also I find many occurrences that using p2i while format specifier is PRT_FORMAT. If this is indeed wrong, I may fix them later.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3323
More information about the hotspot-dev
mailing list