mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 12:04:39 +02:00
6721093: -XX:AppendRatio=N not supported
Add mechanism to ignore unsupported flags for a set period of time Reviewed-by: acorn, never, coleenp
This commit is contained in:
parent
20dba03e99
commit
74faacc945
18 changed files with 432 additions and 158 deletions
|
@ -94,6 +94,9 @@ static pid_t _initial_pid = 0;
|
|||
static int SR_signum = SIGUSR2;
|
||||
sigset_t SR_sigset;
|
||||
|
||||
/* Used to protect dlsym() calls */
|
||||
static pthread_mutex_t dl_mutex;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// utility functions
|
||||
|
||||
|
@ -1493,6 +1496,24 @@ const char* os::dll_file_extension() { return ".so"; }
|
|||
|
||||
const char* os::get_temp_directory() { return "/tmp/"; }
|
||||
|
||||
void os::dll_build_name(
|
||||
char* buffer, size_t buflen, const char* pname, const char* fname) {
|
||||
// copied from libhpi
|
||||
const size_t pnamelen = pname ? strlen(pname) : 0;
|
||||
|
||||
/* Quietly truncate on buffer overflow. Should be an error. */
|
||||
if (pnamelen + strlen(fname) + 10 > (size_t) buflen) {
|
||||
*buffer = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
if (pnamelen == 0) {
|
||||
sprintf(buffer, "lib%s.so", fname);
|
||||
} else {
|
||||
sprintf(buffer, "%s/lib%s.so", pname, fname);
|
||||
}
|
||||
}
|
||||
|
||||
const char* os::get_current_directory(char *buf, int buflen) {
|
||||
return getcwd(buf, buflen);
|
||||
}
|
||||
|
@ -1742,7 +1763,17 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* glibc-2.0 libdl is not MT safe. If you are building with any glibc,
|
||||
* chances are you might want to run the generated bits against glibc-2.0
|
||||
* libdl.so, so always use locking for any version of glibc.
|
||||
*/
|
||||
void* os::dll_lookup(void* handle, const char* name) {
|
||||
pthread_mutex_lock(&dl_mutex);
|
||||
void* res = dlsym(handle, name);
|
||||
pthread_mutex_unlock(&dl_mutex);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
bool _print_ascii_file(const char* filename, outputStream* st) {
|
||||
|
@ -3581,6 +3612,7 @@ void os::init(void) {
|
|||
|
||||
Linux::clock_init();
|
||||
initial_time_count = os::elapsed_counter();
|
||||
pthread_mutex_init(&dl_mutex, NULL);
|
||||
}
|
||||
|
||||
// To install functions for atexit system call
|
||||
|
|
|
@ -1783,6 +1783,24 @@ const char* os::dll_file_extension() { return ".so"; }
|
|||
|
||||
const char* os::get_temp_directory() { return "/tmp/"; }
|
||||
|
||||
void os::dll_build_name(
|
||||
char* buffer, size_t buflen, const char* pname, const char* fname) {
|
||||
// copied from libhpi
|
||||
const size_t pnamelen = pname ? strlen(pname) : 0;
|
||||
|
||||
/* Quietly truncate on buffer overflow. Should be an error. */
|
||||
if (pnamelen + strlen(fname) + 10 > (size_t) buflen) {
|
||||
*buffer = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
if (pnamelen == 0) {
|
||||
sprintf(buffer, "lib%s.so", fname);
|
||||
} else {
|
||||
sprintf(buffer, "%s/lib%s.so", pname, fname);
|
||||
}
|
||||
}
|
||||
|
||||
const char* os::get_current_directory(char *buf, int buflen) {
|
||||
return getcwd(buf, buflen);
|
||||
}
|
||||
|
@ -2034,6 +2052,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void* os::dll_lookup(void* handle, const char* name) {
|
||||
return dlsym(handle, name);
|
||||
}
|
||||
|
||||
|
||||
bool _print_ascii_file(const char* filename, outputStream* st) {
|
||||
|
|
|
@ -985,6 +985,28 @@ const char * os::get_temp_directory()
|
|||
}
|
||||
}
|
||||
|
||||
void os::dll_build_name(char *holder, size_t holderlen,
|
||||
const char* pname, const char* fname)
|
||||
{
|
||||
// copied from libhpi
|
||||
const size_t pnamelen = pname ? strlen(pname) : 0;
|
||||
const char c = (pnamelen > 0) ? pname[pnamelen-1] : 0;
|
||||
|
||||
/* Quietly truncates on buffer overflow. Should be an error. */
|
||||
if (pnamelen + strlen(fname) + 10 > holderlen) {
|
||||
*holder = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
if (pnamelen == 0) {
|
||||
sprintf(holder, "%s.dll", fname);
|
||||
} else if (c == ':' || c == '\\') {
|
||||
sprintf(holder, "%s%s.dll", pname, fname);
|
||||
} else {
|
||||
sprintf(holder, "%s\\%s.dll", pname, fname);
|
||||
}
|
||||
}
|
||||
|
||||
// Needs to be in os specific directory because windows requires another
|
||||
// header file <direct.h>
|
||||
const char* os::get_current_directory(char *buf, int buflen) {
|
||||
|
@ -1248,6 +1270,10 @@ bool os::dll_address_to_function_name(address addr, char *buf,
|
|||
return false;
|
||||
}
|
||||
|
||||
void* os::dll_lookup(void* handle, const char* name) {
|
||||
return GetProcAddress((HMODULE)handle, name);
|
||||
}
|
||||
|
||||
// save the start and end address of jvm.dll into param[0] and param[1]
|
||||
static int _locate_jvm_dll(int pid, char* mod_fname, address base_addr,
|
||||
unsigned size, void * param) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue