8228902: add os::dll_load to the unified logging os category

Reviewed-by: coleenp, mdoerr
This commit is contained in:
Matthias Baesken 2019-08-02 10:10:42 +02:00
parent 2e6e33eba1
commit f454862e65
5 changed files with 23 additions and 0 deletions

View file

@ -1263,10 +1263,13 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
#ifdef STATIC_BUILD
return os::get_default_process_handle();
#else
log_info(os)("attempting shared library load of %s", filename);
void * result= ::dlopen(filename, RTLD_LAZY);
if (result != NULL) {
Events::log(NULL, "Loaded shared library %s", filename);
// Successful loading
log_info(os)("shared library load of %s was successful", filename);
return result;
}
@ -1280,6 +1283,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
ebuf[ebuflen-1]='\0';
}
Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report);
log_info(os)("shared library load of %s failed, %s", filename, error_report);
return NULL;
#endif // STATIC_BUILD
@ -1289,10 +1293,12 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
#ifdef STATIC_BUILD
return os::get_default_process_handle();
#else
log_info(os)("attempting shared library load of %s", filename);
void * result= ::dlopen(filename, RTLD_LAZY);
if (result != NULL) {
Events::log(NULL, "Loaded shared library %s", filename);
// Successful loading
log_info(os)("shared library load of %s was successful", filename);
return result;
}
@ -1308,6 +1314,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
ebuf[ebuflen-1]='\0';
}
Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report);
log_info(os)("shared library load of %s failed, %s", filename, error_report);
int diag_msg_max_length=ebuflen-strlen(ebuf);
char* diag_msg_buf=ebuf+strlen(ebuf);