From 666a730c7c76fe50c125f83b7110e8eba3287121 Mon Sep 17 00:00:00 2001 From: ctornqvi Date: Mon, 12 Sep 2016 13:16:39 -0400 Subject: [PATCH] 8165881: Backout JDK-8164913 Reviewed-by: hseigel --- hotspot/src/share/vm/prims/jvmtiExport.cpp | 2 ++ .../src/share/vm/services/diagnosticCommand.cpp | 15 +++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/hotspot/src/share/vm/prims/jvmtiExport.cpp b/hotspot/src/share/vm/prims/jvmtiExport.cpp index 53f80345c7..a388f29dc9 100644 --- a/hotspot/src/share/vm/prims/jvmtiExport.cpp +++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp @@ -2407,7 +2407,9 @@ jint JvmtiExport::load_agent_library(const char *agent, const char *absParam, delete agent_lib; } + // Agent_OnAttach executed so completion status is JNI_OK st->print_cr("%d", result); + result = JNI_OK; } } return result; diff --git a/hotspot/src/share/vm/services/diagnosticCommand.cpp b/hotspot/src/share/vm/services/diagnosticCommand.cpp index d5338b2609..c90bf08e39 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.cpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp @@ -277,12 +277,11 @@ void JVMTIAgentLoadDCmd::execute(DCmdSource source, TRAPS) { char *suffix = strrchr(_libpath.value(), '.'); bool is_java_agent = (suffix != NULL) && (strncmp(".jar", suffix, 4) == 0); - jint result = JNI_ERR; if (is_java_agent) { if (_option.value() == NULL) { - result = JvmtiExport::load_agent_library("instrument", "false", - _libpath.value(), output()); + JvmtiExport::load_agent_library("instrument", "false", + _libpath.value(), output()); } else { size_t opt_len = strlen(_libpath.value()) + strlen(_option.value()) + 2; if (opt_len > 4096) { @@ -299,18 +298,14 @@ void JVMTIAgentLoadDCmd::execute(DCmdSource source, TRAPS) { } jio_snprintf(opt, opt_len, "%s=%s", _libpath.value(), _option.value()); - result = JvmtiExport::load_agent_library("instrument", "false", - opt, output()); + JvmtiExport::load_agent_library("instrument", "false", opt, output()); os::free(opt); } } else { - result = JvmtiExport::load_agent_library(_libpath.value(), "true", - _option.value(), output()); + JvmtiExport::load_agent_library(_libpath.value(), "true", + _option.value(), output()); } - - output()->print_cr("JVMTI agent attach %s.", - (result == JNI_OK) ? "succeeded" : "failed"); } int JVMTIAgentLoadDCmd::num_arguments() { -- GitLab