Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_verbose_old/VerboseManagerOld.hpp
5985 views
1
2
/*******************************************************************************
3
* Copyright (c) 1991, 2014 IBM Corp. and others
4
*
5
* This program and the accompanying materials are made available under
6
* the terms of the Eclipse Public License 2.0 which accompanies this
7
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
* or the Apache License, Version 2.0 which accompanies this distribution and
9
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10
*
11
* This Source Code may also be made available under the following
12
* Secondary Licenses when the conditions for such availability set
13
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
* General Public License, version 2 with the GNU Classpath
15
* Exception [1] and GNU General Public License, version 2 with the
16
* OpenJDK Assembly Exception [2].
17
*
18
* [1] https://www.gnu.org/software/classpath/license.html
19
* [2] http://openjdk.java.net/legal/assembly-exception.html
20
*
21
* 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
22
*******************************************************************************/
23
24
#if !defined(VERBOSEMANAGEROLD_HPP_)
25
#define VERBOSEMANAGEROLD_HPP_
26
27
#include "VerboseManagerBase.hpp"
28
#include "VerboseOutputAgent.hpp"
29
30
31
/**
32
* Contains the old verbose codepath (-Xgc:verboseFormat:deprecated).
33
* @ingroup GC_verbose_engine
34
*/
35
class MM_VerboseManagerOld : public MM_VerboseManagerBase
36
{
37
/*
38
* Data members
39
*/
40
private:
41
J9JavaVM *javaVM;
42
43
/* Pointers to the Hook interface */
44
J9HookInterface** _mmHooks;
45
46
/* The event stream */
47
MM_VerboseEventStream *_eventStream;
48
49
/* The Output agents */
50
MM_VerboseOutputAgent *_agentChain;
51
52
protected:
53
public:
54
55
/*
56
* Function members
57
*/
58
private:
59
60
void chainOutputAgent(MM_VerboseOutputAgent *agent);
61
MM_VerboseOutputAgent *findAgentInChain(AgentType type);
62
void disableAgents();
63
UDATA countActiveOutputAgents();
64
65
AgentType parseAgentType(MM_EnvironmentBase *env, char *filename, UDATA fileCount, UDATA iterations);
66
67
/**
68
* Enable hooks for old verbose which are used in realtime configuration
69
*/
70
void enableVerboseGCRealtime();
71
72
/**
73
* Disable hooks for old verbose which are used in realtime configuration
74
*/
75
void disableVerboseGCRealtime();
76
77
/**
78
* Enable hooks for old verbose which are used in non-realtime configurations
79
*/
80
void enableVerboseGCNonRealtime();
81
82
/**
83
* Disable hooks for old verbose which are used in non-realtime configurations
84
*/
85
void disableVerboseGCNonRealtime();
86
87
/**
88
* Enable hooks for old verbose which are used in VLHGC configuration
89
*/
90
void enableVerboseGCVLHGC();
91
92
/**
93
* Disable hooks for old verbose which are used in VLHGC configuration
94
*/
95
void disableVerboseGCVLHGC();
96
97
protected:
98
99
virtual bool initialize(MM_EnvironmentBase *env);
100
virtual void tearDown(MM_EnvironmentBase *env);
101
102
public:
103
104
MM_VerboseEventStream *getEventStreamForEvent(MM_VerboseEvent *event);
105
MM_VerboseEventStream *getEventStream() { return _eventStream; }
106
107
/* Interface for Dynamic Configuration */
108
virtual bool configureVerboseGC(OMR_VM *omrVM, char* filename, UDATA fileCount, UDATA iterations);
109
110
/**
111
* Determine the number of currently active output mechanisms.
112
* @return a count of the number of active output mechanisms.
113
*/
114
virtual UDATA countActiveOutputHandlers();
115
116
/* Call for Event Stream */
117
void passStreamToOutputAgents(MM_EnvironmentBase *env, MM_VerboseEventStream *stream);
118
119
virtual void enableVerboseGC();
120
virtual void disableVerboseGC();
121
122
static MM_VerboseManagerOld *newInstance(MM_EnvironmentBase *env, OMR_VM* vm);
123
virtual void kill(MM_EnvironmentBase *env);
124
125
/**
126
* Close all output mechanisms on the receiver.
127
* @param env vm thread.
128
*/
129
virtual void closeStreams(MM_EnvironmentBase *env);
130
131
J9HookInterface** getHookInterface(){ return _mmHooks; }
132
133
MM_VerboseManagerOld(OMR_VM *vm)
134
: MM_VerboseManagerBase(vm)
135
, _mmHooks(NULL)
136
, _eventStream(NULL)
137
, _agentChain(NULL)
138
{
139
}
140
};
141
142
#endif /* VERBOSEMANAGEROLD_HPP_ */
143
144