Wed, 31 Jan 2018 19:24:57 -0500
8189170: Add option to disable stack overflow checking in primordial thread for use with JNI_CreateJavaJVM
Reviewed-by: dcubed
fparain@3329 | 1 | /* |
dbuck@9059 | 2 | * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. |
fparain@3329 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
fparain@3329 | 4 | * |
fparain@3329 | 5 | * This code is free software; you can redistribute it and/or modify it |
fparain@3329 | 6 | * under the terms of the GNU General Public License version 2 only, as |
fparain@3329 | 7 | * published by the Free Software Foundation. |
fparain@3329 | 8 | * |
fparain@3329 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
fparain@3329 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
fparain@3329 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
fparain@3329 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
fparain@3329 | 13 | * accompanied this code). |
fparain@3329 | 14 | * |
fparain@3329 | 15 | * You should have received a copy of the GNU General Public License version |
fparain@3329 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
fparain@3329 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
fparain@3329 | 18 | * |
fparain@3329 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
fparain@3329 | 20 | * or visit www.oracle.com if you need additional information or have any |
fparain@3329 | 21 | * questions. |
fparain@3329 | 22 | * |
fparain@3329 | 23 | */ |
fparain@3329 | 24 | |
fparain@3329 | 25 | #ifndef SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP |
fparain@3329 | 26 | #define SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP |
fparain@3329 | 27 | |
fparain@3329 | 28 | #include "runtime/arguments.hpp" |
fparain@3329 | 29 | #include "classfile/vmSymbols.hpp" |
fparain@3329 | 30 | #include "utilities/ostream.hpp" |
fparain@3329 | 31 | #include "runtime/vm_version.hpp" |
fparain@3329 | 32 | #include "runtime/vmThread.hpp" |
fparain@3329 | 33 | #include "runtime/os.hpp" |
fparain@3329 | 34 | #include "services/diagnosticArgument.hpp" |
fparain@3329 | 35 | #include "services/diagnosticCommand.hpp" |
fparain@3329 | 36 | #include "services/diagnosticFramework.hpp" |
dsamersoff@3478 | 37 | #include "services/diagnosticCommand_ext.hpp" |
jprovino@4542 | 38 | #include "utilities/macros.hpp" |
fparain@3329 | 39 | |
fparain@3402 | 40 | class HelpDCmd : public DCmdWithParser { |
fparain@3329 | 41 | protected: |
fparain@3329 | 42 | DCmdArgument<bool> _all; |
fparain@3329 | 43 | DCmdArgument<char*> _cmd; |
fparain@3329 | 44 | public: |
fparain@3329 | 45 | HelpDCmd(outputStream* output, bool heap); |
fparain@3329 | 46 | static const char* name() { return "help"; } |
fparain@3329 | 47 | static const char* description() { |
fparain@3329 | 48 | return "For more information about a specific command use 'help <command>'. " |
fparain@3329 | 49 | "With no argument this will show a list of available commands. " |
fparain@3329 | 50 | "'help all' will show help for all commands."; |
fparain@3329 | 51 | } |
sla@3905 | 52 | static const char* impact() { return "Low"; } |
fparain@3329 | 53 | static int num_arguments(); |
fparain@5047 | 54 | virtual void execute(DCmdSource source, TRAPS); |
fparain@3329 | 55 | }; |
fparain@3329 | 56 | |
fparain@3329 | 57 | class VersionDCmd : public DCmd { |
fparain@3329 | 58 | public: |
fparain@3329 | 59 | VersionDCmd(outputStream* output, bool heap) : DCmd(output,heap) { } |
fparain@3329 | 60 | static const char* name() { return "VM.version"; } |
fparain@3329 | 61 | static const char* description() { |
fparain@3329 | 62 | return "Print JVM version information."; |
fparain@3329 | 63 | } |
sla@3905 | 64 | static const char* impact() { return "Low"; } |
fparain@5047 | 65 | static const JavaPermission permission() { |
fparain@5047 | 66 | JavaPermission p = {"java.util.PropertyPermission", |
fparain@5047 | 67 | "java.vm.version", "read"}; |
fparain@5047 | 68 | return p; |
fparain@5047 | 69 | } |
fparain@3329 | 70 | static int num_arguments() { return 0; } |
fparain@5047 | 71 | virtual void execute(DCmdSource source, TRAPS); |
fparain@3402 | 72 | }; |
fparain@3402 | 73 | |
fparain@3402 | 74 | class CommandLineDCmd : public DCmd { |
fparain@3402 | 75 | public: |
fparain@3402 | 76 | CommandLineDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
fparain@3402 | 77 | static const char* name() { return "VM.command_line"; } |
fparain@3402 | 78 | static const char* description() { |
fparain@3402 | 79 | return "Print the command line used to start this VM instance."; |
fparain@3402 | 80 | } |
sla@3905 | 81 | static const char* impact() { return "Low"; } |
fparain@5047 | 82 | static const JavaPermission permission() { |
fparain@5047 | 83 | JavaPermission p = {"java.lang.management.ManagementPermission", |
fparain@5047 | 84 | "monitor", NULL}; |
fparain@5047 | 85 | return p; |
fparain@5047 | 86 | } |
fparain@3402 | 87 | static int num_arguments() { return 0; } |
fparain@5047 | 88 | virtual void execute(DCmdSource source, TRAPS) { |
fparain@3402 | 89 | Arguments::print_on(_output); |
fparain@3402 | 90 | } |
fparain@3402 | 91 | }; |
fparain@3402 | 92 | |
fparain@3402 | 93 | // See also: get_system_properties in attachListener.cpp |
fparain@3402 | 94 | class PrintSystemPropertiesDCmd : public DCmd { |
fparain@3402 | 95 | public: |
fparain@3402 | 96 | PrintSystemPropertiesDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
fparain@3402 | 97 | static const char* name() { return "VM.system_properties"; } |
fparain@3402 | 98 | static const char* description() { |
fparain@3402 | 99 | return "Print system properties."; |
fparain@3402 | 100 | } |
fparain@3402 | 101 | static const char* impact() { |
sla@3905 | 102 | return "Low"; |
fparain@3402 | 103 | } |
fparain@5047 | 104 | static const JavaPermission permission() { |
fparain@5047 | 105 | JavaPermission p = {"java.util.PropertyPermission", |
fparain@5047 | 106 | "*", "read"}; |
fparain@5047 | 107 | return p; |
fparain@5047 | 108 | } |
fparain@3402 | 109 | static int num_arguments() { return 0; } |
fparain@5047 | 110 | virtual void execute(DCmdSource source, TRAPS); |
fparain@3402 | 111 | }; |
fparain@3402 | 112 | |
fparain@3402 | 113 | // See also: print_flag in attachListener.cpp |
fparain@3402 | 114 | class PrintVMFlagsDCmd : public DCmdWithParser { |
fparain@3402 | 115 | protected: |
fparain@3402 | 116 | DCmdArgument<bool> _all; |
fparain@3402 | 117 | public: |
fparain@3402 | 118 | PrintVMFlagsDCmd(outputStream* output, bool heap); |
fparain@3402 | 119 | static const char* name() { return "VM.flags"; } |
fparain@3402 | 120 | static const char* description() { |
fparain@3402 | 121 | return "Print VM flag options and their current values."; |
fparain@3402 | 122 | } |
fparain@3402 | 123 | static const char* impact() { |
sla@3905 | 124 | return "Low"; |
fparain@3402 | 125 | } |
fparain@5047 | 126 | static const JavaPermission permission() { |
fparain@5047 | 127 | JavaPermission p = {"java.lang.management.ManagementPermission", |
fparain@5047 | 128 | "monitor", NULL}; |
fparain@5047 | 129 | return p; |
fparain@5047 | 130 | } |
fparain@3402 | 131 | static int num_arguments(); |
fparain@5047 | 132 | virtual void execute(DCmdSource source, TRAPS); |
fparain@3402 | 133 | }; |
fparain@3402 | 134 | |
dbuck@9061 | 135 | class VMDynamicLibrariesDCmd : public DCmd { |
dbuck@9061 | 136 | public: |
dbuck@9061 | 137 | VMDynamicLibrariesDCmd(outputStream* output, bool heap); |
dbuck@9061 | 138 | static const char* name() { |
dbuck@9061 | 139 | return "VM.dynlibs"; |
dbuck@9061 | 140 | } |
dbuck@9061 | 141 | static const char* description() { |
dbuck@9061 | 142 | return "Print loaded dynamic libraries."; |
dbuck@9061 | 143 | } |
dbuck@9061 | 144 | static const char* impact() { |
dbuck@9061 | 145 | return "Low"; |
dbuck@9061 | 146 | } |
dbuck@9061 | 147 | static const JavaPermission permission() { |
dbuck@9061 | 148 | JavaPermission p = {"java.lang.management.ManagementPermission", |
dbuck@9061 | 149 | "monitor", NULL}; |
dbuck@9061 | 150 | return p; |
dbuck@9061 | 151 | } |
dbuck@9061 | 152 | static int num_arguments() { |
dbuck@9061 | 153 | return 0; |
dbuck@9061 | 154 | }; |
dbuck@9061 | 155 | virtual void execute(DCmdSource source, TRAPS); |
dbuck@9061 | 156 | }; |
dbuck@9061 | 157 | |
fparain@3402 | 158 | class VMUptimeDCmd : public DCmdWithParser { |
fparain@3402 | 159 | protected: |
fparain@3402 | 160 | DCmdArgument<bool> _date; |
fparain@3402 | 161 | public: |
fparain@3402 | 162 | VMUptimeDCmd(outputStream* output, bool heap); |
fparain@3402 | 163 | static const char* name() { return "VM.uptime"; } |
fparain@3402 | 164 | static const char* description() { |
fparain@3402 | 165 | return "Print VM uptime."; |
fparain@3402 | 166 | } |
fparain@3402 | 167 | static const char* impact() { |
sla@3905 | 168 | return "Low"; |
fparain@3402 | 169 | } |
fparain@3402 | 170 | static int num_arguments(); |
fparain@5047 | 171 | virtual void execute(DCmdSource source, TRAPS); |
fparain@3402 | 172 | }; |
fparain@3402 | 173 | |
fparain@3402 | 174 | class SystemGCDCmd : public DCmd { |
fparain@3402 | 175 | public: |
fparain@3402 | 176 | SystemGCDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
fparain@3402 | 177 | static const char* name() { return "GC.run"; } |
fparain@3402 | 178 | static const char* description() { |
fparain@3402 | 179 | return "Call java.lang.System.gc()."; |
fparain@3402 | 180 | } |
fparain@3402 | 181 | static const char* impact() { |
fparain@3402 | 182 | return "Medium: Depends on Java heap size and content."; |
fparain@3402 | 183 | } |
fparain@3402 | 184 | static int num_arguments() { return 0; } |
fparain@5047 | 185 | virtual void execute(DCmdSource source, TRAPS); |
fparain@3402 | 186 | }; |
fparain@3402 | 187 | |
fparain@3402 | 188 | class RunFinalizationDCmd : public DCmd { |
fparain@3402 | 189 | public: |
fparain@3402 | 190 | RunFinalizationDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
fparain@3402 | 191 | static const char* name() { return "GC.run_finalization"; } |
fparain@3402 | 192 | static const char* description() { |
fparain@3402 | 193 | return "Call java.lang.System.runFinalization()."; |
fparain@3402 | 194 | } |
fparain@3402 | 195 | static const char* impact() { |
fparain@3402 | 196 | return "Medium: Depends on Java content."; |
fparain@3402 | 197 | } |
fparain@3402 | 198 | static int num_arguments() { return 0; } |
fparain@5047 | 199 | virtual void execute(DCmdSource source, TRAPS); |
fparain@3402 | 200 | }; |
fparain@3402 | 201 | |
dbuck@9059 | 202 | class HeapInfoDCmd : public DCmd { |
dbuck@9059 | 203 | public: |
dbuck@9059 | 204 | HeapInfoDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
dbuck@9059 | 205 | static const char* name() { return "GC.heap_info"; } |
dbuck@9059 | 206 | static const char* description() { |
dbuck@9059 | 207 | return "Provide generic Java heap information."; |
dbuck@9059 | 208 | } |
dbuck@9059 | 209 | static const char* impact() { |
dbuck@9059 | 210 | return "Medium"; |
dbuck@9059 | 211 | } |
dbuck@9059 | 212 | static int num_arguments() { return 0; } |
dbuck@9059 | 213 | static const JavaPermission permission() { |
dbuck@9059 | 214 | JavaPermission p = {"java.lang.management.ManagementPermission", |
dbuck@9059 | 215 | "monitor", NULL}; |
dbuck@9059 | 216 | return p; |
dbuck@9059 | 217 | } |
dbuck@9059 | 218 | |
dbuck@9059 | 219 | virtual void execute(DCmdSource source, TRAPS); |
dbuck@9059 | 220 | }; |
dbuck@9059 | 221 | |
dbuck@9059 | 222 | class FinalizerInfoDCmd : public DCmd { |
dbuck@9059 | 223 | public: |
dbuck@9059 | 224 | FinalizerInfoDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
dbuck@9059 | 225 | static const char* name() { return "GC.finalizer_info"; } |
dbuck@9059 | 226 | static const char* description() { |
dbuck@9059 | 227 | return "Provide information about Java finalization queue."; |
dbuck@9059 | 228 | } |
dbuck@9059 | 229 | static const char* impact() { |
dbuck@9059 | 230 | return "Medium"; |
dbuck@9059 | 231 | } |
dbuck@9059 | 232 | static int num_arguments() { return 0; } |
dbuck@9059 | 233 | static const JavaPermission permission() { |
dbuck@9059 | 234 | JavaPermission p = {"java.lang.management.ManagementPermission", |
dbuck@9059 | 235 | "monitor", NULL}; |
dbuck@9059 | 236 | return p; |
dbuck@9059 | 237 | } |
dbuck@9059 | 238 | |
dbuck@9059 | 239 | virtual void execute(DCmdSource source, TRAPS); |
dbuck@9059 | 240 | }; |
dbuck@9059 | 241 | |
jprovino@4165 | 242 | #if INCLUDE_SERVICES // Heap dumping supported |
fparain@3402 | 243 | // See also: dump_heap in attachListener.cpp |
fparain@3402 | 244 | class HeapDumpDCmd : public DCmdWithParser { |
fparain@3402 | 245 | protected: |
fparain@3402 | 246 | DCmdArgument<char*> _filename; |
fparain@3402 | 247 | DCmdArgument<bool> _all; |
fparain@3402 | 248 | public: |
fparain@3402 | 249 | HeapDumpDCmd(outputStream* output, bool heap); |
fparain@3402 | 250 | static const char* name() { |
fparain@3402 | 251 | return "GC.heap_dump"; |
fparain@3402 | 252 | } |
fparain@3402 | 253 | static const char* description() { |
fparain@3402 | 254 | return "Generate a HPROF format dump of the Java heap."; |
fparain@3402 | 255 | } |
fparain@3402 | 256 | static const char* impact() { |
fparain@3402 | 257 | return "High: Depends on Java heap size and content. " |
fparain@3402 | 258 | "Request a full GC unless the '-all' option is specified."; |
fparain@3402 | 259 | } |
fparain@5047 | 260 | static const JavaPermission permission() { |
fparain@5047 | 261 | JavaPermission p = {"java.lang.management.ManagementPermission", |
fparain@5047 | 262 | "monitor", NULL}; |
fparain@5047 | 263 | return p; |
fparain@5047 | 264 | } |
fparain@3402 | 265 | static int num_arguments(); |
fparain@5047 | 266 | virtual void execute(DCmdSource source, TRAPS); |
fparain@3402 | 267 | }; |
jprovino@4165 | 268 | #endif // INCLUDE_SERVICES |
fparain@3402 | 269 | |
acorn@4497 | 270 | // See also: inspectheap in attachListener.cpp |
fparain@3402 | 271 | class ClassHistogramDCmd : public DCmdWithParser { |
fparain@3402 | 272 | protected: |
fparain@3402 | 273 | DCmdArgument<bool> _all; |
fparain@3402 | 274 | public: |
fparain@3402 | 275 | ClassHistogramDCmd(outputStream* output, bool heap); |
fparain@3402 | 276 | static const char* name() { |
fparain@3402 | 277 | return "GC.class_histogram"; |
fparain@3402 | 278 | } |
fparain@3402 | 279 | static const char* description() { |
fparain@3402 | 280 | return "Provide statistics about the Java heap usage."; |
fparain@3402 | 281 | } |
fparain@3402 | 282 | static const char* impact() { |
fparain@3402 | 283 | return "High: Depends on Java heap size and content."; |
fparain@3402 | 284 | } |
fparain@5047 | 285 | static const JavaPermission permission() { |
fparain@5047 | 286 | JavaPermission p = {"java.lang.management.ManagementPermission", |
fparain@5047 | 287 | "monitor", NULL}; |
fparain@5047 | 288 | return p; |
fparain@5047 | 289 | } |
fparain@3402 | 290 | static int num_arguments(); |
fparain@5047 | 291 | virtual void execute(DCmdSource source, TRAPS); |
fparain@3402 | 292 | }; |
fparain@3402 | 293 | |
acorn@4497 | 294 | class ClassStatsDCmd : public DCmdWithParser { |
acorn@4497 | 295 | protected: |
acorn@4497 | 296 | DCmdArgument<bool> _all; |
acorn@4497 | 297 | DCmdArgument<bool> _csv; |
acorn@4497 | 298 | DCmdArgument<bool> _help; |
acorn@4497 | 299 | DCmdArgument<char*> _columns; |
acorn@4497 | 300 | public: |
acorn@4497 | 301 | ClassStatsDCmd(outputStream* output, bool heap); |
acorn@4497 | 302 | static const char* name() { |
acorn@4497 | 303 | return "GC.class_stats"; |
acorn@4497 | 304 | } |
acorn@4497 | 305 | static const char* description() { |
acorn@4497 | 306 | return "Provide statistics about Java class meta data. Requires -XX:+UnlockDiagnosticVMOptions."; |
acorn@4497 | 307 | } |
acorn@4497 | 308 | static const char* impact() { |
acorn@4497 | 309 | return "High: Depends on Java heap size and content."; |
acorn@4497 | 310 | } |
acorn@4497 | 311 | static int num_arguments(); |
fparain@5047 | 312 | virtual void execute(DCmdSource source, TRAPS); |
acorn@4497 | 313 | }; |
acorn@4497 | 314 | |
fparain@3402 | 315 | // See also: thread_dump in attachListener.cpp |
fparain@3402 | 316 | class ThreadDumpDCmd : public DCmdWithParser { |
fparain@3402 | 317 | protected: |
fparain@3402 | 318 | DCmdArgument<bool> _locks; |
fparain@3402 | 319 | public: |
fparain@3402 | 320 | ThreadDumpDCmd(outputStream* output, bool heap); |
fparain@3402 | 321 | static const char* name() { return "Thread.print"; } |
fparain@3402 | 322 | static const char* description() { |
fparain@3402 | 323 | return "Print all threads with stacktraces."; |
fparain@3402 | 324 | } |
fparain@3402 | 325 | static const char* impact() { |
fparain@3402 | 326 | return "Medium: Depends on the number of threads."; |
fparain@3402 | 327 | } |
fparain@5047 | 328 | static const JavaPermission permission() { |
fparain@5047 | 329 | JavaPermission p = {"java.lang.management.ManagementPermission", |
fparain@5047 | 330 | "monitor", NULL}; |
fparain@5047 | 331 | return p; |
fparain@5047 | 332 | } |
fparain@3402 | 333 | static int num_arguments(); |
fparain@5047 | 334 | virtual void execute(DCmdSource source, TRAPS); |
fparain@3329 | 335 | }; |
fparain@3329 | 336 | |
dsamersoff@3598 | 337 | // Enhanced JMX Agent support |
dsamersoff@3598 | 338 | |
dsamersoff@3598 | 339 | class JMXStartRemoteDCmd : public DCmdWithParser { |
dsamersoff@3598 | 340 | |
dsamersoff@3598 | 341 | // Explicitly list all properties that could be |
dsamersoff@3598 | 342 | // passed to Agent.startRemoteManagementAgent() |
dsamersoff@3598 | 343 | // com.sun.management is omitted |
dsamersoff@3598 | 344 | |
dsamersoff@3598 | 345 | DCmdArgument<char *> _config_file; |
sgehwolf@8303 | 346 | DCmdArgument<char *> _jmxremote_host; |
dsamersoff@3598 | 347 | DCmdArgument<char *> _jmxremote_port; |
dsamersoff@3598 | 348 | DCmdArgument<char *> _jmxremote_rmi_port; |
dsamersoff@3598 | 349 | DCmdArgument<char *> _jmxremote_ssl; |
dsamersoff@3598 | 350 | DCmdArgument<char *> _jmxremote_registry_ssl; |
dsamersoff@3598 | 351 | DCmdArgument<char *> _jmxremote_authenticate; |
dsamersoff@3598 | 352 | DCmdArgument<char *> _jmxremote_password_file; |
dsamersoff@3598 | 353 | DCmdArgument<char *> _jmxremote_access_file; |
dsamersoff@3598 | 354 | DCmdArgument<char *> _jmxremote_login_config; |
dsamersoff@3598 | 355 | DCmdArgument<char *> _jmxremote_ssl_enabled_cipher_suites; |
dsamersoff@3598 | 356 | DCmdArgument<char *> _jmxremote_ssl_enabled_protocols; |
dsamersoff@3598 | 357 | DCmdArgument<char *> _jmxremote_ssl_need_client_auth; |
dsamersoff@3598 | 358 | DCmdArgument<char *> _jmxremote_ssl_config_file; |
dsamersoff@3598 | 359 | |
dsamersoff@4520 | 360 | // JDP support |
dsamersoff@4520 | 361 | // Keep autodiscovery char* not bool to pass true/false |
dsamersoff@4520 | 362 | // as property value to java level. |
dsamersoff@4520 | 363 | DCmdArgument<char *> _jmxremote_autodiscovery; |
dsamersoff@4520 | 364 | DCmdArgument<jlong> _jdp_port; |
dsamersoff@4520 | 365 | DCmdArgument<char *> _jdp_address; |
dsamersoff@4520 | 366 | DCmdArgument<char *> _jdp_source_addr; |
dsamersoff@4520 | 367 | DCmdArgument<jlong> _jdp_ttl; |
dsamersoff@4520 | 368 | DCmdArgument<jlong> _jdp_pause; |
dsamersoff@5968 | 369 | DCmdArgument<char *> _jdp_name; |
dsamersoff@4520 | 370 | |
dsamersoff@3598 | 371 | public: |
dsamersoff@3598 | 372 | JMXStartRemoteDCmd(outputStream *output, bool heap_allocated); |
dsamersoff@3598 | 373 | |
dsamersoff@3598 | 374 | static const char *name() { |
dsamersoff@3598 | 375 | return "ManagementAgent.start"; |
dsamersoff@3598 | 376 | } |
dsamersoff@3598 | 377 | |
dsamersoff@3598 | 378 | static const char *description() { |
dsamersoff@3598 | 379 | return "Start remote management agent."; |
dsamersoff@3598 | 380 | } |
dsamersoff@3598 | 381 | |
dsamersoff@3598 | 382 | static int num_arguments(); |
dsamersoff@3598 | 383 | |
fparain@5047 | 384 | virtual void execute(DCmdSource source, TRAPS); |
dsamersoff@3598 | 385 | |
dsamersoff@3598 | 386 | }; |
dsamersoff@3598 | 387 | |
dsamersoff@3598 | 388 | class JMXStartLocalDCmd : public DCmd { |
dsamersoff@3598 | 389 | |
dsamersoff@3598 | 390 | // Explicitly request start of local agent, |
dsamersoff@3598 | 391 | // it will not be started by start dcmd |
dsamersoff@3598 | 392 | |
dsamersoff@3598 | 393 | |
dsamersoff@3598 | 394 | public: |
dsamersoff@3598 | 395 | JMXStartLocalDCmd(outputStream *output, bool heap_allocated); |
dsamersoff@3598 | 396 | |
dsamersoff@3598 | 397 | static const char *name() { |
dsamersoff@3598 | 398 | return "ManagementAgent.start_local"; |
dsamersoff@3598 | 399 | } |
dsamersoff@3598 | 400 | |
dsamersoff@3598 | 401 | static const char *description() { |
dsamersoff@3598 | 402 | return "Start local management agent."; |
dsamersoff@3598 | 403 | } |
dsamersoff@3598 | 404 | |
fparain@5047 | 405 | virtual void execute(DCmdSource source, TRAPS); |
dsamersoff@3598 | 406 | |
dsamersoff@3598 | 407 | }; |
dsamersoff@3598 | 408 | |
dsamersoff@3598 | 409 | class JMXStopRemoteDCmd : public DCmd { |
dsamersoff@3598 | 410 | public: |
dsamersoff@3598 | 411 | JMXStopRemoteDCmd(outputStream *output, bool heap_allocated) : |
dsamersoff@3598 | 412 | DCmd(output, heap_allocated) { |
dsamersoff@3598 | 413 | // Do Nothing |
dsamersoff@3598 | 414 | } |
dsamersoff@3598 | 415 | |
dsamersoff@3598 | 416 | static const char *name() { |
dsamersoff@3598 | 417 | return "ManagementAgent.stop"; |
dsamersoff@3598 | 418 | } |
dsamersoff@3598 | 419 | |
dsamersoff@3598 | 420 | static const char *description() { |
dsamersoff@3598 | 421 | return "Stop remote management agent."; |
dsamersoff@3598 | 422 | } |
dsamersoff@3598 | 423 | |
fparain@5047 | 424 | virtual void execute(DCmdSource source, TRAPS); |
dsamersoff@3598 | 425 | }; |
dsamersoff@3598 | 426 | |
minqi@6535 | 427 | class RotateGCLogDCmd : public DCmd { |
minqi@6535 | 428 | public: |
minqi@6535 | 429 | RotateGCLogDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} |
minqi@6535 | 430 | static const char* name() { return "GC.rotate_log"; } |
minqi@6535 | 431 | static const char* description() { |
minqi@6535 | 432 | return "Force the GC log file to be rotated."; |
minqi@6535 | 433 | } |
minqi@6535 | 434 | static const char* impact() { return "Low"; } |
minqi@6535 | 435 | virtual void execute(DCmdSource source, TRAPS); |
minqi@6535 | 436 | static int num_arguments() { return 0; } |
minqi@6535 | 437 | static const JavaPermission permission() { |
minqi@6535 | 438 | JavaPermission p = {"java.lang.management.ManagementPermission", |
minqi@6535 | 439 | "control", NULL}; |
minqi@6535 | 440 | return p; |
minqi@6535 | 441 | } |
minqi@6535 | 442 | }; |
minqi@6535 | 443 | |
fparain@3329 | 444 | #endif // SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP |