Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions src/hotspot/share/include/jmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,21 @@ enum {
JMM_VERSION = JMM_VERSION_4
};

#if HOTSPOT_TARGET_CLASSLIB == 8
enum {
JMM_VERSION_CVM8 = 0x20010203 // JDK 8
};
#endif

typedef struct {
unsigned int isLowMemoryDetectionSupported : 1;
unsigned int isCompilationTimeMonitoringSupported : 1;
unsigned int isThreadContentionMonitoringSupported : 1;
unsigned int isCurrentThreadCpuTimeSupported : 1;
unsigned int isOtherThreadCpuTimeSupported : 1;
#if HOTSPOT_TARGET_CLASSLIB == 8
unsigned int isBootClassPathSupported : 1;
#endif
unsigned int isObjectMonitorUsageSupported : 1;
unsigned int isSynchronizerUsageSupported : 1;
unsigned int isThreadAllocatedMemorySupported : 1;
Expand Down Expand Up @@ -346,6 +355,140 @@ typedef struct jmmInterface_1_ {
jboolean enabled);
} JmmInterface;

#if HOTSPOT_TARGET_CLASSLIB == 8
typedef struct jmmInterface_jdk8_ {
jlong (JNICALL *GetTotalThreadAllocatedMemory)
(JNIEnv *env);
jlong (JNICALL *GetOneThreadAllocatedMemory)
(JNIEnv *env,
jlong thread_id);

jint (JNICALL *GetVersion) (JNIEnv *env);

jint (JNICALL *GetOptionalSupport) (JNIEnv *env,
jmmOptionalSupport* support_ptr);

/* This is used by JDK 6 and earlier.
* For JDK 7 and after, use GetInputArgumentArray.
*/
jobject (JNICALL *GetInputArguments) (JNIEnv *env);

jint (JNICALL *GetThreadInfo) (JNIEnv *env,
jlongArray ids,
jint maxDepth,
jobjectArray infoArray);
jobjectArray (JNICALL *GetInputArgumentArray) (JNIEnv *env);

jobjectArray (JNICALL *GetMemoryPools) (JNIEnv* env, jobject mgr);

jobjectArray (JNICALL *GetMemoryManagers) (JNIEnv* env, jobject pool);

jobject (JNICALL *GetMemoryPoolUsage) (JNIEnv* env, jobject pool);
jobject (JNICALL *GetPeakMemoryPoolUsage) (JNIEnv* env, jobject pool);

void (JNICALL *GetThreadAllocatedMemory)
(JNIEnv *env,
jlongArray ids,
jlongArray sizeArray);

jobject (JNICALL *GetMemoryUsage) (JNIEnv* env, jboolean heap);

jlong (JNICALL *GetLongAttribute) (JNIEnv *env, jobject obj, jmmLongAttribute att);
jboolean (JNICALL *GetBoolAttribute) (JNIEnv *env, jmmBoolAttribute att);
jboolean (JNICALL *SetBoolAttribute) (JNIEnv *env, jmmBoolAttribute att, jboolean flag);

jint (JNICALL *GetLongAttributes) (JNIEnv *env,
jobject obj,
jmmLongAttribute* atts,
jint count,
jlong* result);

jobjectArray (JNICALL *FindCircularBlockedThreads) (JNIEnv *env);

// Not used in JDK 6 or JDK 7
jlong (JNICALL *GetThreadCpuTime) (JNIEnv *env, jlong thread_id);

jobjectArray (JNICALL *GetVMGlobalNames) (JNIEnv *env);
jint (JNICALL *GetVMGlobals) (JNIEnv *env,
jobjectArray names,
jmmVMGlobal *globals,
jint count);

jint (JNICALL *GetInternalThreadTimes) (JNIEnv *env,
jobjectArray names,
jlongArray times);

jboolean (JNICALL *ResetStatistic) (JNIEnv *env,
jvalue obj,
jmmStatisticType type);

void (JNICALL *SetPoolSensor) (JNIEnv *env,
jobject pool,
jmmThresholdType type,
jobject sensor);

jlong (JNICALL *SetPoolThreshold) (JNIEnv *env,
jobject pool,
jmmThresholdType type,
jlong threshold);
jobject (JNICALL *GetPoolCollectionUsage) (JNIEnv* env, jobject pool);

jint (JNICALL *GetGCExtAttributeInfo) (JNIEnv *env,
jobject mgr,
jmmExtAttributeInfo *ext_info,
jint count);
void (JNICALL *GetLastGCStat) (JNIEnv *env,
jobject mgr,
jmmGCStat *gc_stat);

jlong (JNICALL *GetThreadCpuTimeWithKind)
(JNIEnv *env,
jlong thread_id,
jboolean user_sys_cpu_time);
void (JNICALL *GetThreadCpuTimesWithKind)
(JNIEnv *env,
jlongArray ids,
jlongArray timeArray,
jboolean user_sys_cpu_time);

jint (JNICALL *DumpHeap0) (JNIEnv *env,
jstring outputfile,
jboolean live);
jobjectArray (JNICALL *FindDeadlocks) (JNIEnv *env,
jboolean object_monitors_only);
void (JNICALL *SetVMGlobal) (JNIEnv *env,
jstring flag_name,
jvalue new_value);
jobjectArray (JNICALL *DumpThreadsMaxDepth) (JNIEnv *env,
jlongArray ids,
jboolean lockedMonitors,
jboolean lockedSynchronizers,
jint maxDepth);
jobjectArray (JNICALL *DumpThreads) (JNIEnv *env,
jlongArray ids,
jboolean lockedMonitors,
jboolean lockedSynchronizers);
void (JNICALL *SetGCNotificationEnabled) (JNIEnv *env,
jobject mgr,
jboolean enabled);
jobjectArray (JNICALL *GetDiagnosticCommands) (JNIEnv *env);
void (JNICALL *GetDiagnosticCommandInfo)
(JNIEnv *env,
jobjectArray cmds,
dcmdInfo *infoArray);
void (JNICALL *GetDiagnosticCommandArgumentsInfo)
(JNIEnv *env,
jstring commandName,
dcmdArgInfo *infoArray);
jstring (JNICALL *ExecuteDiagnosticCommand)
(JNIEnv *env,
jstring command);
void (JNICALL *SetDiagnosticFrameworkNotificationEnabled)
(JNIEnv *env,
jboolean enabled);
} JmmInterface_JDK8;
#endif

#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
Expand Down
Loading
Loading