annotate src/share/vm/services/jmm.h @ 11122:81b6cb70717c jdk8-b99

Merge
author katleman
date Tue, 16 Jul 2013 15:15:43 -0700
parents 31a4e55f8c9d
children e4f478e7781b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
10215
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
7 * published by the Free Software Foundation. Oracle designates this
0
a61af66fc99e Initial load
duke
parents:
diff changeset
8 * particular file as subject to the "Classpath" exception as provided
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
9 * by Oracle in the LICENSE file that accompanied this code.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
10 *
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
14 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
16 *
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
18 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
20 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
22 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
23 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
24 */
a61af66fc99e Initial load
duke
parents:
diff changeset
25
a61af66fc99e Initial load
duke
parents:
diff changeset
26 #ifndef _JAVA_JMM_H_
a61af66fc99e Initial load
duke
parents:
diff changeset
27 #define _JAVA_JMM_H_
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
30 * This is a private interface used by JDK for JVM monitoring
a61af66fc99e Initial load
duke
parents:
diff changeset
31 * and management.
a61af66fc99e Initial load
duke
parents:
diff changeset
32 *
a61af66fc99e Initial load
duke
parents:
diff changeset
33 * Bump the version number when either of the following happens:
a61af66fc99e Initial load
duke
parents:
diff changeset
34 *
a61af66fc99e Initial load
duke
parents:
diff changeset
35 * 1. There is a change in functions in JmmInterface.
a61af66fc99e Initial load
duke
parents:
diff changeset
36 *
a61af66fc99e Initial load
duke
parents:
diff changeset
37 * 2. There is a change in the contract between VM and Java classes.
a61af66fc99e Initial load
duke
parents:
diff changeset
38 */
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 #include "jni.h"
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 #ifdef __cplusplus
a61af66fc99e Initial load
duke
parents:
diff changeset
43 extern "C" {
a61af66fc99e Initial load
duke
parents:
diff changeset
44 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
47 JMM_VERSION_1 = 0x20010000,
a61af66fc99e Initial load
duke
parents:
diff changeset
48 JMM_VERSION_1_0 = 0x20010000,
a61af66fc99e Initial load
duke
parents:
diff changeset
49 JMM_VERSION_1_1 = 0x20010100, // JDK 6
a61af66fc99e Initial load
duke
parents:
diff changeset
50 JMM_VERSION_1_2 = 0x20010200, // JDK 7
4133
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
51 JMM_VERSION_1_2_1 = 0x20010201, // JDK 7 GA
10215
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
52 JMM_VERSION_1_2_2 = 0x20010202,
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
53 JMM_VERSION = 0x20010203
0
a61af66fc99e Initial load
duke
parents:
diff changeset
54 };
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 typedef struct {
a61af66fc99e Initial load
duke
parents:
diff changeset
57 unsigned int isLowMemoryDetectionSupported : 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 unsigned int isCompilationTimeMonitoringSupported : 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 unsigned int isThreadContentionMonitoringSupported : 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 unsigned int isCurrentThreadCpuTimeSupported : 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 unsigned int isOtherThreadCpuTimeSupported : 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 unsigned int isBootClassPathSupported : 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 unsigned int isObjectMonitorUsageSupported : 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 unsigned int isSynchronizerUsageSupported : 1;
2100
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
65 unsigned int isThreadAllocatedMemorySupported : 1;
10215
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
66 unsigned int isRemoteDiagnosticCommandsSupported : 1;
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
67 unsigned int : 22;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
68 } jmmOptionalSupport;
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 typedef enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
71 JMM_CLASS_LOADED_COUNT = 1, /* Total number of loaded classes */
a61af66fc99e Initial load
duke
parents:
diff changeset
72 JMM_CLASS_UNLOADED_COUNT = 2, /* Total number of unloaded classes */
a61af66fc99e Initial load
duke
parents:
diff changeset
73 JMM_THREAD_TOTAL_COUNT = 3, /* Total number of threads that have been started */
a61af66fc99e Initial load
duke
parents:
diff changeset
74 JMM_THREAD_LIVE_COUNT = 4, /* Current number of live threads */
a61af66fc99e Initial load
duke
parents:
diff changeset
75 JMM_THREAD_PEAK_COUNT = 5, /* Peak number of live threads */
a61af66fc99e Initial load
duke
parents:
diff changeset
76 JMM_THREAD_DAEMON_COUNT = 6, /* Current number of daemon threads */
a61af66fc99e Initial load
duke
parents:
diff changeset
77 JMM_JVM_INIT_DONE_TIME_MS = 7, /* Time when the JVM finished initialization */
a61af66fc99e Initial load
duke
parents:
diff changeset
78 JMM_COMPILE_TOTAL_TIME_MS = 8, /* Total accumulated time spent in compilation */
a61af66fc99e Initial load
duke
parents:
diff changeset
79 JMM_GC_TIME_MS = 9, /* Total accumulated time spent in collection */
a61af66fc99e Initial load
duke
parents:
diff changeset
80 JMM_GC_COUNT = 10, /* Total number of collections */
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 JMM_INTERNAL_ATTRIBUTE_INDEX = 100,
a61af66fc99e Initial load
duke
parents:
diff changeset
83 JMM_CLASS_LOADED_BYTES = 101, /* Number of bytes loaded instance classes */
a61af66fc99e Initial load
duke
parents:
diff changeset
84 JMM_CLASS_UNLOADED_BYTES = 102, /* Number of bytes unloaded instance classes */
a61af66fc99e Initial load
duke
parents:
diff changeset
85 JMM_TOTAL_CLASSLOAD_TIME_MS = 103, /* Accumulated VM class loader time (TraceClassLoadingTime) */
a61af66fc99e Initial load
duke
parents:
diff changeset
86 JMM_VM_GLOBAL_COUNT = 104, /* Number of VM internal flags */
a61af66fc99e Initial load
duke
parents:
diff changeset
87 JMM_SAFEPOINT_COUNT = 105, /* Total number of safepoints */
a61af66fc99e Initial load
duke
parents:
diff changeset
88 JMM_TOTAL_SAFEPOINTSYNC_TIME_MS = 106, /* Accumulated time spent getting to safepoints */
a61af66fc99e Initial load
duke
parents:
diff changeset
89 JMM_TOTAL_STOPPED_TIME_MS = 107, /* Accumulated time spent at safepoints */
a61af66fc99e Initial load
duke
parents:
diff changeset
90 JMM_TOTAL_APP_TIME_MS = 108, /* Accumulated time spent in Java application */
a61af66fc99e Initial load
duke
parents:
diff changeset
91 JMM_VM_THREAD_COUNT = 109, /* Current number of VM internal threads */
a61af66fc99e Initial load
duke
parents:
diff changeset
92 JMM_CLASS_INIT_TOTAL_COUNT = 110, /* Number of classes for which initializers were run */
a61af66fc99e Initial load
duke
parents:
diff changeset
93 JMM_CLASS_INIT_TOTAL_TIME_MS = 111, /* Accumulated time spent in class initializers */
a61af66fc99e Initial load
duke
parents:
diff changeset
94 JMM_METHOD_DATA_SIZE_BYTES = 112, /* Size of method data in memory */
a61af66fc99e Initial load
duke
parents:
diff changeset
95 JMM_CLASS_VERIFY_TOTAL_TIME_MS = 113, /* Accumulated time spent in class verifier */
a61af66fc99e Initial load
duke
parents:
diff changeset
96 JMM_SHARED_CLASS_LOADED_COUNT = 114, /* Number of shared classes loaded */
a61af66fc99e Initial load
duke
parents:
diff changeset
97 JMM_SHARED_CLASS_UNLOADED_COUNT = 115, /* Number of shared classes unloaded */
a61af66fc99e Initial load
duke
parents:
diff changeset
98 JMM_SHARED_CLASS_LOADED_BYTES = 116, /* Number of bytes loaded shared classes */
a61af66fc99e Initial load
duke
parents:
diff changeset
99 JMM_SHARED_CLASS_UNLOADED_BYTES = 117, /* Number of bytes unloaded shared classes */
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 JMM_OS_ATTRIBUTE_INDEX = 200,
a61af66fc99e Initial load
duke
parents:
diff changeset
102 JMM_OS_PROCESS_ID = 201, /* Process id of the JVM */
a61af66fc99e Initial load
duke
parents:
diff changeset
103 JMM_OS_MEM_TOTAL_PHYSICAL_BYTES = 202, /* Physical memory size */
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105 JMM_GC_EXT_ATTRIBUTE_INFO_SIZE = 401 /* the size of the GC specific attributes for a given GC memory manager */
a61af66fc99e Initial load
duke
parents:
diff changeset
106 } jmmLongAttribute;
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 typedef enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
109 JMM_VERBOSE_GC = 21,
a61af66fc99e Initial load
duke
parents:
diff changeset
110 JMM_VERBOSE_CLASS = 22,
a61af66fc99e Initial load
duke
parents:
diff changeset
111 JMM_THREAD_CONTENTION_MONITORING = 23,
2100
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
112 JMM_THREAD_CPU_TIME = 24,
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
113 JMM_THREAD_ALLOCATED_MEMORY = 25
0
a61af66fc99e Initial load
duke
parents:
diff changeset
114 } jmmBoolAttribute;
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
118 JMM_THREAD_STATE_FLAG_SUSPENDED = 0x00100000,
a61af66fc99e Initial load
duke
parents:
diff changeset
119 JMM_THREAD_STATE_FLAG_NATIVE = 0x00400000
a61af66fc99e Initial load
duke
parents:
diff changeset
120 };
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 #define JMM_THREAD_STATE_FLAG_MASK 0xFFF00000
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 typedef enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
125 JMM_STAT_PEAK_THREAD_COUNT = 801,
a61af66fc99e Initial load
duke
parents:
diff changeset
126 JMM_STAT_THREAD_CONTENTION_COUNT = 802,
a61af66fc99e Initial load
duke
parents:
diff changeset
127 JMM_STAT_THREAD_CONTENTION_TIME = 803,
a61af66fc99e Initial load
duke
parents:
diff changeset
128 JMM_STAT_THREAD_CONTENTION_STAT = 804,
a61af66fc99e Initial load
duke
parents:
diff changeset
129 JMM_STAT_PEAK_POOL_USAGE = 805,
a61af66fc99e Initial load
duke
parents:
diff changeset
130 JMM_STAT_GC_STAT = 806
a61af66fc99e Initial load
duke
parents:
diff changeset
131 } jmmStatisticType;
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 typedef enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
134 JMM_USAGE_THRESHOLD_HIGH = 901,
a61af66fc99e Initial load
duke
parents:
diff changeset
135 JMM_USAGE_THRESHOLD_LOW = 902,
a61af66fc99e Initial load
duke
parents:
diff changeset
136 JMM_COLLECTION_USAGE_THRESHOLD_HIGH = 903,
a61af66fc99e Initial load
duke
parents:
diff changeset
137 JMM_COLLECTION_USAGE_THRESHOLD_LOW = 904
a61af66fc99e Initial load
duke
parents:
diff changeset
138 } jmmThresholdType;
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 /* Should match what is allowed in globals.hpp */
a61af66fc99e Initial load
duke
parents:
diff changeset
141 typedef enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
142 JMM_VMGLOBAL_TYPE_UNKNOWN = 0,
a61af66fc99e Initial load
duke
parents:
diff changeset
143 JMM_VMGLOBAL_TYPE_JBOOLEAN = 1,
a61af66fc99e Initial load
duke
parents:
diff changeset
144 JMM_VMGLOBAL_TYPE_JSTRING = 2,
a61af66fc99e Initial load
duke
parents:
diff changeset
145 JMM_VMGLOBAL_TYPE_JLONG = 3
a61af66fc99e Initial load
duke
parents:
diff changeset
146 } jmmVMGlobalType;
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148 typedef enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
149 JMM_VMGLOBAL_ORIGIN_DEFAULT = 1, /* Default value */
a61af66fc99e Initial load
duke
parents:
diff changeset
150 JMM_VMGLOBAL_ORIGIN_COMMAND_LINE = 2, /* Set at command line (or JNI invocation) */
a61af66fc99e Initial load
duke
parents:
diff changeset
151 JMM_VMGLOBAL_ORIGIN_MANAGEMENT = 3, /* Set via management interface */
a61af66fc99e Initial load
duke
parents:
diff changeset
152 JMM_VMGLOBAL_ORIGIN_ENVIRON_VAR = 4, /* Set via environment variables */
a61af66fc99e Initial load
duke
parents:
diff changeset
153 JMM_VMGLOBAL_ORIGIN_CONFIG_FILE = 5, /* Set via config file (such as .hotspotrc) */
a61af66fc99e Initial load
duke
parents:
diff changeset
154 JMM_VMGLOBAL_ORIGIN_ERGONOMIC = 6, /* Set via ergonomic */
a61af66fc99e Initial load
duke
parents:
diff changeset
155 JMM_VMGLOBAL_ORIGIN_OTHER = 99 /* Set via some other mechanism */
a61af66fc99e Initial load
duke
parents:
diff changeset
156 } jmmVMGlobalOrigin;
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 typedef struct {
a61af66fc99e Initial load
duke
parents:
diff changeset
159 jstring name;
a61af66fc99e Initial load
duke
parents:
diff changeset
160 jvalue value;
a61af66fc99e Initial load
duke
parents:
diff changeset
161 jmmVMGlobalType type; /* Data type */
a61af66fc99e Initial load
duke
parents:
diff changeset
162 jmmVMGlobalOrigin origin; /* Default or non-default value */
a61af66fc99e Initial load
duke
parents:
diff changeset
163 unsigned int writeable : 1; /* dynamically writeable */
a61af66fc99e Initial load
duke
parents:
diff changeset
164 unsigned int external : 1; /* external supported interface */
a61af66fc99e Initial load
duke
parents:
diff changeset
165 unsigned int reserved : 30;
a61af66fc99e Initial load
duke
parents:
diff changeset
166 void *reserved1;
a61af66fc99e Initial load
duke
parents:
diff changeset
167 void *reserved2;
a61af66fc99e Initial load
duke
parents:
diff changeset
168 } jmmVMGlobal;
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 typedef struct {
a61af66fc99e Initial load
duke
parents:
diff changeset
171 const char* name;
a61af66fc99e Initial load
duke
parents:
diff changeset
172 char type;
a61af66fc99e Initial load
duke
parents:
diff changeset
173 const char* description;
a61af66fc99e Initial load
duke
parents:
diff changeset
174 } jmmExtAttributeInfo;
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 /* Caller has to set the following fields before calling GetLastGCStat
a61af66fc99e Initial load
duke
parents:
diff changeset
177 * o usage_before_gc - array of MemoryUsage objects
a61af66fc99e Initial load
duke
parents:
diff changeset
178 * o usage_after_gc - array of MemoryUsage objects
a61af66fc99e Initial load
duke
parents:
diff changeset
179 * o gc_ext_attribute_values_size - size of gc_ext_atttribute_values array
a61af66fc99e Initial load
duke
parents:
diff changeset
180 * o gc_ext_attribtue_values - array of jvalues
a61af66fc99e Initial load
duke
parents:
diff changeset
181 */
a61af66fc99e Initial load
duke
parents:
diff changeset
182 typedef struct {
a61af66fc99e Initial load
duke
parents:
diff changeset
183 jlong gc_index; /* Index of the collections */
a61af66fc99e Initial load
duke
parents:
diff changeset
184 jlong start_time; /* Start time of the GC */
a61af66fc99e Initial load
duke
parents:
diff changeset
185 jlong end_time; /* End time of the GC */
a61af66fc99e Initial load
duke
parents:
diff changeset
186 jobjectArray usage_before_gc; /* Memory usage array before GC */
a61af66fc99e Initial load
duke
parents:
diff changeset
187 jobjectArray usage_after_gc; /* Memory usage array after GC */
a61af66fc99e Initial load
duke
parents:
diff changeset
188 jint gc_ext_attribute_values_size; /* set by the caller of GetGCStat */
a61af66fc99e Initial load
duke
parents:
diff changeset
189 jvalue* gc_ext_attribute_values; /* Array of jvalue for GC extension attributes */
a61af66fc99e Initial load
duke
parents:
diff changeset
190 jint num_gc_ext_attributes; /* number of GC extension attribute values s are filled */
a61af66fc99e Initial load
duke
parents:
diff changeset
191 /* -1 indicates gc_ext_attribute_values is not big enough */
a61af66fc99e Initial load
duke
parents:
diff changeset
192 } jmmGCStat;
a61af66fc99e Initial load
duke
parents:
diff changeset
193
4133
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
194 typedef struct {
10215
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
195 const char* name; /* Name of the diagnostic command */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
196 const char* description; /* Short description */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
197 const char* impact; /* Impact on the JVM */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
198 const char* permission_class; /* Class name of the required permission if any */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
199 const char* permission_name; /* Permission name of the required permission if any */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
200 const char* permission_action; /* Action name of the required permission if any*/
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
201 int num_arguments; /* Number of supported options or arguments */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
202 jboolean enabled; /* True if the diagnostic command can be invoked, false otherwise */
4133
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
203 } dcmdInfo;
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
204
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
205 typedef struct {
10215
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
206 const char* name; /* Option/Argument name*/
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
207 const char* description; /* Short description */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
208 const char* type; /* Type: STRING, BOOLEAN, etc. */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
209 const char* default_string; /* Default value in a parsable string */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
210 jboolean mandatory; /* True if the option/argument is mandatory */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
211 jboolean option; /* True if it is an option, false if it is an argument */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
212 /* (see diagnosticFramework.hpp for option/argument definitions) */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
213 jboolean multiple; /* True if the option can be specified several time */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
214 int position; /* Expected position for this argument (this field is */
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
215 /* meaningless for options) */
4133
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
216 } dcmdArgInfo;
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
217
0
a61af66fc99e Initial load
duke
parents:
diff changeset
218 typedef struct jmmInterface_1_ {
a61af66fc99e Initial load
duke
parents:
diff changeset
219 void* reserved1;
a61af66fc99e Initial load
duke
parents:
diff changeset
220 void* reserved2;
a61af66fc99e Initial load
duke
parents:
diff changeset
221
a61af66fc99e Initial load
duke
parents:
diff changeset
222 jint (JNICALL *GetVersion) (JNIEnv *env);
a61af66fc99e Initial load
duke
parents:
diff changeset
223
a61af66fc99e Initial load
duke
parents:
diff changeset
224 jint (JNICALL *GetOptionalSupport) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
225 jmmOptionalSupport* support_ptr);
a61af66fc99e Initial load
duke
parents:
diff changeset
226
a61af66fc99e Initial load
duke
parents:
diff changeset
227 /* This is used by JDK 6 and earlier.
a61af66fc99e Initial load
duke
parents:
diff changeset
228 * For JDK 7 and after, use GetInputArgumentArray.
a61af66fc99e Initial load
duke
parents:
diff changeset
229 */
a61af66fc99e Initial load
duke
parents:
diff changeset
230 jobject (JNICALL *GetInputArguments) (JNIEnv *env);
a61af66fc99e Initial load
duke
parents:
diff changeset
231
a61af66fc99e Initial load
duke
parents:
diff changeset
232 jint (JNICALL *GetThreadInfo) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
233 jlongArray ids,
a61af66fc99e Initial load
duke
parents:
diff changeset
234 jint maxDepth,
a61af66fc99e Initial load
duke
parents:
diff changeset
235 jobjectArray infoArray);
a61af66fc99e Initial load
duke
parents:
diff changeset
236 jobjectArray (JNICALL *GetInputArgumentArray) (JNIEnv *env);
a61af66fc99e Initial load
duke
parents:
diff changeset
237
a61af66fc99e Initial load
duke
parents:
diff changeset
238 jobjectArray (JNICALL *GetMemoryPools) (JNIEnv* env, jobject mgr);
a61af66fc99e Initial load
duke
parents:
diff changeset
239
a61af66fc99e Initial load
duke
parents:
diff changeset
240 jobjectArray (JNICALL *GetMemoryManagers) (JNIEnv* env, jobject pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
241
a61af66fc99e Initial load
duke
parents:
diff changeset
242 jobject (JNICALL *GetMemoryPoolUsage) (JNIEnv* env, jobject pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
243 jobject (JNICALL *GetPeakMemoryPoolUsage) (JNIEnv* env, jobject pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
244
2100
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
245 void (JNICALL *GetThreadAllocatedMemory)
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
246 (JNIEnv *env,
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
247 jlongArray ids,
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
248 jlongArray sizeArray);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
249
a61af66fc99e Initial load
duke
parents:
diff changeset
250 jobject (JNICALL *GetMemoryUsage) (JNIEnv* env, jboolean heap);
a61af66fc99e Initial load
duke
parents:
diff changeset
251
a61af66fc99e Initial load
duke
parents:
diff changeset
252 jlong (JNICALL *GetLongAttribute) (JNIEnv *env, jobject obj, jmmLongAttribute att);
a61af66fc99e Initial load
duke
parents:
diff changeset
253 jboolean (JNICALL *GetBoolAttribute) (JNIEnv *env, jmmBoolAttribute att);
a61af66fc99e Initial load
duke
parents:
diff changeset
254 jboolean (JNICALL *SetBoolAttribute) (JNIEnv *env, jmmBoolAttribute att, jboolean flag);
a61af66fc99e Initial load
duke
parents:
diff changeset
255
a61af66fc99e Initial load
duke
parents:
diff changeset
256 jint (JNICALL *GetLongAttributes) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
257 jobject obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
258 jmmLongAttribute* atts,
a61af66fc99e Initial load
duke
parents:
diff changeset
259 jint count,
a61af66fc99e Initial load
duke
parents:
diff changeset
260 jlong* result);
a61af66fc99e Initial load
duke
parents:
diff changeset
261
a61af66fc99e Initial load
duke
parents:
diff changeset
262 jobjectArray (JNICALL *FindCircularBlockedThreads) (JNIEnv *env);
2100
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
263
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
264 // Not used in JDK 6 or JDK 7
0
a61af66fc99e Initial load
duke
parents:
diff changeset
265 jlong (JNICALL *GetThreadCpuTime) (JNIEnv *env, jlong thread_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
266
a61af66fc99e Initial load
duke
parents:
diff changeset
267 jobjectArray (JNICALL *GetVMGlobalNames) (JNIEnv *env);
a61af66fc99e Initial load
duke
parents:
diff changeset
268 jint (JNICALL *GetVMGlobals) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
269 jobjectArray names,
a61af66fc99e Initial load
duke
parents:
diff changeset
270 jmmVMGlobal *globals,
a61af66fc99e Initial load
duke
parents:
diff changeset
271 jint count);
a61af66fc99e Initial load
duke
parents:
diff changeset
272
a61af66fc99e Initial load
duke
parents:
diff changeset
273 jint (JNICALL *GetInternalThreadTimes) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
274 jobjectArray names,
a61af66fc99e Initial load
duke
parents:
diff changeset
275 jlongArray times);
a61af66fc99e Initial load
duke
parents:
diff changeset
276
a61af66fc99e Initial load
duke
parents:
diff changeset
277 jboolean (JNICALL *ResetStatistic) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
278 jvalue obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
279 jmmStatisticType type);
a61af66fc99e Initial load
duke
parents:
diff changeset
280
a61af66fc99e Initial load
duke
parents:
diff changeset
281 void (JNICALL *SetPoolSensor) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
282 jobject pool,
a61af66fc99e Initial load
duke
parents:
diff changeset
283 jmmThresholdType type,
a61af66fc99e Initial load
duke
parents:
diff changeset
284 jobject sensor);
a61af66fc99e Initial load
duke
parents:
diff changeset
285
a61af66fc99e Initial load
duke
parents:
diff changeset
286 jlong (JNICALL *SetPoolThreshold) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
287 jobject pool,
a61af66fc99e Initial load
duke
parents:
diff changeset
288 jmmThresholdType type,
a61af66fc99e Initial load
duke
parents:
diff changeset
289 jlong threshold);
a61af66fc99e Initial load
duke
parents:
diff changeset
290 jobject (JNICALL *GetPoolCollectionUsage) (JNIEnv* env, jobject pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
291
a61af66fc99e Initial load
duke
parents:
diff changeset
292 jint (JNICALL *GetGCExtAttributeInfo) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
293 jobject mgr,
a61af66fc99e Initial load
duke
parents:
diff changeset
294 jmmExtAttributeInfo *ext_info,
a61af66fc99e Initial load
duke
parents:
diff changeset
295 jint count);
a61af66fc99e Initial load
duke
parents:
diff changeset
296 void (JNICALL *GetLastGCStat) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
297 jobject mgr,
a61af66fc99e Initial load
duke
parents:
diff changeset
298 jmmGCStat *gc_stat);
2100
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
299
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
300 jlong (JNICALL *GetThreadCpuTimeWithKind)
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
301 (JNIEnv *env,
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
302 jlong thread_id,
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
303 jboolean user_sys_cpu_time);
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
304 void (JNICALL *GetThreadCpuTimesWithKind)
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
305 (JNIEnv *env,
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
306 jlongArray ids,
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
307 jlongArray timeArray,
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
308 jboolean user_sys_cpu_time);
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
309
0
a61af66fc99e Initial load
duke
parents:
diff changeset
310 jint (JNICALL *DumpHeap0) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
311 jstring outputfile,
a61af66fc99e Initial load
duke
parents:
diff changeset
312 jboolean live);
2100
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
313 jobjectArray (JNICALL *FindDeadlocks) (JNIEnv *env,
b1a2afa37ec4 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 1972
diff changeset
314 jboolean object_monitors_only);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
315 void (JNICALL *SetVMGlobal) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
316 jstring flag_name,
a61af66fc99e Initial load
duke
parents:
diff changeset
317 jvalue new_value);
a61af66fc99e Initial load
duke
parents:
diff changeset
318 void* reserved6;
a61af66fc99e Initial load
duke
parents:
diff changeset
319 jobjectArray (JNICALL *DumpThreads) (JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
320 jlongArray ids,
a61af66fc99e Initial load
duke
parents:
diff changeset
321 jboolean lockedMonitors,
a61af66fc99e Initial load
duke
parents:
diff changeset
322 jboolean lockedSynchronizers);
3356
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2100
diff changeset
323 void (JNICALL *SetGCNotificationEnabled) (JNIEnv *env,
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2100
diff changeset
324 jobject mgr,
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2100
diff changeset
325 jboolean enabled);
4133
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
326 jobjectArray (JNICALL *GetDiagnosticCommands) (JNIEnv *env);
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
327 void (JNICALL *GetDiagnosticCommandInfo)
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
328 (JNIEnv *env,
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
329 jobjectArray cmds,
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
330 dcmdInfo *infoArray);
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
331 void (JNICALL *GetDiagnosticCommandArgumentsInfo)
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
332 (JNIEnv *env,
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
333 jstring commandName,
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
334 dcmdArgInfo *infoArray);
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
335 jstring (JNICALL *ExecuteDiagnosticCommand)
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
336 (JNIEnv *env,
3b688d6ff3d0 7104647: Adding a diagnostic command framework
fparain
parents: 3356
diff changeset
337 jstring command);
10215
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
338 void (JNICALL *SetDiagnosticFrameworkNotificationEnabled)
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
339 (JNIEnv *env,
31a4e55f8c9d 8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents: 4133
diff changeset
340 jboolean enabled);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
341 } JmmInterface;
a61af66fc99e Initial load
duke
parents:
diff changeset
342
a61af66fc99e Initial load
duke
parents:
diff changeset
343 #ifdef __cplusplus
a61af66fc99e Initial load
duke
parents:
diff changeset
344 } /* extern "C" */
a61af66fc99e Initial load
duke
parents:
diff changeset
345 #endif /* __cplusplus */
a61af66fc99e Initial load
duke
parents:
diff changeset
346
a61af66fc99e Initial load
duke
parents:
diff changeset
347 #endif /* !_JAVA_JMM_H_ */