Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/include/jvmri.h
5986 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2017 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************/
22
23
#ifndef _IBM_JVMRAS_H_
24
#define _IBM_JVMRAS_H_
25
26
/* @ddr_namespace: default */
27
/*
28
* ======================================================================
29
* Allow for inclusion in C++
30
* ======================================================================
31
*/
32
#ifdef __cplusplus
33
extern "C" {
34
#endif
35
36
#include "jni.h"
37
#include "stdarg.h"
38
39
/*
40
* ======================================================================
41
* Forward declarations
42
* ======================================================================
43
*/
44
typedef void (JNICALL *TraceListener)(JNIEnv *env, void **thrLocal, int traceId,
45
const char * format, va_list varargs);
46
typedef void (JNICALL *TraceListener50)(JNIEnv *env, void **thrLocal, const char *moduleName,
47
int traceId, const char * format, va_list varargs);
48
typedef void (*DgRasOutOfMemoryHook)(void);
49
50
/*
51
* ======================================================================
52
* RasInfo structures
53
* ======================================================================
54
*/
55
typedef struct RasInfo {
56
int type;
57
union {
58
struct {
59
int number;
60
char **names;
61
} query;
62
struct {
63
int number;
64
char **names;
65
} trace_components;
66
struct {
67
char *name;
68
int first;
69
int last;
70
unsigned char *bitMap;
71
} trace_component;
72
} info;
73
} RasInfo;
74
75
#define RASINFO_TYPES 0
76
#define RASINFO_TRACE_COMPONENTS 1
77
#define RASINFO_TRACE_COMPONENT 2
78
#define RASINFO_MAX_TYPES 2
79
80
/*
81
* ======================================================================
82
* External access facade
83
* ======================================================================
84
*/
85
#define JVMRAS_VERSION_1_1 0x7F000001
86
#define JVMRAS_VERSION_1_3 0x7F000003
87
#define JVMRAS_VERSION_1_5 0x7F000005
88
89
typedef struct DgRasInterface {
90
char eyecatcher[4];
91
int length;
92
int version;
93
int modification;
94
/* Interface level 1_1 */
95
int (JNICALL *TraceRegister)(JNIEnv *env, TraceListener func);
96
int (JNICALL *TraceDeregister)(JNIEnv *env, TraceListener func);
97
int (JNICALL *TraceSet)(JNIEnv *env, const char *);
98
void (JNICALL *TraceSnap)(JNIEnv *env, char *);
99
void (JNICALL *TraceSuspend)(JNIEnv *env);
100
void (JNICALL *TraceResume)(JNIEnv *env);
101
int (JNICALL *GetRasInfo)(JNIEnv * env, RasInfo * info_ptr);
102
int (JNICALL *ReleaseRasInfo)(JNIEnv * env, RasInfo * info_ptr);
103
int (JNICALL *DumpRegister)(JNIEnv *env,
104
int (JNICALL *func)(JNIEnv *env2,
105
void **threadLocal,
106
int reason));
107
int (JNICALL *DumpDeregister)(JNIEnv *env,
108
int (JNICALL *func)(JNIEnv *env2,
109
void **threadLocal,
110
int reason));
111
void (JNICALL *NotifySignal)(JNIEnv *env, int signal);
112
int (JNICALL *CreateThread)( JNIEnv *env, void (JNICALL *startFunc)(void*),
113
void *args, int GCSuspend );
114
int (JNICALL *GenerateJavacore)( JNIEnv *env );
115
int (JNICALL *RunDumpRoutine)( JNIEnv *env, int componentID, int level,
116
void (*printrtn)(void *env, const char *tagName,
117
const char *fmt, ...) );
118
int (JNICALL *InjectSigsegv)( JNIEnv *env );
119
int (JNICALL *InjectOutOfMemory)( JNIEnv *env );
120
int (JNICALL *SetOutOfMemoryHook)( JNIEnv *env, void (*OutOfMemoryFunc)(void) );
121
int (JNICALL *GetComponentDataArea)( JNIEnv *env, char *componentName,
122
void **dataArea, int *dataSize );
123
int (JNICALL *InitiateSystemDump)( JNIEnv *env );
124
/* Interface level 1_3 follows */
125
void (JNICALL *DynamicVerbosegc) (JNIEnv *env, int vgc_switch,
126
int vgccon, char* file_path,
127
int number_of_files,
128
int number_of_cycles);
129
void (JNICALL *TraceSuspendThis)(JNIEnv *env);
130
void (JNICALL *TraceResumeThis)(JNIEnv *env);
131
int (JNICALL *GenerateHeapdump)( JNIEnv *env );
132
/* Interface level 1_5 */
133
int (JNICALL *TraceRegister50)(JNIEnv *env, TraceListener50 func);
134
int (JNICALL *TraceDeregister50)(JNIEnv *env, TraceListener50 func);
135
} DgRasInterface;
136
137
/*
138
* ======================================================================
139
* Dump exit return codes
140
* ======================================================================
141
*/
142
#define RAS_DUMP_CONTINUE 0 /* Continue with diagnostic collection */
143
#define RAS_DUMP_ABORT 1 /* No more diagnostics should be taken */
144
145
/*
146
* ======================================================================
147
* Thread Creation types
148
* ======================================================================
149
*/
150
#define NO_GC_THREAD_SUSPEND 0 /* Do not suspend thread during CG. */
151
#define GC_THREAD_SUSPEND 1 /* Suspend thread during CG. */
152
#define RAS_THREAD_NAME_SIZE 50 /* Size of Ras Thread Name. */
153
154
/*
155
* ======================================================================
156
* Dump Handler types
157
* ======================================================================
158
*/
159
enum dumpType {
160
NODUMPS = 0,
161
JAVADUMP = 0x01,
162
SYSDUMP = 0x02,
163
CEEDUMP = 0x04,
164
HEAPDUMP = 0x08,
165
MAXDUMPTYPES = 6,
166
167
/* ensure 4-byte enum */
168
dumpTypeEnsureWideEnum = 0x1000000
169
};
170
171
#define ALLDUMPS (JAVADUMP | SYSDUMP | CEEDUMP | HEAPDUMP)
172
#define OSDUMP (ALLDUMPS + 1)
173
174
#ifdef __cplusplus
175
} /* extern "C" */
176
#endif
177
178
#endif /* !_IBM_JVMRAS_H_ */
179
180