/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "gc_implementation/shared/vmGCOperations.hpp"
#include "runtime/javaCalls.hpp"
#include "services/diagnosticArgument.hpp"
#include "services/diagnosticCommand.hpp"
#include "services/diagnosticFramework.hpp"
#include "services/heapDumper.hpp"
#include "services/management.hpp"
// Registration of the diagnostic commands
// First boolean argument specifies if the command is enabled
// Second boolean argument specifies if the command is hidden
//Enhanced JMX Agent Support
}
#ifndef HAVE_EXTRA_DCMD
// Do nothing here
}
#endif
"STRING", false) {
};
}
}
}
} else {
}
} else {
}
}
}
}
} else {
return 0;
}
}
if (jdk_version.update_version() > 0) {
} else {
}
}
}
} else {
}
}
} else {
return 0;
}
}
// load sun.misc.VMSupport
if (ik->should_be_initialized()) {
}
if (HAS_PENDING_EXCEPTION) {
return;
}
// invoke the serializePropertiesToByteArray method
ik,
&args,
THREAD);
if (HAS_PENDING_EXCEPTION) {
return;
}
// The result should be a [B
// copy the bytes to the output stream
}
}
}
}
} else {
return 0;
}
}
}
true, CHECK);
}
"BOOLEAN", false, "false") {
}
// Request a full GC before heap dump if _all is false
// This helps reduces the amount of unreachable objects in the dump
// and makes it easier to browse.
if (res == 0) {
} else {
// heap dump failed
} else {
}
}
}
} else {
return 0;
}
}
"BOOLEAN", false, "false") {
}
true /* need_prologue */);
}
} else {
return 0;
}
}
}
// thread stacks
// JNI global handles
// Deadlock detection
}
} else {
return 0;
}
}
// Enhanced JMX Agent support
("config.file",
"set com.sun.management.config.file", "STRING", false),
("jmxremote.port",
"set com.sun.management.jmxremote.port", "STRING", false),
("jmxremote.rmi.port",
"set com.sun.management.jmxremote.rmi.port", "STRING", false),
("jmxremote.ssl",
"set com.sun.management.jmxremote.ssl", "STRING", false),
("jmxremote.registry.ssl",
"set com.sun.management.jmxremote.registry.ssl", "STRING", false),
("jmxremote.authenticate",
"set com.sun.management.jmxremote.authenticate", "STRING", false),
("jmxremote.password.file",
"set com.sun.management.jmxremote.password.file", "STRING", false),
("jmxremote.access.file",
"set com.sun.management.jmxremote.access.file", "STRING", false),
("jmxremote.login.config",
"set com.sun.management.jmxremote.login.config", "STRING", false),
("jmxremote.ssl.enabled.cipher.suites",
"set com.sun.management.jmxremote.ssl.enabled.cipher.suite", "STRING", false),
("jmxremote.ssl.enabled.protocols",
"set com.sun.management.jmxremote.ssl.enabled.protocols", "STRING", false),
("jmxremote.ssl.need.client.auth",
"set com.sun.management.jmxremote.need.client.auth", "STRING", false),
("jmxremote.ssl.config.file",
"set com.sun.management.jmxremote.ssl_config_file", "STRING", false),
// JDP Protocol support
("jmxremote.autodiscovery",
"set com.sun.management.jmxremote.autodiscovery", "STRING", false),
("jdp.port",
"set com.sun.management.jdp.port", "INT", false),
("jdp.address",
"set com.sun.management.jdp.address", "STRING", false),
("jdp.source_addr",
"set com.sun.management.jdp.source_addr", "STRING", false),
("jdp.ttl",
"set com.sun.management.jdp.ttl", "INT", false),
("jdp.pause",
"set com.sun.management.jdp.pause", "INT", false)
{
}
} else {
return 0;
}
}
// Load and initialize the sun.management.Agent class
// invoke startRemoteManagementAgent(string) method to start
// the remote management server.
// throw java.lang.NoSuchMethodError if the method doesn't exist
klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
// Pass all command line arguments to java as key=value,...
// All checks are done on java side
int len = 0;
// Leave default values on Agent.class side and pass only
// agruments explicitly set by user. All arguments passed
// to jcmd override properties with the same name set by
// command line with -D or by managmenent.properties
// file.
#define PUT_OPTION(a) \
if ( (a).is_set() ){ \
comma[0] = ','; \
}
JavaCalls::call_static(&result, ik, vmSymbols::startRemoteAgent_name(), vmSymbols::string_void_signature(), str, CHECK);
}
{
// do nothing
}
// Load and initialize the sun.management.Agent class
// invoke startLocalManagementAgent(void) method to start
// the local management server
// throw java.lang.NoSuchMethodError if method doesn't exist
klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
JavaCalls::call_static(&result, ik, vmSymbols::startLocalAgent_name(), vmSymbols::void_method_signature(), CHECK);
}
// Load and initialize the sun.management.Agent class
// invoke stopRemoteManagementAgent method to stop the
// management server
// throw java.lang.NoSuchMethodError if method doesn't exist
klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK);
}