RFR: JDK-8288003: log events for os::dll_unload [v4]
Matthias Baesken
mbaesken at openjdk.java.net
Mon Jun 13 08:26:53 UTC 2022
On Fri, 10 Jun 2022 14:22:26 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:
>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>>
>> dll_path on Linux - add NULL check, change special output to not available
>
> src/hotspot/os/linux/os_linux.cpp line 1791:
>
>> 1789: const char* os::Linux::dll_path(void* lib) {
>> 1790: struct link_map *lmap;
>> 1791: const char* l_path = "<not available>";
>
> To be honest, I prefer to return NULL if `dlinfo` is failed.
> IIUC the caller expects return dll path of `lib` - `<not available>` is not the path.
>
> I think it is better that alternative string would be set by the caller (`os::dll_unload()`) like a change of os_windows. But I do not stick my opinion. I'm ok if other reviewer approve your change.
Adjusted dll_path, it returns now NULL in case of failure.
> src/hotspot/os/windows/os_windows.cpp line 1241:
>
>> 1239: char name[MAX_PATH];
>> 1240: if (::GetModuleFileName((HMODULE)lib, name, sizeof(name)) == 0) {
>> 1241: name[0] = '\0';
>
> Should we set `<not available>` to `name` like a change for linux code?
Yes, it is most likely better to have same output in failure case on Windows and other platforms.
-------------
PR: https://git.openjdk.org/jdk/pull/9101
More information about the hotspot-runtime-dev
mailing list