Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_stats/VLHGCIncrementStats.hpp
5986 views
1
2
/*******************************************************************************
3
* Copyright (c) 1991, 2020 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
/**
25
* @file
26
* @ingroup GC_Stats
27
*/
28
29
#if !defined(VLHGC_INCREMENT_STATS_HPP_)
30
#define VLHGC_INCREMENT_STATS_HPP_
31
32
#include "j9.h"
33
#include "j9cfg.h"
34
#include "j9port.h"
35
#include "j9consts.h"
36
#include "modronopt.h"
37
38
#if defined(J9VM_GC_VLHGC)
39
40
#include "Base.hpp"
41
#include "ClassUnloadStats.hpp"
42
#if defined(J9VM_GC_MODRON_COMPACTION)
43
#include "CompactVLHGCStats.hpp"
44
#endif /* J9VM_GC_MODRON_COMPACTION */
45
#include "CopyForwardStats.hpp"
46
#include "InterRegionRememberedSetStats.hpp"
47
#include "MarkVLHGCStats.hpp"
48
#include "SweepVLHGCStats.hpp"
49
#include "WorkPacketStats.hpp"
50
51
/**
52
* Storage for statistics relevant to the sweep phase of global collection
53
* @ingroup GC_Stats
54
*/
55
class MM_VLHGCIncrementStats : public MM_Base
56
{
57
public:
58
class MM_MarkVLHGCStats _markStats; /**< Stats for mark phase of increment */
59
class MM_SweepVLHGCStats _sweepStats; /**< Stats for sweep phase of increment */
60
#if defined(J9VM_GC_MODRON_COMPACTION)
61
class MM_CompactVLHGCStats _compactStats; /**< Stats for compact phase of increment */
62
#endif /* J9VM_GC_MODRON_COMPACTION */
63
class MM_WorkPacketStats _workPacketStats; /**< Stats for work packet activity of increment */
64
class MM_CopyForwardStats _copyForwardStats; /**< Stats for copy forward phase of increment */
65
class MM_ClassUnloadStats _classUnloadStats; /**< Stats for class unload operations of the increment */
66
class MM_InterRegionRememberedSetStats _irrsStats; /**< Stats for Inter Region Remembered Set processing */
67
68
enum GlobalMarkIncrementType {
69
mark_idle = 0, /**< No Global marking in progress */
70
mark_concurrent = 1, /**< Global marking is being performed concurrently with mutator */
71
mark_incremental = 2, /**< Global marking is being performed non-concurrently in stop-the-world increments */
72
mark_global_collection = 3, /** Global marking is being performed as part of a global collection */
73
} _globalMarkIncrementType;
74
75
public:
76
MM_VLHGCIncrementStats() :
77
_markStats()
78
,_sweepStats()
79
#if defined(J9VM_GC_MODRON_COMPACTION)
80
,_compactStats()
81
#endif /* J9VM_GC_MODRON_COMPACTION */
82
,_workPacketStats()
83
,_copyForwardStats()
84
,_classUnloadStats()
85
,_irrsStats()
86
,_globalMarkIncrementType(MM_VLHGCIncrementStats::mark_idle)
87
{};
88
89
/**
90
* Reset the statistics of the receiver for a new round.
91
*/
92
MMINLINE void clear()
93
{
94
_markStats.clear();
95
_sweepStats.clear();
96
#if defined(J9VM_GC_MODRON_COMPACTION)
97
_compactStats.clear();
98
#endif /* J9VM_GC_MODRON_COMPACTION */
99
_workPacketStats.clear();
100
_copyForwardStats.clear();
101
_classUnloadStats.clear();
102
_irrsStats.clear();
103
_globalMarkIncrementType = MM_VLHGCIncrementStats::mark_idle;
104
}
105
106
/**
107
* Add / combine the statistics from the parameter to the receiver.
108
*/
109
MMINLINE void merge(MM_VLHGCIncrementStats *stats)
110
{
111
_markStats.merge(&stats->_markStats);
112
_sweepStats.merge(&stats->_sweepStats);
113
#if defined(J9VM_GC_MODRON_COMPACTION)
114
_compactStats.merge(&stats->_compactStats);
115
#endif /* J9VM_GC_MODRON_COMPACTION */
116
_workPacketStats.merge(&stats->_workPacketStats);
117
_copyForwardStats.merge(&stats->_copyForwardStats);
118
_irrsStats.merge(&stats->_irrsStats);
119
}
120
121
/**
122
* Get total stall time
123
*/
124
uint64_t getTotalStallTime()
125
{
126
return _copyForwardStats.getStallTime() + _markStats.getStallTime() + _sweepStats.idleTime + _workPacketStats.getStallTime() + _compactStats._moveStallTime + _compactStats._rebuildStallTime;
127
}
128
};
129
130
#endif /* J9VM_GC_VLHGC */
131
#endif /* VLHGC_INCREMENT_STATS_HPP_ */
132
133