Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_verbose_handler_vlhgc/VerboseHandlerOutputVLHGC.hpp
5986 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2021 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
#if !defined(VERBOSEHANDLEROUTPUTVLHGC_HPP_)
24
#define VERBOSEHANDLEROUTPUTVLHGC_HPP_
25
26
#include "j9.h"
27
#include "j9cfg.h"
28
29
#include "VerboseHandlerOutput.hpp"
30
31
#include "GCExtensions.hpp"
32
33
class MM_EnvironmentBase;
34
class MM_InterRegionRememberedSetStats;
35
class MM_MarkVLHGCStats;
36
class MM_ReferenceStats;
37
class MM_WorkPacketStats;
38
39
class MM_VerboseHandlerOutputVLHGC : public MM_VerboseHandlerOutput
40
{
41
private:
42
43
protected:
44
J9HookInterface** _mmHooks; /**< Pointers to the Hook interface */
45
46
public:
47
48
private:
49
/**
50
* Output unfinalized processing summary.
51
* @param env GC thread used for output.
52
* @param indent base level of indentation for the summary.
53
* @param unfinalizedCandidates number of unfinalized candidates encountered.
54
* @param unfinalizedCount number of candidates that transitioned from unfinalized.
55
*/
56
void outputUnfinalizedInfo(MM_EnvironmentBase *env, UDATA indent, UDATA unfinalizedCandidates, UDATA unfinalizedCount);
57
58
/**
59
* Output unfinalized processing summary.
60
* @param env GC thread used for output.
61
* @param indent base level of indentation for the summary.
62
* @param ownableSynchronizerCandidates number of ownable synchronizer candidates encountered.
63
* @param ownableSynchronizerCleared number of ownable synchronizer candidates cleared.
64
*/
65
void outputOwnableSynchronizerInfo(MM_EnvironmentBase *env, UDATA indent, UDATA ownableSynchronizerCandidates, UDATA ownableSynchronizerCleared);
66
67
/**
68
* Output reference processing summary.
69
* @param env GC thread used for output.
70
* @param indent base level of indentation for the summary.
71
* @param referenceType character string representation of the reference type.
72
* @param referenceStats summary stats data of the processing.
73
* @param dynamicThreshold dynamic threshold value for reference
74
* @param maxThreshold maximum threshold value for reference. If it equal 0 thresholds should not be included to output line
75
*/
76
void outputReferenceInfo(MM_EnvironmentBase *env, UDATA indent, const char *referenceType, MM_ReferenceStats *referenceStats, UDATA dynamicThreshold, UDATA maxThreshold);
77
78
/**
79
* Output a mark gc operation summary stanza.
80
* @param env GC thread performing output.
81
* @param markType String name representation of the mark type.
82
* @param markStats mark stats used for summary.
83
* @param workPacketStats work packet stats used for summary.
84
*/
85
void outputMarkSummary(MM_EnvironmentBase *env, const char *markType, MM_MarkVLHGCStats *markStats, MM_WorkPacketStats *workPacketStats, MM_InterRegionRememberedSetStats *irrsStats);
86
87
/**
88
* Output info on remembered set clearing (from-CS-region clearing pass)
89
* @param env GC thread performing output.
90
* @param irrsStats Intra region remembered set stats.
91
*/
92
void outputRememberedSetClearedInfo(MM_EnvironmentBase *env, MM_InterRegionRememberedSetStats *irrsStats);
93
94
95
protected:
96
virtual void outputInitializedInnerStanza(MM_EnvironmentBase *env, MM_VerboseBuffer *buffer);
97
98
/**
99
* @returns true if memory-info staza is multiline. Caller than format first and last line accordingly.
100
*/
101
virtual bool hasOutputMemoryInfoInnerStanza();
102
/**
103
* The actual body (excluding first and last line) of memory-info stanza.
104
*/
105
virtual void outputMemoryInfoInnerStanza(MM_EnvironmentBase *env, UDATA indent, MM_CollectionStatistics *stats);
106
107
virtual const char *getSubSpaceType(uintptr_t typeFlags);
108
109
/* Print out allocations statistics
110
* @param current Env
111
*/
112
virtual void printAllocationStats(MM_EnvironmentBase* env);
113
114
/**
115
* Answer a string representation of a given cycle type.
116
* @param[IN] cycle type
117
* @return string representing the human readable "type" of the cycle.
118
*/
119
virtual const char *getCycleType(UDATA type);
120
121
virtual bool initialize(MM_EnvironmentBase *env, MM_VerboseManager *manager);
122
virtual void tearDown(MM_EnvironmentBase *env);
123
124
virtual bool getThreadName(char *buf, UDATA bufLen, OMR_VMThread *vmThread);
125
virtual void writeVmArgs(MM_EnvironmentBase* env, MM_VerboseBuffer* buffer);
126
127
MM_VerboseHandlerOutputVLHGC(MM_GCExtensions *extensions)
128
: MM_VerboseHandlerOutput(extensions)
129
, _mmHooks(NULL)
130
{};
131
132
public:
133
static MM_VerboseHandlerOutput *newInstance(MM_EnvironmentBase *env, MM_VerboseManager *manager);
134
135
/**
136
* Write the verbose stanza allocation taxation trigger point (preceding PGCs and GMP increments).
137
* @param hook Hook interface used by the JVM.
138
* @param eventNum The hook event number.
139
* @param eventData hook specific event data.
140
*/
141
void handleTaxationEntryPoint(J9HookInterface** hook, UDATA eventNum, void* eventData);
142
143
/**
144
* Write the verbose stanza for the copy forward start event.
145
* @param hook Hook interface used by the JVM.
146
* @param eventNum The hook event number.
147
* @param eventData hook specific event data.
148
*/
149
void handleCopyForwardStart(J9HookInterface** hook, UDATA eventNum, void* eventData);
150
151
/**
152
* Write the verbose stanza for the copy forward end event.
153
* @param hook Hook interface used by the JVM.
154
* @param eventNum The hook event number.
155
* @param eventData hook specific event data.
156
*/
157
void handleCopyForwardEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);
158
159
virtual void handleConcurrentStartInternal(J9HookInterface** hook, UDATA eventNum, void* eventData);
160
virtual void handleConcurrentEndInternal(J9HookInterface** hook, UDATA eventNum, void* eventData);
161
virtual const char *getConcurrentTypeString(uintptr_t type) { return "GMP work packet processing"; }
162
163
/**
164
* Write the verbose stanza for the GMP mark start event.
165
* @param hook Hook interface used by the JVM.
166
* @param eventNum The hook event number.
167
* @param eventData hook specific event data.
168
*/
169
void handleGMPMarkStart(J9HookInterface** hook, UDATA eventNum, void* eventData);
170
171
/**
172
* Write the verbose stanza for the GMP mark end event.
173
* @param hook Hook interface used by the JVM.
174
* @param eventNum The hook event number.
175
* @param eventData hook specific event data.
176
*/
177
void handleGMPMarkEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);
178
179
/**
180
* Write the verbose stanza for the global gc mark start event.
181
* @param hook Hook interface used by the JVM.
182
* @param eventNum The hook event number.
183
* @param eventData hook specific event data.
184
*/
185
void handleGlobalGCMarkStart(J9HookInterface** hook, UDATA eventNum, void* eventData);
186
187
/**
188
* Write the verbose stanza for the global gc mark end event.
189
* @param hook Hook interface used by the JVM.
190
* @param eventNum The hook event number.
191
* @param eventData hook specific event data.
192
*/
193
void handleGlobalGCMarkEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);
194
195
/**
196
* Write the verbose stanza for the PGC mark start event.
197
* @param hook Hook interface used by the JVM.
198
* @param eventNum The hook event number.
199
* @param eventData hook specific event data.
200
*/
201
void handlePGCMarkStart(J9HookInterface** hook, UDATA eventNum, void* eventData);
202
203
/**
204
* Write the verbose stanza for the PGC mark end event.
205
* @param hook Hook interface used by the JVM.
206
* @param eventNum The hook event number.
207
* @param eventData hook specific event data.
208
*/
209
void handlePGCMarkEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);
210
211
/**
212
* Write the verbose stanza for the reclaim sweep start event.
213
* @param hook Hook interface used by the JVM.
214
* @param eventNum The hook event number.
215
* @param eventData hook specific event data.
216
*/
217
void handleReclaimSweepStart(J9HookInterface** hook, UDATA eventNum, void* eventData);
218
219
/**
220
* Write the verbose stanza for the reclaim sweep end event.
221
* @param hook Hook interface used by the JVM.
222
* @param eventNum The hook event number.
223
* @param eventData hook specific event data.
224
*/
225
void handleReclaimSweepEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);
226
227
/**
228
* Write the verbose stanza for the reclaim compact start event.
229
* @param hook Hook interface used by the JVM.
230
* @param eventNum The hook event number.
231
* @param eventData hook specific event data.
232
*/
233
void handleReclaimCompactStart(J9HookInterface** hook, UDATA eventNum, void* eventData);
234
235
/**
236
* Write the verbose stanza for the reclaim compact end event.
237
* @param hook Hook interface used by the JVM.
238
* @param eventNum The hook event number.
239
* @param eventData hook specific event data.
240
*/
241
void handleReclaimCompactEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);
242
243
/**
244
* Write verbose stanza for a class unload end event.
245
* @param hook Hook interface used by the JVM.
246
* @param eventNum The hook event number.
247
* @param eventData hook specific event data.
248
*/
249
void handleClassUnloadEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);
250
251
virtual void enableVerbose();
252
virtual void disableVerbose();
253
254
/**
255
* Return termination reason for concurrent collection.
256
* @param stats concurrent stats
257
* @return string representing the reason for termination
258
*/
259
const char *getConcurrentTerminationReason(MM_ConcurrentPhaseStatsBase *stats);
260
};
261
262
#endif /* VERBOSEHANDLEROUTPUTVLHGC_HPP_ */
263
264