Mercurial > hg > graal-compiler
annotate src/share/vm/services/diagnosticCommand.hpp @ 8002:8391fdd36e1f
Merge
author | dlong |
---|---|
date | Sun, 27 Jan 2013 01:07:09 -0800 |
parents | db9981fd3124 |
children | 3c9bc17b9403 |
rev | line source |
---|---|
4133 | 1 /* |
5895
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
4133 | 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 #ifndef SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP | |
26 #define SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP | |
27 | |
28 #include "runtime/arguments.hpp" | |
29 #include "classfile/vmSymbols.hpp" | |
30 #include "utilities/ostream.hpp" | |
31 #include "runtime/vm_version.hpp" | |
32 #include "runtime/vmThread.hpp" | |
33 #include "runtime/os.hpp" | |
34 #include "services/diagnosticArgument.hpp" | |
35 #include "services/diagnosticCommand.hpp" | |
36 #include "services/diagnosticFramework.hpp" | |
4851
a42c07c38c47
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
4773
diff
changeset
|
37 #include "services/diagnosticCommand_ext.hpp" |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6854
diff
changeset
|
38 #include "utilities/macros.hpp" |
4133 | 39 |
4773 | 40 class HelpDCmd : public DCmdWithParser { |
4133 | 41 protected: |
42 DCmdArgument<bool> _all; | |
43 DCmdArgument<char*> _cmd; | |
44 public: | |
45 HelpDCmd(outputStream* output, bool heap); | |
46 static const char* name() { return "help"; } | |
47 static const char* description() { | |
48 return "For more information about a specific command use 'help <command>'. " | |
49 "With no argument this will show a list of available commands. " | |
50 "'help all' will show help for all commands."; | |
51 } | |
6202
5a1f452f8f90
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
5895
diff
changeset
|
52 static const char* impact() { return "Low"; } |
4133 | 53 static int num_arguments(); |
54 virtual void execute(TRAPS); | |
55 }; | |
56 | |
57 class VersionDCmd : public DCmd { | |
58 public: | |
59 VersionDCmd(outputStream* output, bool heap) : DCmd(output,heap) { } | |
60 static const char* name() { return "VM.version"; } | |
61 static const char* description() { | |
62 return "Print JVM version information."; | |
63 } | |
6202
5a1f452f8f90
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
5895
diff
changeset
|
64 static const char* impact() { return "Low"; } |
4133 | 65 static int num_arguments() { return 0; } |
4773 | 66 virtual void execute(TRAPS); |
67 }; | |
68 | |
69 class CommandLineDCmd : public DCmd { | |
70 public: | |
71 CommandLineDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } | |
72 static const char* name() { return "VM.command_line"; } | |
73 static const char* description() { | |
74 return "Print the command line used to start this VM instance."; | |
75 } | |
6202
5a1f452f8f90
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
5895
diff
changeset
|
76 static const char* impact() { return "Low"; } |
4773 | 77 static int num_arguments() { return 0; } |
78 virtual void execute(TRAPS) { | |
79 Arguments::print_on(_output); | |
80 } | |
81 }; | |
82 | |
83 // See also: get_system_properties in attachListener.cpp | |
84 class PrintSystemPropertiesDCmd : public DCmd { | |
85 public: | |
86 PrintSystemPropertiesDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } | |
87 static const char* name() { return "VM.system_properties"; } | |
88 static const char* description() { | |
89 return "Print system properties."; | |
90 } | |
91 static const char* impact() { | |
6202
5a1f452f8f90
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
5895
diff
changeset
|
92 return "Low"; |
4773 | 93 } |
94 static int num_arguments() { return 0; } | |
95 virtual void execute(TRAPS); | |
96 }; | |
97 | |
98 // See also: print_flag in attachListener.cpp | |
99 class PrintVMFlagsDCmd : public DCmdWithParser { | |
100 protected: | |
101 DCmdArgument<bool> _all; | |
102 public: | |
103 PrintVMFlagsDCmd(outputStream* output, bool heap); | |
104 static const char* name() { return "VM.flags"; } | |
105 static const char* description() { | |
106 return "Print VM flag options and their current values."; | |
107 } | |
108 static const char* impact() { | |
6202
5a1f452f8f90
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
5895
diff
changeset
|
109 return "Low"; |
4773 | 110 } |
111 static int num_arguments(); | |
112 virtual void execute(TRAPS); | |
113 }; | |
114 | |
115 class VMUptimeDCmd : public DCmdWithParser { | |
116 protected: | |
117 DCmdArgument<bool> _date; | |
118 public: | |
119 VMUptimeDCmd(outputStream* output, bool heap); | |
120 static const char* name() { return "VM.uptime"; } | |
121 static const char* description() { | |
122 return "Print VM uptime."; | |
123 } | |
124 static const char* impact() { | |
6202
5a1f452f8f90
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
5895
diff
changeset
|
125 return "Low"; |
4773 | 126 } |
127 static int num_arguments(); | |
4133 | 128 virtual void execute(TRAPS); |
4773 | 129 }; |
130 | |
131 class SystemGCDCmd : public DCmd { | |
132 public: | |
133 SystemGCDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } | |
134 static const char* name() { return "GC.run"; } | |
135 static const char* description() { | |
136 return "Call java.lang.System.gc()."; | |
137 } | |
138 static const char* impact() { | |
139 return "Medium: Depends on Java heap size and content."; | |
140 } | |
141 static int num_arguments() { return 0; } | |
142 virtual void execute(TRAPS); | |
143 }; | |
144 | |
145 class RunFinalizationDCmd : public DCmd { | |
146 public: | |
147 RunFinalizationDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } | |
148 static const char* name() { return "GC.run_finalization"; } | |
149 static const char* description() { | |
150 return "Call java.lang.System.runFinalization()."; | |
151 } | |
152 static const char* impact() { | |
153 return "Medium: Depends on Java content."; | |
154 } | |
155 static int num_arguments() { return 0; } | |
156 virtual void execute(TRAPS); | |
157 }; | |
158 | |
6854
fb19af007ffc
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
6202
diff
changeset
|
159 #if INCLUDE_SERVICES // Heap dumping supported |
4773 | 160 // See also: dump_heap in attachListener.cpp |
161 class HeapDumpDCmd : public DCmdWithParser { | |
162 protected: | |
163 DCmdArgument<char*> _filename; | |
164 DCmdArgument<bool> _all; | |
165 public: | |
166 HeapDumpDCmd(outputStream* output, bool heap); | |
167 static const char* name() { | |
168 return "GC.heap_dump"; | |
169 } | |
170 static const char* description() { | |
171 return "Generate a HPROF format dump of the Java heap."; | |
172 } | |
173 static const char* impact() { | |
174 return "High: Depends on Java heap size and content. " | |
175 "Request a full GC unless the '-all' option is specified."; | |
176 } | |
177 static int num_arguments(); | |
178 virtual void execute(TRAPS); | |
179 }; | |
6854
fb19af007ffc
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
6202
diff
changeset
|
180 #endif // INCLUDE_SERVICES |
4773 | 181 |
182 // See also: inspeactheap in attachListener.cpp | |
183 class ClassHistogramDCmd : public DCmdWithParser { | |
184 protected: | |
185 DCmdArgument<bool> _all; | |
186 public: | |
187 ClassHistogramDCmd(outputStream* output, bool heap); | |
188 static const char* name() { | |
189 return "GC.class_histogram"; | |
190 } | |
191 static const char* description() { | |
192 return "Provide statistics about the Java heap usage."; | |
193 } | |
194 static const char* impact() { | |
195 return "High: Depends on Java heap size and content."; | |
196 } | |
197 static int num_arguments(); | |
198 virtual void execute(TRAPS); | |
199 }; | |
200 | |
201 // See also: thread_dump in attachListener.cpp | |
202 class ThreadDumpDCmd : public DCmdWithParser { | |
203 protected: | |
204 DCmdArgument<bool> _locks; | |
205 public: | |
206 ThreadDumpDCmd(outputStream* output, bool heap); | |
207 static const char* name() { return "Thread.print"; } | |
208 static const char* description() { | |
209 return "Print all threads with stacktraces."; | |
210 } | |
211 static const char* impact() { | |
212 return "Medium: Depends on the number of threads."; | |
213 } | |
214 static int num_arguments(); | |
215 virtual void execute(TRAPS); | |
4133 | 216 }; |
217 | |
5895
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
218 // Enhanced JMX Agent support |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
219 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
220 class JMXStartRemoteDCmd : public DCmdWithParser { |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
221 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
222 // Explicitly list all properties that could be |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
223 // passed to Agent.startRemoteManagementAgent() |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
224 // com.sun.management is omitted |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
225 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
226 DCmdArgument<char *> _config_file; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
227 DCmdArgument<char *> _jmxremote_port; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
228 DCmdArgument<char *> _jmxremote_rmi_port; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
229 DCmdArgument<char *> _jmxremote_ssl; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
230 DCmdArgument<char *> _jmxremote_registry_ssl; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
231 DCmdArgument<char *> _jmxremote_authenticate; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
232 DCmdArgument<char *> _jmxremote_password_file; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
233 DCmdArgument<char *> _jmxremote_access_file; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
234 DCmdArgument<char *> _jmxremote_login_config; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
235 DCmdArgument<char *> _jmxremote_ssl_enabled_cipher_suites; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
236 DCmdArgument<char *> _jmxremote_ssl_enabled_protocols; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
237 DCmdArgument<char *> _jmxremote_ssl_need_client_auth; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
238 DCmdArgument<char *> _jmxremote_ssl_config_file; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
239 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
240 public: |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
241 JMXStartRemoteDCmd(outputStream *output, bool heap_allocated); |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
242 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
243 static const char *name() { |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
244 return "ManagementAgent.start"; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
245 } |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
246 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
247 static const char *description() { |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
248 return "Start remote management agent."; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
249 } |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
250 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
251 static int num_arguments(); |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
252 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
253 virtual void execute(TRAPS); |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
254 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
255 }; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
256 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
257 class JMXStartLocalDCmd : public DCmd { |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
258 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
259 // Explicitly request start of local agent, |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
260 // it will not be started by start dcmd |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
261 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
262 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
263 public: |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
264 JMXStartLocalDCmd(outputStream *output, bool heap_allocated); |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
265 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
266 static const char *name() { |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
267 return "ManagementAgent.start_local"; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
268 } |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
269 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
270 static const char *description() { |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
271 return "Start local management agent."; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
272 } |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
273 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
274 virtual void execute(TRAPS); |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
275 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
276 }; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
277 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
278 class JMXStopRemoteDCmd : public DCmd { |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
279 public: |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
280 JMXStopRemoteDCmd(outputStream *output, bool heap_allocated) : |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
281 DCmd(output, heap_allocated) { |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
282 // Do Nothing |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
283 } |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
284 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
285 static const char *name() { |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
286 return "ManagementAgent.stop"; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
287 } |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
288 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
289 static const char *description() { |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
290 return "Stop remote management agent."; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
291 } |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
292 |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
293 virtual void execute(TRAPS); |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
294 }; |
645162d94294
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
4851
diff
changeset
|
295 |
4133 | 296 #endif // SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP |