Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_verbose_old/VerboseEventStream.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(EVENTSTREAM_HPP_)
25
#define EVENTSTREAM_HPP_
26
27
#include "j9.h"
28
#include "j9cfg.h"
29
#include "modron.h"
30
31
#include "Base.hpp"
32
#include "EnvironmentBase.hpp"
33
34
class MM_VerboseEvent;
35
class MM_VerboseManager;
36
class MM_VerboseManagerOld;
37
38
/**
39
* Part of the verbose gc mechanism.
40
* Provides management routines and the anchor point for the chain of MM_VerboseEvents.
41
* @ingroup GC_verbose_engine
42
*/
43
class MM_VerboseEventStream : public MM_Base
44
{
45
private:
46
J9JavaVM *_javaVM;
47
MM_VerboseManagerOld* _manager;
48
49
/* Anchor point for chained events */
50
MM_VerboseEvent *_eventChain;
51
/* Last entry in Event chain */
52
MM_VerboseEvent * volatile _eventChainTail;
53
54
bool _disposable; /**< Determines if the event stream should be disposed of immediately after processing. */
55
56
void callConsumeRoutines(MM_EnvironmentBase *env);
57
void removeNonOutputEvents(MM_EnvironmentBase *env);
58
59
void removeEventFromChain(MM_EnvironmentBase *env, MM_VerboseEvent *event);
60
61
void tearDown(MM_EnvironmentBase *env);
62
63
public:
64
static MM_VerboseEventStream *newInstance(MM_EnvironmentBase *env, MM_VerboseManagerOld *manager);
65
virtual void kill(MM_EnvironmentBase *env);
66
67
MMINLINE MM_VerboseEvent *getHead() { return _eventChain; }
68
MMINLINE MM_VerboseEvent *getTail() { return (MM_VerboseEvent *)_eventChainTail; }
69
70
void chainEvent(MM_EnvironmentBase *env, MM_VerboseEvent *event);
71
void processStream(MM_EnvironmentBase *env);
72
73
MM_VerboseEvent *returnEvent(UDATA eventid, J9HookInterface** hook, MM_VerboseEvent *event);
74
MM_VerboseEvent *returnEvent(UDATA eventid, J9HookInterface** hook, MM_VerboseEvent *event, UDATA stopEventID, J9HookInterface** stopHookInterface);
75
76
void setDisposable(bool disposable) { _disposable = disposable; }
77
bool isDisposable() { return _disposable; }
78
79
MM_VerboseEventStream(MM_EnvironmentBase *env, MM_VerboseManagerOld *manager) :
80
MM_Base(),
81
_javaVM((J9JavaVM *)env->getLanguageVM()),
82
_manager(manager),
83
_eventChain(NULL),
84
_eventChainTail(NULL),
85
_disposable(false)
86
{}
87
};
88
89
#endif /* EVENTSTREAM_HPP_ */
90
91