author | ysuenaga |
Wed, 03 Jun 2015 08:49:34 +0900 | |
changeset 31032 | 8e72621ca186 |
parent 30764 | fec48bf5a827 |
child 31371 | 311143309e73 |
child 33960 | 5430c1d350f0 |
permissions | -rw-r--r-- |
11209 | 1 |
/* |
29071
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
2 |
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. |
11209 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#include "precompiled.hpp" |
|
25051
8110ec6e7340
8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
24424
diff
changeset
|
26 |
#include "classfile/classLoaderStats.hpp" |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
26587
diff
changeset
|
27 |
#include "classfile/compactHashtable.hpp" |
30764 | 28 |
#include "gc/shared/vmGCOperations.hpp" |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
28935
diff
changeset
|
29 |
#include "oops/oop.inline.hpp" |
11441 | 30 |
#include "runtime/javaCalls.hpp" |
22490
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
31 |
#include "runtime/os.hpp" |
11209 | 32 |
#include "services/diagnosticArgument.hpp" |
33 |
#include "services/diagnosticCommand.hpp" |
|
34 |
#include "services/diagnosticFramework.hpp" |
|
11441 | 35 |
#include "services/heapDumper.hpp" |
36 |
#include "services/management.hpp" |
|
30764 | 37 |
#include "services/writeableFlags.hpp" |
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
13977
diff
changeset
|
38 |
#include "utilities/macros.hpp" |
11209 | 39 |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
23517
diff
changeset
|
40 |
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC |
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
23517
diff
changeset
|
41 |
|
11598
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
42 |
void DCmdRegistrant::register_dcmds(){ |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
43 |
// Registration of the diagnostic commands |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
44 |
// First argument specifies which interfaces will export the command |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
45 |
// Second argument specifies if the command is enabled |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
46 |
// Third argument specifies if the command is hidden |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
47 |
uint32_t full_export = DCmd_Source_Internal | DCmd_Source_AttachAPI |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
48 |
| DCmd_Source_MBean; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
49 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HelpDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
50 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VersionDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
51 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CommandLineDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
52 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintSystemPropertiesDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
53 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintVMFlagsDCmd>(full_export, true, false)); |
30121
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
54 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SetVMFlagDCmd>(full_export, true, false)); |
22490
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
55 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMDynamicLibrariesDCmd>(full_export, true, false)); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
56 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
57 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
58 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false)); |
15437 | 59 |
#if INCLUDE_SERVICES // Heap dumping/inspection supported |
20662
3296bf2cc204
8020789: Disable exporting of gc.heap_dump diagnostic command
sgabdura
parents:
18025
diff
changeset
|
60 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false)); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
61 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
62 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false)); |
29071
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
63 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHierarchyDCmd>(full_export, true, false)); |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
26587
diff
changeset
|
64 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false)); |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
26587
diff
changeset
|
65 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false)); |
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
66 |
#endif // INCLUDE_SERVICES |
30121
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
67 |
#if INCLUDE_JVMTI |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
68 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JVMTIDataDumpDCmd>(full_export, true, false)); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
69 |
#endif // INCLUDE_JVMTI |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
70 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false)); |
23517 | 71 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RotateGCLogDCmd>(full_export, true, false)); |
25051
8110ec6e7340
8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
24424
diff
changeset
|
72 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderStatsDCmd>(full_export, true, false)); |
26587 | 73 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompileQueueDCmd>(full_export, true, false)); |
74 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeListDCmd>(full_export, true, false)); |
|
75 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeCacheDCmd>(full_export, true, false)); |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
76 |
|
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
77 |
// Enhanced JMX Agent Support |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
78 |
// These commands won't be exported via the DiagnosticCommandMBean until an |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
79 |
// appropriate permission is created for them |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
80 |
uint32_t jmx_agent_export_flags = DCmd_Source_Internal | DCmd_Source_AttachAPI; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
81 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartRemoteDCmd>(jmx_agent_export_flags, true,false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
82 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartLocalDCmd>(jmx_agent_export_flags, true,false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
83 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStopRemoteDCmd>(jmx_agent_export_flags, true,false)); |
30134
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
84 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStatusDCmd>(jmx_agent_export_flags, true,false)); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
85 |
|
11598
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
86 |
} |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
87 |
|
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
88 |
#ifndef HAVE_EXTRA_DCMD |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
89 |
void DCmdRegistrant::register_dcmds_ext(){ |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
90 |
// Do nothing here |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
91 |
} |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
92 |
#endif |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
93 |
|
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
94 |
|
11441 | 95 |
HelpDCmd::HelpDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap), |
11209 | 96 |
_all("-all", "Show help for all commands", "BOOLEAN", false, "false"), |
97 |
_cmd("command name", "The name of the command for which we want help", |
|
98 |
"STRING", false) { |
|
99 |
_dcmdparser.add_dcmd_option(&_all); |
|
100 |
_dcmdparser.add_dcmd_argument(&_cmd); |
|
101 |
}; |
|
102 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
103 |
void HelpDCmd::execute(DCmdSource source, TRAPS) { |
11209 | 104 |
if (_all.value()) { |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
105 |
GrowableArray<const char*>* cmd_list = DCmdFactory::DCmd_list(source); |
11209 | 106 |
for (int i = 0; i < cmd_list->length(); i++) { |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
107 |
DCmdFactory* factory = DCmdFactory::factory(source, cmd_list->at(i), |
11209 | 108 |
strlen(cmd_list->at(i))); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
109 |
output()->print_cr("%s%s", factory->name(), |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
110 |
factory->is_enabled() ? "" : " [disabled]"); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
111 |
output()->print_cr("\t%s", factory->description()); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
112 |
output()->cr(); |
11209 | 113 |
factory = factory->next(); |
114 |
} |
|
115 |
} else if (_cmd.has_value()) { |
|
116 |
DCmd* cmd = NULL; |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
117 |
DCmdFactory* factory = DCmdFactory::factory(source, _cmd.value(), |
11209 | 118 |
strlen(_cmd.value())); |
119 |
if (factory != NULL) { |
|
120 |
output()->print_cr("%s%s", factory->name(), |
|
121 |
factory->is_enabled() ? "" : " [disabled]"); |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
23517
diff
changeset
|
122 |
output()->print_cr("%s", factory->description()); |
11209 | 123 |
output()->print_cr("\nImpact: %s", factory->impact()); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
124 |
JavaPermission p = factory->permission(); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
125 |
if(p._class != NULL) { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
126 |
if(p._action != NULL) { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
127 |
output()->print_cr("\nPermission: %s(%s, %s)", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
128 |
p._class, p._name == NULL ? "null" : p._name, p._action); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
129 |
} else { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
130 |
output()->print_cr("\nPermission: %s(%s)", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
131 |
p._class, p._name == NULL ? "null" : p._name); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
132 |
} |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
133 |
} |
11441 | 134 |
output()->cr(); |
11209 | 135 |
cmd = factory->create_resource_instance(output()); |
136 |
if (cmd != NULL) { |
|
137 |
DCmdMark mark(cmd); |
|
11441 | 138 |
cmd->print_help(factory->name()); |
11209 | 139 |
} |
140 |
} else { |
|
141 |
output()->print_cr("Help unavailable : '%s' : No such command", _cmd.value()); |
|
142 |
} |
|
143 |
} else { |
|
144 |
output()->print_cr("The following commands are available:"); |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
145 |
GrowableArray<const char *>* cmd_list = DCmdFactory::DCmd_list(source); |
11209 | 146 |
for (int i = 0; i < cmd_list->length(); i++) { |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
147 |
DCmdFactory* factory = DCmdFactory::factory(source, cmd_list->at(i), |
11209 | 148 |
strlen(cmd_list->at(i))); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
149 |
output()->print_cr("%s%s", factory->name(), |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
150 |
factory->is_enabled() ? "" : " [disabled]"); |
11209 | 151 |
factory = factory->_next; |
152 |
} |
|
153 |
output()->print_cr("\nFor more information about a specific command use 'help <command>'."); |
|
154 |
} |
|
155 |
} |
|
156 |
||
157 |
int HelpDCmd::num_arguments() { |
|
158 |
ResourceMark rm; |
|
159 |
HelpDCmd* dcmd = new HelpDCmd(NULL, false); |
|
160 |
if (dcmd != NULL) { |
|
161 |
DCmdMark mark(dcmd); |
|
162 |
return dcmd->_dcmdparser.num_arguments(); |
|
163 |
} else { |
|
164 |
return 0; |
|
165 |
} |
|
166 |
} |
|
167 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
168 |
void VersionDCmd::execute(DCmdSource source, TRAPS) { |
11209 | 169 |
output()->print_cr("%s version %s", Abstract_VM_Version::vm_name(), |
170 |
Abstract_VM_Version::vm_release()); |
|
171 |
JDK_Version jdk_version = JDK_Version::current(); |
|
172 |
if (jdk_version.update_version() > 0) { |
|
173 |
output()->print_cr("JDK %d.%d_%02d", jdk_version.major_version(), |
|
174 |
jdk_version.minor_version(), jdk_version.update_version()); |
|
175 |
} else { |
|
176 |
output()->print_cr("JDK %d.%d", jdk_version.major_version(), |
|
177 |
jdk_version.minor_version()); |
|
178 |
} |
|
179 |
} |
|
11441 | 180 |
|
181 |
PrintVMFlagsDCmd::PrintVMFlagsDCmd(outputStream* output, bool heap) : |
|
182 |
DCmdWithParser(output, heap), |
|
183 |
_all("-all", "Print all flags supported by the VM", "BOOLEAN", false, "false") { |
|
184 |
_dcmdparser.add_dcmd_option(&_all); |
|
185 |
} |
|
186 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
187 |
void PrintVMFlagsDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 188 |
if (_all.value()) { |
189 |
CommandLineFlags::printFlags(output(), true); |
|
190 |
} else { |
|
191 |
CommandLineFlags::printSetFlags(output()); |
|
192 |
} |
|
193 |
} |
|
194 |
||
195 |
int PrintVMFlagsDCmd::num_arguments() { |
|
196 |
ResourceMark rm; |
|
197 |
PrintVMFlagsDCmd* dcmd = new PrintVMFlagsDCmd(NULL, false); |
|
198 |
if (dcmd != NULL) { |
|
199 |
DCmdMark mark(dcmd); |
|
200 |
return dcmd->_dcmdparser.num_arguments(); |
|
201 |
} else { |
|
202 |
return 0; |
|
203 |
} |
|
204 |
} |
|
205 |
||
30121
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
206 |
SetVMFlagDCmd::SetVMFlagDCmd(outputStream* output, bool heap) : |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
207 |
DCmdWithParser(output, heap), |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
208 |
_flag("flag name", "The name of the flag we want to set", |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
209 |
"STRING", true), |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
210 |
_value("string value", "The value we want to set", "STRING", false) { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
211 |
_dcmdparser.add_dcmd_argument(&_flag); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
212 |
_dcmdparser.add_dcmd_argument(&_value); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
213 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
214 |
|
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
215 |
void SetVMFlagDCmd::execute(DCmdSource source, TRAPS) { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
216 |
const char* val = NULL; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
217 |
if (_value.value() != NULL) { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
218 |
val = _value.value(); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
219 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
220 |
|
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
221 |
FormatBuffer<80> err_msg("%s", ""); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
222 |
int ret = WriteableFlags::set_flag(_flag.value(), val, Flag::MANAGEMENT, err_msg); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
223 |
|
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
224 |
if (ret != WriteableFlags::SUCCESS) { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
225 |
output()->print_cr("%s", err_msg.buffer()); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
226 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
227 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
228 |
|
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
229 |
int SetVMFlagDCmd::num_arguments() { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
230 |
ResourceMark rm; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
231 |
SetVMFlagDCmd* dcmd = new SetVMFlagDCmd(NULL, false); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
232 |
if (dcmd != NULL) { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
233 |
DCmdMark mark(dcmd); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
234 |
return dcmd->_dcmdparser.num_arguments(); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
235 |
} else { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
236 |
return 0; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
237 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
238 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
239 |
|
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
240 |
void JVMTIDataDumpDCmd::execute(DCmdSource source, TRAPS) { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
241 |
if (JvmtiExport::should_post_data_dump()) { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
242 |
JvmtiExport::post_data_dump(); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
243 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
244 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29085
diff
changeset
|
245 |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
246 |
void PrintSystemPropertiesDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 247 |
// load sun.misc.VMSupport |
248 |
Symbol* klass = vmSymbols::sun_misc_VMSupport(); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11953
diff
changeset
|
249 |
Klass* k = SystemDictionary::resolve_or_fail(klass, true, CHECK); |
11441 | 250 |
instanceKlassHandle ik (THREAD, k); |
251 |
if (ik->should_be_initialized()) { |
|
252 |
ik->initialize(THREAD); |
|
253 |
} |
|
254 |
if (HAS_PENDING_EXCEPTION) { |
|
255 |
java_lang_Throwable::print(PENDING_EXCEPTION, output()); |
|
256 |
output()->cr(); |
|
257 |
CLEAR_PENDING_EXCEPTION; |
|
258 |
return; |
|
259 |
} |
|
260 |
||
261 |
// invoke the serializePropertiesToByteArray method |
|
262 |
JavaValue result(T_OBJECT); |
|
263 |
JavaCallArguments args; |
|
264 |
||
265 |
Symbol* signature = vmSymbols::serializePropertiesToByteArray_signature(); |
|
266 |
JavaCalls::call_static(&result, |
|
267 |
ik, |
|
268 |
vmSymbols::serializePropertiesToByteArray_name(), |
|
269 |
signature, |
|
270 |
&args, |
|
271 |
THREAD); |
|
272 |
if (HAS_PENDING_EXCEPTION) { |
|
273 |
java_lang_Throwable::print(PENDING_EXCEPTION, output()); |
|
274 |
output()->cr(); |
|
275 |
CLEAR_PENDING_EXCEPTION; |
|
276 |
return; |
|
277 |
} |
|
278 |
||
279 |
// The result should be a [B |
|
280 |
oop res = (oop)result.get_jobject(); |
|
281 |
assert(res->is_typeArray(), "just checking"); |
|
13952
e3cf184080bc
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
13728
diff
changeset
|
282 |
assert(TypeArrayKlass::cast(res->klass())->element_type() == T_BYTE, "just checking"); |
11441 | 283 |
|
284 |
// copy the bytes to the output stream |
|
285 |
typeArrayOop ba = typeArrayOop(res); |
|
286 |
jbyte* addr = typeArrayOop(res)->byte_at_addr(0); |
|
287 |
output()->print_raw((const char*)addr, ba->length()); |
|
288 |
} |
|
289 |
||
290 |
VMUptimeDCmd::VMUptimeDCmd(outputStream* output, bool heap) : |
|
291 |
DCmdWithParser(output, heap), |
|
292 |
_date("-date", "Add a prefix with current date", "BOOLEAN", false, "false") { |
|
293 |
_dcmdparser.add_dcmd_option(&_date); |
|
294 |
} |
|
295 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
296 |
void VMUptimeDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 297 |
if (_date.value()) { |
298 |
output()->date_stamp(true, "", ": "); |
|
299 |
} |
|
300 |
output()->time_stamp().update_to(tty->time_stamp().ticks()); |
|
301 |
output()->stamp(); |
|
302 |
output()->print_cr(" s"); |
|
303 |
} |
|
304 |
||
305 |
int VMUptimeDCmd::num_arguments() { |
|
306 |
ResourceMark rm; |
|
307 |
VMUptimeDCmd* dcmd = new VMUptimeDCmd(NULL, false); |
|
308 |
if (dcmd != NULL) { |
|
309 |
DCmdMark mark(dcmd); |
|
310 |
return dcmd->_dcmdparser.num_arguments(); |
|
311 |
} else { |
|
312 |
return 0; |
|
313 |
} |
|
314 |
} |
|
315 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
316 |
void SystemGCDCmd::execute(DCmdSource source, TRAPS) { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
317 |
if (!DisableExplicitGC) { |
31032
8e72621ca186
8072913: [REDO] GCCause should distinguish jcmd GC.run from System.gc()
ysuenaga
parents:
30764
diff
changeset
|
318 |
Universe::heap()->collect(GCCause::_dcmd_gc_run); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
319 |
} else { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
320 |
output()->print_cr("Explicit GC is disabled, no GC has been performed."); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
321 |
} |
11441 | 322 |
} |
323 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
324 |
void RunFinalizationDCmd::execute(DCmdSource source, TRAPS) { |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11953
diff
changeset
|
325 |
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), |
11441 | 326 |
true, CHECK); |
327 |
instanceKlassHandle klass(THREAD, k); |
|
328 |
JavaValue result(T_VOID); |
|
329 |
JavaCalls::call_static(&result, klass, |
|
330 |
vmSymbols::run_finalization_name(), |
|
331 |
vmSymbols::void_method_signature(), CHECK); |
|
332 |
} |
|
333 |
||
15437 | 334 |
#if INCLUDE_SERVICES // Heap dumping/inspection supported |
11441 | 335 |
HeapDumpDCmd::HeapDumpDCmd(outputStream* output, bool heap) : |
336 |
DCmdWithParser(output, heap), |
|
337 |
_filename("filename","Name of the dump file", "STRING",true), |
|
338 |
_all("-all", "Dump all objects, including unreachable objects", |
|
339 |
"BOOLEAN", false, "false") { |
|
340 |
_dcmdparser.add_dcmd_option(&_all); |
|
341 |
_dcmdparser.add_dcmd_argument(&_filename); |
|
342 |
} |
|
343 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
344 |
void HeapDumpDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 345 |
// Request a full GC before heap dump if _all is false |
346 |
// This helps reduces the amount of unreachable objects in the dump |
|
347 |
// and makes it easier to browse. |
|
348 |
HeapDumper dumper(!_all.value() /* request GC if _all is false*/); |
|
349 |
int res = dumper.dump(_filename.value()); |
|
350 |
if (res == 0) { |
|
351 |
output()->print_cr("Heap dump file created"); |
|
352 |
} else { |
|
353 |
// heap dump failed |
|
354 |
ResourceMark rm; |
|
355 |
char* error = dumper.error_as_C_string(); |
|
356 |
if (error == NULL) { |
|
357 |
output()->print_cr("Dump failed - reason unknown"); |
|
358 |
} else { |
|
359 |
output()->print_cr("%s", error); |
|
360 |
} |
|
361 |
} |
|
362 |
} |
|
363 |
||
364 |
int HeapDumpDCmd::num_arguments() { |
|
365 |
ResourceMark rm; |
|
366 |
HeapDumpDCmd* dcmd = new HeapDumpDCmd(NULL, false); |
|
367 |
if (dcmd != NULL) { |
|
368 |
DCmdMark mark(dcmd); |
|
369 |
return dcmd->_dcmdparser.num_arguments(); |
|
370 |
} else { |
|
371 |
return 0; |
|
372 |
} |
|
373 |
} |
|
374 |
||
375 |
ClassHistogramDCmd::ClassHistogramDCmd(outputStream* output, bool heap) : |
|
376 |
DCmdWithParser(output, heap), |
|
377 |
_all("-all", "Inspect all objects, including unreachable objects", |
|
378 |
"BOOLEAN", false, "false") { |
|
379 |
_dcmdparser.add_dcmd_option(&_all); |
|
380 |
} |
|
381 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
382 |
void ClassHistogramDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 383 |
VM_GC_HeapInspection heapop(output(), |
18025 | 384 |
!_all.value() /* request full gc if false */); |
11441 | 385 |
VMThread::execute(&heapop); |
386 |
} |
|
387 |
||
388 |
int ClassHistogramDCmd::num_arguments() { |
|
389 |
ResourceMark rm; |
|
390 |
ClassHistogramDCmd* dcmd = new ClassHistogramDCmd(NULL, false); |
|
391 |
if (dcmd != NULL) { |
|
392 |
DCmdMark mark(dcmd); |
|
393 |
return dcmd->_dcmdparser.num_arguments(); |
|
394 |
} else { |
|
395 |
return 0; |
|
396 |
} |
|
397 |
} |
|
398 |
||
15437 | 399 |
#define DEFAULT_COLUMNS "InstBytes,KlassBytes,CpAll,annotations,MethodCount,Bytecodes,MethodAll,ROAll,RWAll,Total" |
400 |
ClassStatsDCmd::ClassStatsDCmd(outputStream* output, bool heap) : |
|
401 |
DCmdWithParser(output, heap), |
|
402 |
_csv("-csv", "Print in CSV (comma-separated values) format for spreadsheets", |
|
403 |
"BOOLEAN", false, "false"), |
|
404 |
_all("-all", "Show all columns", |
|
405 |
"BOOLEAN", false, "false"), |
|
406 |
_help("-help", "Show meaning of all the columns", |
|
407 |
"BOOLEAN", false, "false"), |
|
408 |
_columns("columns", "Comma-separated list of all the columns to show. " |
|
409 |
"If not specified, the following columns are shown: " DEFAULT_COLUMNS, |
|
410 |
"STRING", false) { |
|
411 |
_dcmdparser.add_dcmd_option(&_all); |
|
412 |
_dcmdparser.add_dcmd_option(&_csv); |
|
413 |
_dcmdparser.add_dcmd_option(&_help); |
|
414 |
_dcmdparser.add_dcmd_argument(&_columns); |
|
415 |
} |
|
416 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
417 |
void ClassStatsDCmd::execute(DCmdSource source, TRAPS) { |
15437 | 418 |
if (!UnlockDiagnosticVMOptions) { |
419 |
output()->print_cr("GC.class_stats command requires -XX:+UnlockDiagnosticVMOptions"); |
|
420 |
return; |
|
421 |
} |
|
422 |
||
423 |
VM_GC_HeapInspection heapop(output(), |
|
18025 | 424 |
true /* request_full_gc */); |
15437 | 425 |
heapop.set_csv_format(_csv.value()); |
426 |
heapop.set_print_help(_help.value()); |
|
427 |
heapop.set_print_class_stats(true); |
|
428 |
if (_all.value()) { |
|
429 |
if (_columns.has_value()) { |
|
430 |
output()->print_cr("Cannot specify -all and individual columns at the same time"); |
|
431 |
return; |
|
432 |
} else { |
|
433 |
heapop.set_columns(NULL); |
|
434 |
} |
|
435 |
} else { |
|
436 |
if (_columns.has_value()) { |
|
437 |
heapop.set_columns(_columns.value()); |
|
438 |
} else { |
|
439 |
heapop.set_columns(DEFAULT_COLUMNS); |
|
440 |
} |
|
441 |
} |
|
442 |
VMThread::execute(&heapop); |
|
443 |
} |
|
444 |
||
445 |
int ClassStatsDCmd::num_arguments() { |
|
446 |
ResourceMark rm; |
|
447 |
ClassStatsDCmd* dcmd = new ClassStatsDCmd(NULL, false); |
|
448 |
if (dcmd != NULL) { |
|
449 |
DCmdMark mark(dcmd); |
|
450 |
return dcmd->_dcmdparser.num_arguments(); |
|
451 |
} else { |
|
452 |
return 0; |
|
453 |
} |
|
454 |
} |
|
455 |
#endif // INCLUDE_SERVICES |
|
456 |
||
11441 | 457 |
ThreadDumpDCmd::ThreadDumpDCmd(outputStream* output, bool heap) : |
458 |
DCmdWithParser(output, heap), |
|
459 |
_locks("-l", "print java.util.concurrent locks", "BOOLEAN", false, "false") { |
|
460 |
_dcmdparser.add_dcmd_option(&_locks); |
|
461 |
} |
|
462 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
463 |
void ThreadDumpDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 464 |
// thread stacks |
465 |
VM_PrintThreads op1(output(), _locks.value()); |
|
466 |
VMThread::execute(&op1); |
|
467 |
||
468 |
// JNI global handles |
|
469 |
VM_PrintJNI op2(output()); |
|
470 |
VMThread::execute(&op2); |
|
471 |
||
472 |
// Deadlock detection |
|
473 |
VM_FindDeadlocks op3(output()); |
|
474 |
VMThread::execute(&op3); |
|
475 |
} |
|
476 |
||
477 |
int ThreadDumpDCmd::num_arguments() { |
|
478 |
ResourceMark rm; |
|
479 |
ThreadDumpDCmd* dcmd = new ThreadDumpDCmd(NULL, false); |
|
480 |
if (dcmd != NULL) { |
|
481 |
DCmdMark mark(dcmd); |
|
482 |
return dcmd->_dcmdparser.num_arguments(); |
|
483 |
} else { |
|
484 |
return 0; |
|
485 |
} |
|
486 |
} |
|
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
487 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
488 |
// Enhanced JMX Agent support |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
489 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
490 |
JMXStartRemoteDCmd::JMXStartRemoteDCmd(outputStream *output, bool heap_allocated) : |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
491 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
492 |
DCmdWithParser(output, heap_allocated), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
493 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
494 |
_config_file |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
495 |
("config.file", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
496 |
"set com.sun.management.config.file", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
497 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
498 |
_jmxremote_port |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
499 |
("jmxremote.port", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
500 |
"set com.sun.management.jmxremote.port", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
501 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
502 |
_jmxremote_rmi_port |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
503 |
("jmxremote.rmi.port", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
504 |
"set com.sun.management.jmxremote.rmi.port", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
505 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
506 |
_jmxremote_ssl |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
507 |
("jmxremote.ssl", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
508 |
"set com.sun.management.jmxremote.ssl", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
509 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
510 |
_jmxremote_registry_ssl |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
511 |
("jmxremote.registry.ssl", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
512 |
"set com.sun.management.jmxremote.registry.ssl", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
513 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
514 |
_jmxremote_authenticate |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
515 |
("jmxremote.authenticate", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
516 |
"set com.sun.management.jmxremote.authenticate", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
517 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
518 |
_jmxremote_password_file |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
519 |
("jmxremote.password.file", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
520 |
"set com.sun.management.jmxremote.password.file", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
521 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
522 |
_jmxremote_access_file |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
523 |
("jmxremote.access.file", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
524 |
"set com.sun.management.jmxremote.access.file", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
525 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
526 |
_jmxremote_login_config |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
527 |
("jmxremote.login.config", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
528 |
"set com.sun.management.jmxremote.login.config", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
529 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
530 |
_jmxremote_ssl_enabled_cipher_suites |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
531 |
("jmxremote.ssl.enabled.cipher.suites", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
532 |
"set com.sun.management.jmxremote.ssl.enabled.cipher.suite", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
533 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
534 |
_jmxremote_ssl_enabled_protocols |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
535 |
("jmxremote.ssl.enabled.protocols", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
536 |
"set com.sun.management.jmxremote.ssl.enabled.protocols", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
537 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
538 |
_jmxremote_ssl_need_client_auth |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
539 |
("jmxremote.ssl.need.client.auth", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
540 |
"set com.sun.management.jmxremote.need.client.auth", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
541 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
542 |
_jmxremote_ssl_config_file |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
543 |
("jmxremote.ssl.config.file", |
15460
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
544 |
"set com.sun.management.jmxremote.ssl_config_file", "STRING", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
545 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
546 |
// JDP Protocol support |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
547 |
_jmxremote_autodiscovery |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
548 |
("jmxremote.autodiscovery", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
549 |
"set com.sun.management.jmxremote.autodiscovery", "STRING", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
550 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
551 |
_jdp_port |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
552 |
("jdp.port", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
553 |
"set com.sun.management.jdp.port", "INT", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
554 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
555 |
_jdp_address |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
556 |
("jdp.address", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
557 |
"set com.sun.management.jdp.address", "STRING", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
558 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
559 |
_jdp_source_addr |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
560 |
("jdp.source_addr", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
561 |
"set com.sun.management.jdp.source_addr", "STRING", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
562 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
563 |
_jdp_ttl |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
564 |
("jdp.ttl", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
565 |
"set com.sun.management.jdp.ttl", "INT", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
566 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
567 |
_jdp_pause |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
568 |
("jdp.pause", |
21076
7cea9d36a46e
8026930: In ManagementAgent.start it should be possible to set the jdp.name parameter (hotspot part)
dsamersoff
parents:
18025
diff
changeset
|
569 |
"set com.sun.management.jdp.pause", "INT", false), |
7cea9d36a46e
8026930: In ManagementAgent.start it should be possible to set the jdp.name parameter (hotspot part)
dsamersoff
parents:
18025
diff
changeset
|
570 |
|
7cea9d36a46e
8026930: In ManagementAgent.start it should be possible to set the jdp.name parameter (hotspot part)
dsamersoff
parents:
18025
diff
changeset
|
571 |
_jdp_name |
7cea9d36a46e
8026930: In ManagementAgent.start it should be possible to set the jdp.name parameter (hotspot part)
dsamersoff
parents:
18025
diff
changeset
|
572 |
("jdp.name", |
7cea9d36a46e
8026930: In ManagementAgent.start it should be possible to set the jdp.name parameter (hotspot part)
dsamersoff
parents:
18025
diff
changeset
|
573 |
"set com.sun.management.jdp.name", "STRING", false) |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
574 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
575 |
{ |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
576 |
_dcmdparser.add_dcmd_option(&_config_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
577 |
_dcmdparser.add_dcmd_option(&_jmxremote_port); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
578 |
_dcmdparser.add_dcmd_option(&_jmxremote_rmi_port); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
579 |
_dcmdparser.add_dcmd_option(&_jmxremote_ssl); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
580 |
_dcmdparser.add_dcmd_option(&_jmxremote_registry_ssl); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
581 |
_dcmdparser.add_dcmd_option(&_jmxremote_authenticate); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
582 |
_dcmdparser.add_dcmd_option(&_jmxremote_password_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
583 |
_dcmdparser.add_dcmd_option(&_jmxremote_access_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
584 |
_dcmdparser.add_dcmd_option(&_jmxremote_login_config); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
585 |
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_enabled_cipher_suites); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
586 |
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_enabled_protocols); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
587 |
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_need_client_auth); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
588 |
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_config_file); |
15460
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
589 |
_dcmdparser.add_dcmd_option(&_jmxremote_autodiscovery); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
590 |
_dcmdparser.add_dcmd_option(&_jdp_port); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
591 |
_dcmdparser.add_dcmd_option(&_jdp_address); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
592 |
_dcmdparser.add_dcmd_option(&_jdp_source_addr); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
593 |
_dcmdparser.add_dcmd_option(&_jdp_ttl); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
594 |
_dcmdparser.add_dcmd_option(&_jdp_pause); |
21076
7cea9d36a46e
8026930: In ManagementAgent.start it should be possible to set the jdp.name parameter (hotspot part)
dsamersoff
parents:
18025
diff
changeset
|
595 |
_dcmdparser.add_dcmd_option(&_jdp_name); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
596 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
597 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
598 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
599 |
int JMXStartRemoteDCmd::num_arguments() { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
600 |
ResourceMark rm; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
601 |
JMXStartRemoteDCmd* dcmd = new JMXStartRemoteDCmd(NULL, false); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
602 |
if (dcmd != NULL) { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
603 |
DCmdMark mark(dcmd); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
604 |
return dcmd->_dcmdparser.num_arguments(); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
605 |
} else { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
606 |
return 0; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
607 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
608 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
609 |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
610 |
|
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
611 |
void JMXStartRemoteDCmd::execute(DCmdSource source, TRAPS) { |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
612 |
ResourceMark rm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
613 |
HandleMark hm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
614 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
615 |
// Load and initialize the sun.management.Agent class |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
616 |
// invoke startRemoteManagementAgent(string) method to start |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
617 |
// the remote management server. |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
618 |
// throw java.lang.NoSuchMethodError if the method doesn't exist |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
619 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
620 |
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11953
diff
changeset
|
621 |
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
622 |
instanceKlassHandle ik (THREAD, k); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
623 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
624 |
JavaValue result(T_VOID); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
625 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
626 |
// Pass all command line arguments to java as key=value,... |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
627 |
// All checks are done on java side |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
628 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
629 |
int len = 0; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
630 |
stringStream options; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
631 |
char comma[2] = {0,0}; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
632 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
633 |
// Leave default values on Agent.class side and pass only |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
634 |
// agruments explicitly set by user. All arguments passed |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
635 |
// to jcmd override properties with the same name set by |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
636 |
// command line with -D or by managmenent.properties |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
637 |
// file. |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
638 |
#define PUT_OPTION(a) \ |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
639 |
if ( (a).is_set() ){ \ |
15460
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
640 |
options.print(\ |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
641 |
( *((a).type()) == 'I' ) ? "%scom.sun.management.%s=%d" : "%scom.sun.management.%s=%s",\ |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
642 |
comma, (a).name(), (a).value()); \ |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
643 |
comma[0] = ','; \ |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
644 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
645 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
646 |
PUT_OPTION(_config_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
647 |
PUT_OPTION(_jmxremote_port); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
648 |
PUT_OPTION(_jmxremote_rmi_port); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
649 |
PUT_OPTION(_jmxremote_ssl); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
650 |
PUT_OPTION(_jmxremote_registry_ssl); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
651 |
PUT_OPTION(_jmxremote_authenticate); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
652 |
PUT_OPTION(_jmxremote_password_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
653 |
PUT_OPTION(_jmxremote_access_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
654 |
PUT_OPTION(_jmxremote_login_config); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
655 |
PUT_OPTION(_jmxremote_ssl_enabled_cipher_suites); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
656 |
PUT_OPTION(_jmxremote_ssl_enabled_protocols); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
657 |
PUT_OPTION(_jmxremote_ssl_need_client_auth); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
658 |
PUT_OPTION(_jmxremote_ssl_config_file); |
15460
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
659 |
PUT_OPTION(_jmxremote_autodiscovery); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
660 |
PUT_OPTION(_jdp_port); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
661 |
PUT_OPTION(_jdp_address); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
662 |
PUT_OPTION(_jdp_source_addr); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
663 |
PUT_OPTION(_jdp_ttl); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
664 |
PUT_OPTION(_jdp_pause); |
21076
7cea9d36a46e
8026930: In ManagementAgent.start it should be possible to set the jdp.name parameter (hotspot part)
dsamersoff
parents:
18025
diff
changeset
|
665 |
PUT_OPTION(_jdp_name); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
666 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
667 |
#undef PUT_OPTION |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
668 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
669 |
Handle str = java_lang_String::create_from_str(options.as_string(), CHECK); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
670 |
JavaCalls::call_static(&result, ik, vmSymbols::startRemoteAgent_name(), vmSymbols::string_void_signature(), str, CHECK); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
671 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
672 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
673 |
JMXStartLocalDCmd::JMXStartLocalDCmd(outputStream *output, bool heap_allocated) : |
22490
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
674 |
DCmd(output, heap_allocated) { |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
675 |
// do nothing |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
676 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
677 |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
678 |
void JMXStartLocalDCmd::execute(DCmdSource source, TRAPS) { |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
679 |
ResourceMark rm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
680 |
HandleMark hm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
681 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
682 |
// Load and initialize the sun.management.Agent class |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
683 |
// invoke startLocalManagementAgent(void) method to start |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
684 |
// the local management server |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
685 |
// throw java.lang.NoSuchMethodError if method doesn't exist |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
686 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
687 |
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11953
diff
changeset
|
688 |
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
689 |
instanceKlassHandle ik (THREAD, k); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
690 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
691 |
JavaValue result(T_VOID); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
692 |
JavaCalls::call_static(&result, ik, vmSymbols::startLocalAgent_name(), vmSymbols::void_method_signature(), CHECK); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
693 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
694 |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
695 |
void JMXStopRemoteDCmd::execute(DCmdSource source, TRAPS) { |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
696 |
ResourceMark rm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
697 |
HandleMark hm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
698 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
699 |
// Load and initialize the sun.management.Agent class |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
700 |
// invoke stopRemoteManagementAgent method to stop the |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
701 |
// management server |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
702 |
// throw java.lang.NoSuchMethodError if method doesn't exist |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
703 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
704 |
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11953
diff
changeset
|
705 |
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
706 |
instanceKlassHandle ik (THREAD, k); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
707 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
708 |
JavaValue result(T_VOID); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
709 |
JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
710 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
711 |
|
30134
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
712 |
JMXStatusDCmd::JMXStatusDCmd(outputStream *output, bool heap_allocated) : |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
713 |
DCmd(output, heap_allocated) { |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
714 |
// do nothing |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
715 |
} |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
716 |
|
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
717 |
void JMXStatusDCmd::execute(DCmdSource source, TRAPS) { |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
718 |
ResourceMark rm(THREAD); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
719 |
HandleMark hm(THREAD); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
720 |
|
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
721 |
// Load and initialize the sun.management.Agent class |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
722 |
// invoke getManagementAgentStatus() method to generate the status info |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
723 |
// throw java.lang.NoSuchMethodError if method doesn't exist |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
724 |
|
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
725 |
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
726 |
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
727 |
instanceKlassHandle ik (THREAD, k); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
728 |
|
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
729 |
JavaValue result(T_OBJECT); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
730 |
JavaCalls::call_static(&result, ik, vmSymbols::getAgentStatus_name(), vmSymbols::void_string_signature(), CHECK); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
731 |
|
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
732 |
jvalue* jv = (jvalue*) result.get_value_addr(); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
733 |
oop str = (oop) jv->l; |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
734 |
if (str != NULL) { |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
735 |
char* out = java_lang_String::as_utf8_string(str); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
736 |
if (out) { |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
737 |
output()->print_cr("%s", out); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
738 |
return; |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
739 |
} |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
740 |
} |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
741 |
output()->print_cr("Error obtaining management agent status"); |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
742 |
} |
ecd7b08105e9
8023093: Add ManagementAgent.status diagnostic command
jbachorik
parents:
30121
diff
changeset
|
743 |
|
22490
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
744 |
VMDynamicLibrariesDCmd::VMDynamicLibrariesDCmd(outputStream *output, bool heap_allocated) : |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
745 |
DCmd(output, heap_allocated) { |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
746 |
// do nothing |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
747 |
} |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
748 |
|
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
749 |
void VMDynamicLibrariesDCmd::execute(DCmdSource source, TRAPS) { |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
750 |
os::print_dll_info(output()); |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
751 |
output()->cr(); |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21121
diff
changeset
|
752 |
} |
23517 | 753 |
|
754 |
void RotateGCLogDCmd::execute(DCmdSource source, TRAPS) { |
|
755 |
if (UseGCLogFileRotation) { |
|
756 |
VM_RotateGCLog rotateop(output()); |
|
757 |
VMThread::execute(&rotateop); |
|
758 |
} else { |
|
759 |
output()->print_cr("Target VM does not support GC log file rotation."); |
|
760 |
} |
|
761 |
} |
|
762 |
||
26587 | 763 |
void CompileQueueDCmd::execute(DCmdSource source, TRAPS) { |
764 |
VM_PrintCompileQueue printCompileQueueOp(output()); |
|
765 |
VMThread::execute(&printCompileQueueOp); |
|
766 |
} |
|
767 |
||
768 |
void CodeListDCmd::execute(DCmdSource source, TRAPS) { |
|
769 |
VM_PrintCodeList printCodeListOp(output()); |
|
770 |
VMThread::execute(&printCodeListOp); |
|
771 |
} |
|
772 |
||
773 |
void CodeCacheDCmd::execute(DCmdSource source, TRAPS) { |
|
774 |
VM_PrintCodeCache printCodeCacheOp(output()); |
|
775 |
VMThread::execute(&printCodeCacheOp); |
|
776 |
} |
|
777 |
||
29071
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
778 |
#if INCLUDE_SERVICES |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
779 |
ClassHierarchyDCmd::ClassHierarchyDCmd(outputStream* output, bool heap) : |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
780 |
DCmdWithParser(output, heap), |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
781 |
_print_interfaces("-i", "Inherited interfaces should be printed.", "BOOLEAN", false, "false"), |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
782 |
_print_subclasses("-s", "If a classname is specified, print its subclasses. " |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
783 |
"Otherwise only its superclasses are printed.", "BOOLEAN", false, "false"), |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
784 |
_classname("classname", "Name of class whose hierarchy should be printed. " |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
785 |
"If not specified, all class hierarchies are printed.", |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
786 |
"STRING", false) { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
787 |
_dcmdparser.add_dcmd_option(&_print_interfaces); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
788 |
_dcmdparser.add_dcmd_option(&_print_subclasses); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
789 |
_dcmdparser.add_dcmd_argument(&_classname); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
790 |
} |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
791 |
|
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
792 |
void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
793 |
VM_PrintClassHierarchy printClassHierarchyOp(output(), _print_interfaces.value(), |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
794 |
_print_subclasses.value(), _classname.value()); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
795 |
VMThread::execute(&printClassHierarchyOp); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
796 |
} |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
797 |
|
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
798 |
int ClassHierarchyDCmd::num_arguments() { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
799 |
ResourceMark rm; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
800 |
ClassHierarchyDCmd* dcmd = new ClassHierarchyDCmd(NULL, false); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
801 |
if (dcmd != NULL) { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
802 |
DCmdMark mark(dcmd); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
803 |
return dcmd->_dcmdparser.num_arguments(); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
804 |
} else { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
805 |
return 0; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
806 |
} |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
807 |
} |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
808 |
|
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28836
diff
changeset
|
809 |
#endif |