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