8187305: Add logging for shared library loads/unloads

Add logging to JVM_LoadLibrary(), JVM_UnloadLibrary(), and JVM_FindLibraryEntry().

Reviewed-by: dholmes, coleenp
This commit is contained in:
Harold Seigel 2020-02-18 16:30:54 +00:00
parent cea8931aed
commit bf6c14f034
5 changed files with 181 additions and 1 deletions

View file

@ -3371,6 +3371,7 @@ JVM_ENTRY_NO_ENV(void*, JVM_LoadLibrary(const char* name))
THROW_HANDLE_0(h_exception);
}
log_info(library)("Loaded library %s, handle " INTPTR_FORMAT, name, p2i(load_result));
return load_result;
JVM_END
@ -3378,12 +3379,17 @@ JVM_END
JVM_LEAF(void, JVM_UnloadLibrary(void* handle))
JVMWrapper("JVM_UnloadLibrary");
os::dll_unload(handle);
log_info(library)("Unloaded library with handle " INTPTR_FORMAT, p2i(handle));
JVM_END
JVM_LEAF(void*, JVM_FindLibraryEntry(void* handle, const char* name))
JVMWrapper("JVM_FindLibraryEntry");
return os::dll_lookup(handle, name);
void* find_result = os::dll_lookup(handle, name);
log_info(library)("%s %s in library with handle " INTPTR_FORMAT,
find_result != NULL ? "Found" : "Failed to find",
name, p2i(handle));
return find_result;
JVM_END