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