3704 vm_exit_during_initialization(buf, NULL); |
3704 vm_exit_during_initialization(buf, NULL); |
3705 FREE_C_HEAP_ARRAY(char, buf, mtThread); |
3705 FREE_C_HEAP_ARRAY(char, buf, mtThread); |
3706 } |
3706 } |
3707 } else { |
3707 } else { |
3708 // Try to load the agent from the standard dll directory |
3708 // Try to load the agent from the standard dll directory |
3709 os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), name); |
3709 if (os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), |
3710 library = os::dll_load(buffer, ebuf, sizeof ebuf); |
3710 name)) { |
|
3711 library = os::dll_load(buffer, ebuf, sizeof ebuf); |
|
3712 } |
3711 #ifdef KERNEL |
3713 #ifdef KERNEL |
3712 // Download instrument dll |
3714 // Download instrument dll |
3713 if (library == NULL && strcmp(name, "instrument") == 0) { |
3715 if (library == NULL && strcmp(name, "instrument") == 0) { |
3714 char *props = Arguments::get_kernel_properties(); |
3716 char *props = Arguments::get_kernel_properties(); |
3715 char *home = Arguments::get_java_home(); |
3717 char *home = Arguments::get_java_home(); |
3730 library = os::dll_load(buffer, ebuf, sizeof ebuf); |
3732 library = os::dll_load(buffer, ebuf, sizeof ebuf); |
3731 } |
3733 } |
3732 #endif // KERNEL |
3734 #endif // KERNEL |
3733 if (library == NULL) { // Try the local directory |
3735 if (library == NULL) { // Try the local directory |
3734 char ns[1] = {0}; |
3736 char ns[1] = {0}; |
3735 os::dll_build_name(buffer, sizeof(buffer), ns, name); |
3737 if (os::dll_build_name(buffer, sizeof(buffer), ns, name)) { |
3736 library = os::dll_load(buffer, ebuf, sizeof ebuf); |
3738 library = os::dll_load(buffer, ebuf, sizeof ebuf); |
|
3739 } |
3737 if (library == NULL) { |
3740 if (library == NULL) { |
3738 const char *sub_msg = " on the library path, with error: "; |
3741 const char *sub_msg = " on the library path, with error: "; |
3739 size_t len = strlen(msg) + strlen(name) + strlen(sub_msg) + strlen(ebuf) + 1; |
3742 size_t len = strlen(msg) + strlen(name) + strlen(sub_msg) + strlen(ebuf) + 1; |
3740 char *buf = NEW_C_HEAP_ARRAY(char, len, mtThread); |
3743 char *buf = NEW_C_HEAP_ARRAY(char, len, mtThread); |
3741 jio_snprintf(buf, len, "%s%s%s%s", msg, name, sub_msg, ebuf); |
3744 jio_snprintf(buf, len, "%s%s%s%s", msg, name, sub_msg, ebuf); |