author | jbachorik |
Mon, 23 Mar 2015 11:46:15 +0100 | |
changeset 30121 | cc43664a0ad7 |
parent 29071 | 73f45d04ad7a |
child 30134 | ecd7b08105e9 |
permissions | -rw-r--r-- |
11209 | 1 |
/* |
29071
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
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 |
#ifndef SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP |
|
26 |
#define SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP |
|
27 |
||
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
23517
diff
changeset
|
28 |
#include "classfile/vmSymbols.hpp" |
11209 | 29 |
#include "runtime/arguments.hpp" |
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
23517
diff
changeset
|
30 |
#include "runtime/os.hpp" |
11209 | 31 |
#include "runtime/vmThread.hpp" |
32 |
#include "services/diagnosticArgument.hpp" |
|
33 |
#include "services/diagnosticCommand.hpp" |
|
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
23517
diff
changeset
|
34 |
#include "services/diagnosticCommand_ext.hpp" |
11209 | 35 |
#include "services/diagnosticFramework.hpp" |
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
13975
diff
changeset
|
36 |
#include "utilities/macros.hpp" |
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
23517
diff
changeset
|
37 |
#include "utilities/ostream.hpp" |
11209 | 38 |
|
11441 | 39 |
class HelpDCmd : public DCmdWithParser { |
11209 | 40 |
protected: |
41 |
DCmdArgument<bool> _all; |
|
42 |
DCmdArgument<char*> _cmd; |
|
43 |
public: |
|
44 |
HelpDCmd(outputStream* output, bool heap); |
|
45 |
static const char* name() { return "help"; } |
|
46 |
static const char* description() { |
|
47 |
return "For more information about a specific command use 'help <command>'. " |
|
48 |
"With no argument this will show a list of available commands. " |
|
49 |
"'help all' will show help for all commands."; |
|
50 |
} |
|
13200
7b506e7b406e
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
11953
diff
changeset
|
51 |
static const char* impact() { return "Low"; } |
11209 | 52 |
static int num_arguments(); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
53 |
virtual void execute(DCmdSource source, TRAPS); |
11209 | 54 |
}; |
55 |
||
56 |
class VersionDCmd : public DCmd { |
|
57 |
public: |
|
58 |
VersionDCmd(outputStream* output, bool heap) : DCmd(output,heap) { } |
|
59 |
static const char* name() { return "VM.version"; } |
|
60 |
static const char* description() { |
|
61 |
return "Print JVM version information."; |
|
62 |
} |
|
13200
7b506e7b406e
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
11953
diff
changeset
|
63 |
static const char* impact() { return "Low"; } |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
64 |
static const JavaPermission permission() { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
65 |
JavaPermission p = {"java.util.PropertyPermission", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
66 |
"java.vm.version", "read"}; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
67 |
return p; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
68 |
} |
11209 | 69 |
static int num_arguments() { return 0; } |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
70 |
virtual void execute(DCmdSource source, TRAPS); |
11441 | 71 |
}; |
72 |
||
73 |
class CommandLineDCmd : public DCmd { |
|
74 |
public: |
|
75 |
CommandLineDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
|
76 |
static const char* name() { return "VM.command_line"; } |
|
77 |
static const char* description() { |
|
78 |
return "Print the command line used to start this VM instance."; |
|
79 |
} |
|
13200
7b506e7b406e
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
11953
diff
changeset
|
80 |
static const char* impact() { return "Low"; } |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
81 |
static const JavaPermission permission() { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
82 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
83 |
"monitor", NULL}; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
84 |
return p; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
85 |
} |
11441 | 86 |
static int num_arguments() { return 0; } |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
87 |
virtual void execute(DCmdSource source, TRAPS) { |
11441 | 88 |
Arguments::print_on(_output); |
89 |
} |
|
90 |
}; |
|
91 |
||
92 |
// See also: get_system_properties in attachListener.cpp |
|
93 |
class PrintSystemPropertiesDCmd : public DCmd { |
|
94 |
public: |
|
95 |
PrintSystemPropertiesDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
|
96 |
static const char* name() { return "VM.system_properties"; } |
|
97 |
static const char* description() { |
|
98 |
return "Print system properties."; |
|
99 |
} |
|
100 |
static const char* impact() { |
|
13200
7b506e7b406e
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
11953
diff
changeset
|
101 |
return "Low"; |
11441 | 102 |
} |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
103 |
static const JavaPermission permission() { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
104 |
JavaPermission p = {"java.util.PropertyPermission", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
105 |
"*", "read"}; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
106 |
return p; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
107 |
} |
11441 | 108 |
static int num_arguments() { return 0; } |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
109 |
virtual void execute(DCmdSource source, TRAPS); |
11441 | 110 |
}; |
111 |
||
112 |
// See also: print_flag in attachListener.cpp |
|
113 |
class PrintVMFlagsDCmd : public DCmdWithParser { |
|
114 |
protected: |
|
115 |
DCmdArgument<bool> _all; |
|
116 |
public: |
|
117 |
PrintVMFlagsDCmd(outputStream* output, bool heap); |
|
118 |
static const char* name() { return "VM.flags"; } |
|
119 |
static const char* description() { |
|
120 |
return "Print VM flag options and their current values."; |
|
121 |
} |
|
122 |
static const char* impact() { |
|
13200
7b506e7b406e
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
11953
diff
changeset
|
123 |
return "Low"; |
11441 | 124 |
} |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
125 |
static const JavaPermission permission() { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
126 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
127 |
"monitor", NULL}; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
128 |
return p; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
129 |
} |
11441 | 130 |
static int num_arguments(); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
131 |
virtual void execute(DCmdSource source, TRAPS); |
11441 | 132 |
}; |
133 |
||
30121
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
134 |
class SetVMFlagDCmd : public DCmdWithParser { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
135 |
protected: |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
136 |
DCmdArgument<char*> _flag; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
137 |
DCmdArgument<char*> _value; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
138 |
|
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
139 |
public: |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
140 |
SetVMFlagDCmd(outputStream* output, bool heap); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
141 |
static const char* name() { return "VM.set_flag"; } |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
142 |
static const char* description() { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
143 |
return "Sets VM flag option using the provided value."; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
144 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
145 |
static const char* impact() { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
146 |
return "Low"; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
147 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
148 |
static const JavaPermission permission() { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
149 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
150 |
"control", NULL}; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
151 |
return p; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
152 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
153 |
static int num_arguments(); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
154 |
virtual void execute(DCmdSource source, TRAPS); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
155 |
}; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
156 |
|
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
157 |
class JVMTIDataDumpDCmd : public DCmd { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
158 |
public: |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
159 |
JVMTIDataDumpDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
160 |
static const char* name() { return "JVMTI.data_dump"; } |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
161 |
static const char* description() { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
162 |
return "Signal the JVM to do a data-dump request for JVMTI."; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
163 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
164 |
static const char* impact() { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
165 |
return "High"; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
166 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
167 |
static const JavaPermission permission() { |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
168 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
169 |
"monitor", NULL}; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
170 |
return p; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
171 |
} |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
172 |
static int num_arguments() { return 0; } |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
173 |
virtual void execute(DCmdSource source, TRAPS); |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
174 |
}; |
cc43664a0ad7
8054890: Serviceability: New diagnostic commands 'VM.set_flag' and 'JVMTI.data_dump'
jbachorik
parents:
29071
diff
changeset
|
175 |
|
22490
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
176 |
class VMDynamicLibrariesDCmd : public DCmd { |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
177 |
public: |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
178 |
VMDynamicLibrariesDCmd(outputStream* output, bool heap); |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
179 |
static const char* name() { |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
180 |
return "VM.dynlibs"; |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
181 |
} |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
182 |
static const char* description() { |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
183 |
return "Print loaded dynamic libraries."; |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
184 |
} |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
185 |
static const char* impact() { |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
186 |
return "Low"; |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
187 |
} |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
188 |
static const JavaPermission permission() { |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
189 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
190 |
"monitor", NULL}; |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
191 |
return p; |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
192 |
} |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
193 |
static int num_arguments() { |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
194 |
return 0; |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
195 |
}; |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
196 |
virtual void execute(DCmdSource source, TRAPS); |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
197 |
}; |
039128291aa6
8031304: Add dcmd to print all loaded dynamic libraries.
farvidsson
parents:
21076
diff
changeset
|
198 |
|
11441 | 199 |
class VMUptimeDCmd : public DCmdWithParser { |
200 |
protected: |
|
201 |
DCmdArgument<bool> _date; |
|
202 |
public: |
|
203 |
VMUptimeDCmd(outputStream* output, bool heap); |
|
204 |
static const char* name() { return "VM.uptime"; } |
|
205 |
static const char* description() { |
|
206 |
return "Print VM uptime."; |
|
207 |
} |
|
208 |
static const char* impact() { |
|
13200
7b506e7b406e
7178703: Fix handling of quoted arguments and better error messages in dcmd
sla
parents:
11953
diff
changeset
|
209 |
return "Low"; |
11441 | 210 |
} |
211 |
static int num_arguments(); |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
212 |
virtual void execute(DCmdSource source, TRAPS); |
11441 | 213 |
}; |
214 |
||
215 |
class SystemGCDCmd : public DCmd { |
|
216 |
public: |
|
217 |
SystemGCDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
|
218 |
static const char* name() { return "GC.run"; } |
|
219 |
static const char* description() { |
|
220 |
return "Call java.lang.System.gc()."; |
|
221 |
} |
|
222 |
static const char* impact() { |
|
223 |
return "Medium: Depends on Java heap size and content."; |
|
224 |
} |
|
225 |
static int num_arguments() { return 0; } |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
226 |
virtual void execute(DCmdSource source, TRAPS); |
11441 | 227 |
}; |
228 |
||
229 |
class RunFinalizationDCmd : public DCmd { |
|
230 |
public: |
|
231 |
RunFinalizationDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } |
|
232 |
static const char* name() { return "GC.run_finalization"; } |
|
233 |
static const char* description() { |
|
234 |
return "Call java.lang.System.runFinalization()."; |
|
235 |
} |
|
236 |
static const char* impact() { |
|
237 |
return "Medium: Depends on Java content."; |
|
238 |
} |
|
239 |
static int num_arguments() { return 0; } |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
240 |
virtual void execute(DCmdSource source, TRAPS); |
11441 | 241 |
}; |
242 |
||
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13200
diff
changeset
|
243 |
#if INCLUDE_SERVICES // Heap dumping supported |
11441 | 244 |
// See also: dump_heap in attachListener.cpp |
245 |
class HeapDumpDCmd : public DCmdWithParser { |
|
246 |
protected: |
|
247 |
DCmdArgument<char*> _filename; |
|
248 |
DCmdArgument<bool> _all; |
|
249 |
public: |
|
250 |
HeapDumpDCmd(outputStream* output, bool heap); |
|
251 |
static const char* name() { |
|
252 |
return "GC.heap_dump"; |
|
253 |
} |
|
254 |
static const char* description() { |
|
255 |
return "Generate a HPROF format dump of the Java heap."; |
|
256 |
} |
|
257 |
static const char* impact() { |
|
258 |
return "High: Depends on Java heap size and content. " |
|
259 |
"Request a full GC unless the '-all' option is specified."; |
|
260 |
} |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
261 |
static const JavaPermission permission() { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
262 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
263 |
"monitor", NULL}; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
264 |
return p; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
265 |
} |
11441 | 266 |
static int num_arguments(); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
267 |
virtual void execute(DCmdSource source, TRAPS); |
11441 | 268 |
}; |
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13200
diff
changeset
|
269 |
#endif // INCLUDE_SERVICES |
11441 | 270 |
|
15437 | 271 |
// See also: inspectheap in attachListener.cpp |
11441 | 272 |
class ClassHistogramDCmd : public DCmdWithParser { |
273 |
protected: |
|
274 |
DCmdArgument<bool> _all; |
|
275 |
public: |
|
276 |
ClassHistogramDCmd(outputStream* output, bool heap); |
|
277 |
static const char* name() { |
|
278 |
return "GC.class_histogram"; |
|
279 |
} |
|
280 |
static const char* description() { |
|
281 |
return "Provide statistics about the Java heap usage."; |
|
282 |
} |
|
283 |
static const char* impact() { |
|
284 |
return "High: Depends on Java heap size and content."; |
|
285 |
} |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
286 |
static const JavaPermission permission() { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
287 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
288 |
"monitor", NULL}; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
289 |
return p; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
290 |
} |
11441 | 291 |
static int num_arguments(); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
292 |
virtual void execute(DCmdSource source, TRAPS); |
11441 | 293 |
}; |
294 |
||
15437 | 295 |
class ClassStatsDCmd : public DCmdWithParser { |
296 |
protected: |
|
297 |
DCmdArgument<bool> _all; |
|
298 |
DCmdArgument<bool> _csv; |
|
299 |
DCmdArgument<bool> _help; |
|
300 |
DCmdArgument<char*> _columns; |
|
301 |
public: |
|
302 |
ClassStatsDCmd(outputStream* output, bool heap); |
|
303 |
static const char* name() { |
|
304 |
return "GC.class_stats"; |
|
305 |
} |
|
306 |
static const char* description() { |
|
307 |
return "Provide statistics about Java class meta data. Requires -XX:+UnlockDiagnosticVMOptions."; |
|
308 |
} |
|
309 |
static const char* impact() { |
|
310 |
return "High: Depends on Java heap size and content."; |
|
311 |
} |
|
312 |
static int num_arguments(); |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
313 |
virtual void execute(DCmdSource source, TRAPS); |
15437 | 314 |
}; |
315 |
||
29071
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
316 |
|
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
317 |
class ClassHierarchyDCmd : public DCmdWithParser { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
318 |
protected: |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
319 |
DCmdArgument<bool> _print_interfaces; // true if inherited interfaces should be printed. |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
320 |
DCmdArgument<bool> _print_subclasses; // true if subclasses of the specified classname should be printed. |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
321 |
DCmdArgument<char*> _classname; // Optional single class name whose hierarchy should be printed. |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
322 |
public: |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
323 |
ClassHierarchyDCmd(outputStream* output, bool heap); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
324 |
static const char* name() { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
325 |
return "VM.class_hierarchy"; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
326 |
} |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
327 |
static const char* description() { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
328 |
return "Print a list of all loaded classes, indented to show the class hiearchy. " |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
329 |
"The name of each class is followed by the ClassLoaderData* of its ClassLoader, " |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
330 |
"or \"null\" if loaded by the bootstrap class loader."; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
331 |
} |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
332 |
static const char* impact() { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
333 |
return "Medium: Depends on number of loaded classes."; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
334 |
} |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
335 |
static const JavaPermission permission() { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
336 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
337 |
"monitor", NULL}; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
338 |
return p; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
339 |
} |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
340 |
static int num_arguments(); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
341 |
virtual void execute(DCmdSource source, TRAPS); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
342 |
}; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
26807
diff
changeset
|
343 |
|
11441 | 344 |
// See also: thread_dump in attachListener.cpp |
345 |
class ThreadDumpDCmd : public DCmdWithParser { |
|
346 |
protected: |
|
347 |
DCmdArgument<bool> _locks; |
|
348 |
public: |
|
349 |
ThreadDumpDCmd(outputStream* output, bool heap); |
|
350 |
static const char* name() { return "Thread.print"; } |
|
351 |
static const char* description() { |
|
352 |
return "Print all threads with stacktraces."; |
|
353 |
} |
|
354 |
static const char* impact() { |
|
355 |
return "Medium: Depends on the number of threads."; |
|
356 |
} |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
357 |
static const JavaPermission permission() { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
358 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
359 |
"monitor", NULL}; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
360 |
return p; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
361 |
} |
11441 | 362 |
static int num_arguments(); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
363 |
virtual void execute(DCmdSource source, TRAPS); |
11209 | 364 |
}; |
365 |
||
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
366 |
// Enhanced JMX Agent support |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
367 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
368 |
class JMXStartRemoteDCmd : public DCmdWithParser { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
369 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
370 |
// Explicitly list all properties that could be |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
371 |
// passed to Agent.startRemoteManagementAgent() |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
372 |
// com.sun.management is omitted |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
373 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
374 |
DCmdArgument<char *> _config_file; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
375 |
DCmdArgument<char *> _jmxremote_port; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
376 |
DCmdArgument<char *> _jmxremote_rmi_port; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
377 |
DCmdArgument<char *> _jmxremote_ssl; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
378 |
DCmdArgument<char *> _jmxremote_registry_ssl; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
379 |
DCmdArgument<char *> _jmxremote_authenticate; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
380 |
DCmdArgument<char *> _jmxremote_password_file; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
381 |
DCmdArgument<char *> _jmxremote_access_file; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
382 |
DCmdArgument<char *> _jmxremote_login_config; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
383 |
DCmdArgument<char *> _jmxremote_ssl_enabled_cipher_suites; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
384 |
DCmdArgument<char *> _jmxremote_ssl_enabled_protocols; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
385 |
DCmdArgument<char *> _jmxremote_ssl_need_client_auth; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
386 |
DCmdArgument<char *> _jmxremote_ssl_config_file; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
387 |
|
15460
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
388 |
// JDP support |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
389 |
// Keep autodiscovery char* not bool to pass true/false |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
390 |
// as property value to java level. |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
391 |
DCmdArgument<char *> _jmxremote_autodiscovery; |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
392 |
DCmdArgument<jlong> _jdp_port; |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
393 |
DCmdArgument<char *> _jdp_address; |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
394 |
DCmdArgument<char *> _jdp_source_addr; |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
395 |
DCmdArgument<jlong> _jdp_ttl; |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
396 |
DCmdArgument<jlong> _jdp_pause; |
21076
7cea9d36a46e
8026930: In ManagementAgent.start it should be possible to set the jdp.name parameter (hotspot part)
dsamersoff
parents:
17296
diff
changeset
|
397 |
DCmdArgument<char *> _jdp_name; |
15460
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
398 |
|
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
399 |
public: |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
400 |
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
|
401 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
402 |
static const char *name() { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
403 |
return "ManagementAgent.start"; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
404 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
405 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
406 |
static const char *description() { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
407 |
return "Start remote management agent."; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
408 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
409 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
410 |
static int num_arguments(); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
411 |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
412 |
virtual void execute(DCmdSource source, TRAPS); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
413 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
414 |
}; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
415 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
416 |
class JMXStartLocalDCmd : public DCmd { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
417 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
418 |
// Explicitly request start of local agent, |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
419 |
// it will not be started by start dcmd |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
420 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
421 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
422 |
public: |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
423 |
JMXStartLocalDCmd(outputStream *output, bool heap_allocated); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
424 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
425 |
static const char *name() { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
426 |
return "ManagementAgent.start_local"; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
427 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
428 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
429 |
static const char *description() { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
430 |
return "Start local management agent."; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
431 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
432 |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
433 |
virtual void execute(DCmdSource source, TRAPS); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
434 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
435 |
}; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
436 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
437 |
class JMXStopRemoteDCmd : public DCmd { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
438 |
public: |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
439 |
JMXStopRemoteDCmd(outputStream *output, bool heap_allocated) : |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
440 |
DCmd(output, heap_allocated) { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
441 |
// Do Nothing |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
442 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
443 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
444 |
static const char *name() { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
445 |
return "ManagementAgent.stop"; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
446 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
447 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
448 |
static const char *description() { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
449 |
return "Stop remote management agent."; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
450 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
451 |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
452 |
virtual void execute(DCmdSource source, TRAPS); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
453 |
}; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
454 |
|
23517 | 455 |
class RotateGCLogDCmd : public DCmd { |
456 |
public: |
|
457 |
RotateGCLogDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} |
|
458 |
static const char* name() { return "GC.rotate_log"; } |
|
459 |
static const char* description() { |
|
460 |
return "Force the GC log file to be rotated."; |
|
461 |
} |
|
462 |
static const char* impact() { return "Low"; } |
|
463 |
virtual void execute(DCmdSource source, TRAPS); |
|
464 |
static int num_arguments() { return 0; } |
|
465 |
static const JavaPermission permission() { |
|
466 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
|
467 |
"control", NULL}; |
|
468 |
return p; |
|
469 |
} |
|
470 |
}; |
|
471 |
||
26587 | 472 |
class CompileQueueDCmd : public DCmd { |
473 |
public: |
|
474 |
CompileQueueDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} |
|
475 |
static const char* name() { |
|
476 |
return "Compiler.queue"; |
|
477 |
} |
|
478 |
static const char* description() { |
|
479 |
return "Print methods queued for compilation."; |
|
480 |
} |
|
481 |
static const char* impact() { |
|
482 |
return "Low"; |
|
483 |
} |
|
484 |
static const JavaPermission permission() { |
|
485 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
|
486 |
"monitor", NULL}; |
|
487 |
return p; |
|
488 |
} |
|
489 |
static int num_arguments() { return 0; } |
|
490 |
virtual void execute(DCmdSource source, TRAPS); |
|
491 |
}; |
|
492 |
||
493 |
class CodeListDCmd : public DCmd { |
|
494 |
public: |
|
495 |
CodeListDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} |
|
496 |
static const char* name() { |
|
497 |
return "Compiler.codelist"; |
|
498 |
} |
|
499 |
static const char* description() { |
|
26807
843ea33eb963
8058461: serviceability/dcmd/CodelistTest.java and serviceability/dcmd/CompilerQueueTest.java SIGSEGV
neliasso
parents:
26587
diff
changeset
|
500 |
return "Print all compiled methods in code cache that are alive"; |
26587 | 501 |
} |
502 |
static const char* impact() { |
|
503 |
return "Medium"; |
|
504 |
} |
|
505 |
static const JavaPermission permission() { |
|
506 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
|
507 |
"monitor", NULL}; |
|
508 |
return p; |
|
509 |
} |
|
510 |
static int num_arguments() { return 0; } |
|
511 |
virtual void execute(DCmdSource source, TRAPS); |
|
512 |
}; |
|
513 |
||
514 |
||
515 |
class CodeCacheDCmd : public DCmd { |
|
516 |
public: |
|
517 |
CodeCacheDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} |
|
518 |
static const char* name() { |
|
519 |
return "Compiler.codecache"; |
|
520 |
} |
|
521 |
static const char* description() { |
|
522 |
return "Print code cache layout and bounds."; |
|
523 |
} |
|
524 |
static const char* impact() { |
|
525 |
return "Low"; |
|
526 |
} |
|
527 |
static const JavaPermission permission() { |
|
528 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
|
529 |
"monitor", NULL}; |
|
530 |
return p; |
|
531 |
} |
|
532 |
static int num_arguments() { return 0; } |
|
533 |
virtual void execute(DCmdSource source, TRAPS); |
|
534 |
}; |
|
535 |
||
11209 | 536 |
#endif // SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP |