From d328e4e7e2f58fbfeb661f3502f95016159d7230 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Mon, 1 Dec 2025 13:37:32 +0000 Subject: [PATCH] 8372272: Hotspot shared lib loading - add load attempts to Events::log Reviewed-by: lucy, azeller --- src/hotspot/os/aix/os_aix.cpp | 2 ++ src/hotspot/os/bsd/os_bsd.cpp | 2 ++ src/hotspot/os/linux/os_linux.cpp | 2 ++ src/hotspot/os/windows/os_windows.cpp | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp index 48bd5e05816..7de031cac58 100644 --- a/src/hotspot/os/aix/os_aix.cpp +++ b/src/hotspot/os/aix/os_aix.cpp @@ -1038,6 +1038,8 @@ static void* dll_load_library(const char *filename, int *eno, char *ebuf, int eb dflags |= RTLD_MEMBER; } + Events::log_dll_message(nullptr, "Attempting to load shared library %s", filename); + void* result; const char* error_report = nullptr; JFR_ONLY(NativeLibraryLoadEvent load_event(filename, &result);) diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index 0b37cb100f6..0889cc4cdf8 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -1035,6 +1035,8 @@ void *os::Bsd::dlopen_helper(const char *filename, int mode, char *ebuf, int ebu int rtn = fegetenv(&default_fenv); assert(rtn == 0, "fegetenv must succeed"); + Events::log_dll_message(nullptr, "Attempting to load shared library %s", filename); + void* result; JFR_ONLY(NativeLibraryLoadEvent load_event(filename, &result);) result = ::dlopen(filename, RTLD_LAZY); diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index a1d957eb77d..cf64c22ddff 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -1875,6 +1875,8 @@ void * os::Linux::dlopen_helper(const char *filename, char *ebuf, int ebuflen) { assert(rtn == 0, "fegetenv must succeed"); #endif // IA32 + Events::log_dll_message(nullptr, "Attempting to load shared library %s", filename); + void* result; JFR_ONLY(NativeLibraryLoadEvent load_event(filename, &result);) result = ::dlopen(filename, RTLD_LAZY); diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 8a450a291d3..b9aeb4e8dd6 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -1715,6 +1715,8 @@ static int _print_module(const char* fname, address base_address, // same architecture as Hotspot is running on void * os::dll_load(const char *name, char *ebuf, int ebuflen) { log_info(os)("attempting shared library load of %s", name); + Events::log_dll_message(nullptr, "Attempting to load shared library %s", name); + void* result; JFR_ONLY(NativeLibraryLoadEvent load_event(name, &result);) result = LoadLibrary(name);