Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_verbose_handler_standard_java/VerboseHandlerOutputStandardJava.hpp
5986 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2020 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(VERBOSEHANDLEROUTPUTSTANDARDJAVA_HPP_)
24
#define VERBOSEHANDLEROUTPUTSTANDARDJAVA_HPP_
25
26
#include "j9.h"
27
#include "j9cfg.h"
28
29
#include "VerboseHandlerOutputStandard.hpp"
30
31
class MM_VerboseHandlerOutputStandardJava : public MM_VerboseHandlerOutputStandard
32
{
33
private:
34
protected:
35
J9HookInterface** _mmHooks; /**< Pointers to the mm Hook interface */
36
J9HookInterface **_vmHooks; /**< Pointers to the vm Hook interface */
37
public:
38
39
private:
40
/**
41
* Output unfinalized processing summary.
42
* @param env GC thread used for output.
43
* @param indent base level of indentation for the summary.
44
* @param unfinalizedCandidates number of unfinalized candidates encountered.
45
* @param unfinalizedCount number of candidates that transitioned from unfinalized.
46
*/
47
void outputUnfinalizedInfo(MM_EnvironmentBase *env, UDATA indent, UDATA unfinalizedCandidates, UDATA unfinalizedEnqueuedCount);
48
49
/**
50
* Output ownable synchronizer processing summary.
51
* @param env GC thread used for output.
52
* @param indent base level of indentation for the summary.
53
* @param ownableSynchronizerCandidates number of ownable synchronizers encountered.
54
* @param ownableSynchronizerCleared number of ownable synchronizers cleared.
55
*/
56
void outputOwnableSynchronizerInfo(MM_EnvironmentBase *env, UDATA indent, UDATA ownableSynchronizerCandidates, UDATA ownableSynchronizerCleared);
57
58
/**
59
* Output reference processing summary.
60
* @param env GC thread used for output.
61
* @param indent base level of indentation for the summary.
62
* @param referenceType character string representation of the reference type.
63
* @param referenceStats summary stats data of the processing.
64
* @param dynamicThreshold dynamic threshold value for reference
65
* @param maxThreshold maximum threshold value for reference. If it equal 0 thresholds should not be included to output line
66
*/
67
void outputReferenceInfo(MM_EnvironmentBase *env, UDATA indent, const char *referenceType, MM_ReferenceStats *referenceStats, UDATA dynamicThreshold, UDATA maxThreshold);
68
69
protected:
70
71
virtual bool initialize(MM_EnvironmentBase *env, MM_VerboseManager *manager);
72
virtual void tearDown(MM_EnvironmentBase *env);
73
74
virtual void outputMemoryInfoInnerStanzaInternal(MM_EnvironmentBase *env, UDATA indent, MM_CollectionStatistics *stats);
75
76
virtual bool getThreadName(char *buf, UDATA bufLen, OMR_VMThread *vmThread);
77
virtual void writeVmArgs(MM_EnvironmentBase* env, MM_VerboseBuffer* buffer);
78
79
MM_VerboseHandlerOutputStandardJava(MM_GCExtensions *extensions) :
80
MM_VerboseHandlerOutputStandard(extensions)
81
, _mmHooks(NULL)
82
, _vmHooks(NULL)
83
{};
84
85
public:
86
static MM_VerboseHandlerOutput *newInstance(MM_EnvironmentBase *env, MM_VerboseManager *manager);
87
88
virtual void enableVerbose();
89
virtual void disableVerbose();
90
91
/* Java-specific logic for selected GC events. */
92
virtual void handleMarkEndInternal(MM_EnvironmentBase* env, void *eventData);
93
#if defined(J9VM_GC_MODRON_SCAVENGER)
94
virtual void handleScavengeEndInternal(MM_EnvironmentBase* env, void *eventData);
95
#endif /*defined(J9VM_GC_MODRON_SCAVENGER) */
96
#if defined(OMR_GC_MODRON_CONCURRENT_MARK)
97
virtual const char* getConcurrentKickoffReason(void *eventData);
98
#if defined(J9VM_GC_DYNAMIC_CLASS_UNLOADING)
99
virtual void handleConcurrentHaltedInternal(MM_EnvironmentBase *env, void *eventData);
100
#endif /* defined(J9VM_GC_DYNAMIC_CLASS_UNLOADING) */
101
#endif /* defined(OMR_GC_MODRON_CONCURRENT_MARK) */
102
103
#if defined(J9VM_GC_DYNAMIC_CLASS_UNLOADING)
104
/**
105
* Write verbose stanza for a compact end event.
106
* @param hook Hook interface used by the JVM.
107
* @param eventNum The hook event number.
108
* @param eventData hook specific event data.
109
*/
110
void handleClassUnloadEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);
111
#endif /* defined(J9VM_GC_DYNAMIC_CLASS_UNLOADING) */
112
113
/**
114
* @param hook Hook interface used by the JVM.
115
* @param eventNum The hook event number.
116
* @param eventData hook specific event data.
117
*/
118
void handleSlowExclusive(J9HookInterface **hook, UDATA eventNum, void *eventData);
119
};
120
121
#endif /* VERBOSEHANDLEROUTPUTSTANDARDJAVA_HPP_ */
122
123