author | stefank |
Fri, 04 May 2018 11:41:35 +0200 | |
changeset 49982 | 9042ffe5b7fe |
parent 49392 | 2956d0ece7a9 |
child 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
18025 | 1 |
/* |
49392
2956d0ece7a9
8199282: Remove ValueObj class for allocation subclassing for gc code
coleenp
parents:
47885
diff
changeset
|
2 |
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. |
18025 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
30764 | 25 |
#ifndef SHARE_VM_GC_SHARED_GCTRACE_HPP |
26 |
#define SHARE_VM_GC_SHARED_GCTRACE_HPP |
|
18025 | 27 |
|
30764 | 28 |
#include "gc/shared/copyFailedInfo.hpp" |
29 |
#include "gc/shared/gcCause.hpp" |
|
30 |
#include "gc/shared/gcId.hpp" |
|
31 |
#include "gc/shared/gcName.hpp" |
|
32 |
#include "gc/shared/gcWhen.hpp" |
|
23470
ff2a7ea4225d
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
21767
diff
changeset
|
33 |
#include "memory/metaspace.hpp" |
18025 | 34 |
#include "memory/referenceType.hpp" |
27684
e0391b2bf625
8064581: Move INCLUDE_ALL_GCS include section to the end of the include list
stefank
parents:
25350
diff
changeset
|
35 |
#include "utilities/macros.hpp" |
e0391b2bf625
8064581: Move INCLUDE_ALL_GCS include section to the end of the include list
stefank
parents:
25350
diff
changeset
|
36 |
#include "utilities/ticks.hpp" |
49982 | 37 |
#if INCLUDE_G1GC |
30764 | 38 |
#include "gc/g1/g1YCTypes.hpp" |
18025 | 39 |
#endif |
40 |
||
41 |
class EvacuationInfo; |
|
42 |
class GCHeapSummary; |
|
23470
ff2a7ea4225d
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
21767
diff
changeset
|
43 |
class MetaspaceChunkFreeListSummary; |
18025 | 44 |
class MetaspaceSummary; |
45 |
class PSHeapSummary; |
|
31344
2316eb7a0358
8025608: GC trace events missing nursery size information
david
parents:
30764
diff
changeset
|
46 |
class G1HeapSummary; |
32380
1dcdb686f0cb
8133530: Add JFR event for evacuation statistics
tschatzl
parents:
31619
diff
changeset
|
47 |
class G1EvacSummary; |
18025 | 48 |
class ReferenceProcessorStats; |
49 |
class TimePartitions; |
|
50 |
class BoolObjectClosure; |
|
51 |
||
49392
2956d0ece7a9
8199282: Remove ValueObj class for allocation subclassing for gc code
coleenp
parents:
47885
diff
changeset
|
52 |
class SharedGCInfo { |
18025 | 53 |
private: |
54 |
GCName _name; |
|
55 |
GCCause::Cause _cause; |
|
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
56 |
Ticks _start_timestamp; |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
57 |
Ticks _end_timestamp; |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
58 |
Tickspan _sum_of_pauses; |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
59 |
Tickspan _longest_pause; |
18025 | 60 |
|
61 |
public: |
|
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
62 |
SharedGCInfo(GCName name) : |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
63 |
_name(name), |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
64 |
_cause(GCCause::_last_gc_cause), |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
65 |
_start_timestamp(), |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
66 |
_end_timestamp(), |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
67 |
_sum_of_pauses(), |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
68 |
_longest_pause() { |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
69 |
} |
18025 | 70 |
|
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
71 |
void set_start_timestamp(const Ticks& timestamp) { _start_timestamp = timestamp; } |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
72 |
const Ticks start_timestamp() const { return _start_timestamp; } |
18025 | 73 |
|
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
74 |
void set_end_timestamp(const Ticks& timestamp) { _end_timestamp = timestamp; } |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
75 |
const Ticks end_timestamp() const { return _end_timestamp; } |
18025 | 76 |
|
77 |
void set_name(GCName name) { _name = name; } |
|
78 |
GCName name() const { return _name; } |
|
79 |
||
80 |
void set_cause(GCCause::Cause cause) { _cause = cause; } |
|
81 |
GCCause::Cause cause() const { return _cause; } |
|
82 |
||
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
83 |
void set_sum_of_pauses(const Tickspan& duration) { _sum_of_pauses = duration; } |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
84 |
const Tickspan sum_of_pauses() const { return _sum_of_pauses; } |
18025 | 85 |
|
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
86 |
void set_longest_pause(const Tickspan& duration) { _longest_pause = duration; } |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
87 |
const Tickspan longest_pause() const { return _longest_pause; } |
18025 | 88 |
}; |
89 |
||
49392
2956d0ece7a9
8199282: Remove ValueObj class for allocation subclassing for gc code
coleenp
parents:
47885
diff
changeset
|
90 |
class ParallelOldGCInfo { |
18025 | 91 |
void* _dense_prefix; |
92 |
public: |
|
93 |
ParallelOldGCInfo() : _dense_prefix(NULL) {} |
|
94 |
void report_dense_prefix(void* addr) { |
|
95 |
_dense_prefix = addr; |
|
96 |
} |
|
97 |
void* dense_prefix() const { return _dense_prefix; } |
|
98 |
}; |
|
99 |
||
49982 | 100 |
#if INCLUDE_G1GC |
18025 | 101 |
|
49392
2956d0ece7a9
8199282: Remove ValueObj class for allocation subclassing for gc code
coleenp
parents:
47885
diff
changeset
|
102 |
class G1YoungGCInfo { |
18025 | 103 |
G1YCType _type; |
104 |
public: |
|
105 |
G1YoungGCInfo() : _type(G1YCTypeEndSentinel) {} |
|
106 |
void set_type(G1YCType type) { |
|
107 |
_type = type; |
|
108 |
} |
|
109 |
G1YCType type() const { return _type; } |
|
110 |
}; |
|
111 |
||
49982 | 112 |
#endif // INCLUDE_G1GC |
18025 | 113 |
|
114 |
class GCTracer : public ResourceObj { |
|
115 |
protected: |
|
116 |
SharedGCInfo _shared_gc_info; |
|
117 |
||
118 |
public: |
|
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
119 |
void report_gc_start(GCCause::Cause cause, const Ticks& timestamp); |
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
120 |
void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions); |
23470
ff2a7ea4225d
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
21767
diff
changeset
|
121 |
void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const; |
ff2a7ea4225d
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
21767
diff
changeset
|
122 |
void report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& metaspace_summary) const; |
18025 | 123 |
void report_gc_reference_stats(const ReferenceProcessorStats& rp) const; |
124 |
void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN; |
|
125 |
||
126 |
protected: |
|
127 |
GCTracer(GCName name) : _shared_gc_info(name) {} |
|
37137
62fd3fb4b1b1
8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents:
34300
diff
changeset
|
128 |
virtual void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp); |
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
129 |
virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions); |
18025 | 130 |
|
131 |
private: |
|
132 |
void send_garbage_collection_event() const; |
|
133 |
void send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const; |
|
134 |
void send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const; |
|
23470
ff2a7ea4225d
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
21767
diff
changeset
|
135 |
void send_metaspace_chunk_free_list_summary(GCWhen::Type when, Metaspace::MetadataType mdtype, const MetaspaceChunkFreeListSummary& summary) const; |
18025 | 136 |
void send_reference_stats_event(ReferenceType type, size_t count) const; |
137 |
void send_phase_events(TimePartitions* time_partitions) const; |
|
138 |
}; |
|
139 |
||
140 |
class YoungGCTracer : public GCTracer { |
|
141 |
static const uint UNSET_TENURING_THRESHOLD = (uint) -1; |
|
142 |
||
143 |
uint _tenuring_threshold; |
|
144 |
||
145 |
protected: |
|
146 |
YoungGCTracer(GCName name) : GCTracer(name), _tenuring_threshold(UNSET_TENURING_THRESHOLD) {} |
|
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
147 |
virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions); |
18025 | 148 |
|
149 |
public: |
|
28940
c314cf1db3fa
8066566: Refactor ParNewGeneration to contain ParNewTracer
mlarsson
parents:
28024
diff
changeset
|
150 |
void report_promotion_failed(const PromotionFailedInfo& pf_info) const; |
18025 | 151 |
void report_tenuring_threshold(const uint tenuring_threshold); |
152 |
||
28024 | 153 |
/* |
154 |
* Methods for reporting Promotion in new or outside PLAB Events. |
|
155 |
* |
|
156 |
* The object age is always required as it is not certain that the mark word |
|
157 |
* of the oop can be trusted at this stage. |
|
158 |
* |
|
159 |
* obj_size is the size of the promoted object in bytes. |
|
160 |
* |
|
161 |
* tenured should be true if the object has been promoted to the old |
|
162 |
* space during this GC, if the object is copied to survivor space |
|
163 |
* from young space or survivor space (aging) tenured should be false. |
|
164 |
* |
|
165 |
* plab_size is the size of the newly allocated PLAB in bytes. |
|
166 |
*/ |
|
32608 | 167 |
bool should_report_promotion_events() const; |
28024 | 168 |
bool should_report_promotion_in_new_plab_event() const; |
169 |
bool should_report_promotion_outside_plab_event() const; |
|
170 |
void report_promotion_in_new_plab_event(Klass* klass, size_t obj_size, |
|
171 |
uint age, bool tenured, |
|
172 |
size_t plab_size) const; |
|
173 |
void report_promotion_outside_plab_event(Klass* klass, size_t obj_size, |
|
174 |
uint age, bool tenured) const; |
|
175 |
||
18025 | 176 |
private: |
177 |
void send_young_gc_event() const; |
|
178 |
void send_promotion_failed_event(const PromotionFailedInfo& pf_info) const; |
|
28024 | 179 |
bool should_send_promotion_in_new_plab_event() const; |
180 |
bool should_send_promotion_outside_plab_event() const; |
|
181 |
void send_promotion_in_new_plab_event(Klass* klass, size_t obj_size, |
|
182 |
uint age, bool tenured, |
|
183 |
size_t plab_size) const; |
|
184 |
void send_promotion_outside_plab_event(Klass* klass, size_t obj_size, |
|
185 |
uint age, bool tenured) const; |
|
18025 | 186 |
}; |
187 |
||
188 |
class OldGCTracer : public GCTracer { |
|
189 |
protected: |
|
190 |
OldGCTracer(GCName name) : GCTracer(name) {} |
|
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
191 |
virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions); |
18025 | 192 |
|
193 |
public: |
|
194 |
void report_concurrent_mode_failure(); |
|
195 |
||
196 |
private: |
|
197 |
void send_old_gc_event() const; |
|
198 |
void send_concurrent_mode_failure_event(); |
|
199 |
}; |
|
200 |
||
201 |
class ParallelOldTracer : public OldGCTracer { |
|
202 |
ParallelOldGCInfo _parallel_old_gc_info; |
|
203 |
||
204 |
public: |
|
205 |
ParallelOldTracer() : OldGCTracer(ParallelOld) {} |
|
206 |
void report_dense_prefix(void* dense_prefix); |
|
207 |
||
208 |
protected: |
|
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
209 |
void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions); |
18025 | 210 |
|
211 |
private: |
|
212 |
void send_parallel_old_event() const; |
|
213 |
}; |
|
214 |
||
215 |
class SerialOldTracer : public OldGCTracer { |
|
216 |
public: |
|
217 |
SerialOldTracer() : OldGCTracer(SerialOld) {} |
|
218 |
}; |
|
219 |
||
220 |
class ParallelScavengeTracer : public YoungGCTracer { |
|
221 |
public: |
|
222 |
ParallelScavengeTracer() : YoungGCTracer(ParallelScavenge) {} |
|
223 |
}; |
|
224 |
||
225 |
class DefNewTracer : public YoungGCTracer { |
|
226 |
public: |
|
227 |
DefNewTracer() : YoungGCTracer(DefNew) {} |
|
228 |
}; |
|
229 |
||
230 |
class ParNewTracer : public YoungGCTracer { |
|
231 |
public: |
|
232 |
ParNewTracer() : YoungGCTracer(ParNew) {} |
|
233 |
}; |
|
234 |
||
49982 | 235 |
#if INCLUDE_G1GC |
31619 | 236 |
class G1MMUTracer : public AllStatic { |
41076
8c6aa0873dd1
8165455: Tracing events for G1 have incorrect metadata
ehelin
parents:
37137
diff
changeset
|
237 |
static void send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms); |
31619 | 238 |
|
239 |
public: |
|
41076
8c6aa0873dd1
8165455: Tracing events for G1 have incorrect metadata
ehelin
parents:
37137
diff
changeset
|
240 |
static void report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec); |
31619 | 241 |
}; |
242 |
||
18025 | 243 |
class G1NewTracer : public YoungGCTracer { |
244 |
G1YoungGCInfo _g1_young_gc_info; |
|
245 |
||
246 |
public: |
|
247 |
G1NewTracer() : YoungGCTracer(G1New) {} |
|
248 |
||
249 |
void report_yc_type(G1YCType type); |
|
21767
41eaa9a17059
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
18704
diff
changeset
|
250 |
void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions); |
18025 | 251 |
void report_evacuation_info(EvacuationInfo* info); |
252 |
void report_evacuation_failed(EvacuationFailedInfo& ef_info); |
|
253 |
||
32380
1dcdb686f0cb
8133530: Add JFR event for evacuation statistics
tschatzl
parents:
31619
diff
changeset
|
254 |
void report_evacuation_statistics(const G1EvacSummary& young_summary, const G1EvacSummary& old_summary) const; |
34300 | 255 |
|
256 |
void report_basic_ihop_statistics(size_t threshold, |
|
257 |
size_t target_occupancy, |
|
258 |
size_t current_occupancy, |
|
259 |
size_t last_allocation_size, |
|
260 |
double last_allocation_duration, |
|
261 |
double last_marking_length); |
|
262 |
void report_adaptive_ihop_statistics(size_t threshold, |
|
263 |
size_t internal_target_occupancy, |
|
264 |
size_t current_occupancy, |
|
265 |
size_t additional_buffer_size, |
|
266 |
double predicted_allocation_rate, |
|
267 |
double predicted_marking_length, |
|
268 |
bool prediction_active); |
|
18025 | 269 |
private: |
270 |
void send_g1_young_gc_event(); |
|
271 |
void send_evacuation_info_event(EvacuationInfo* info); |
|
272 |
void send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const; |
|
32380
1dcdb686f0cb
8133530: Add JFR event for evacuation statistics
tschatzl
parents:
31619
diff
changeset
|
273 |
|
1dcdb686f0cb
8133530: Add JFR event for evacuation statistics
tschatzl
parents:
31619
diff
changeset
|
274 |
void send_young_evacuation_statistics(const G1EvacSummary& summary) const; |
1dcdb686f0cb
8133530: Add JFR event for evacuation statistics
tschatzl
parents:
31619
diff
changeset
|
275 |
void send_old_evacuation_statistics(const G1EvacSummary& summary) const; |
34300 | 276 |
|
277 |
void send_basic_ihop_statistics(size_t threshold, |
|
278 |
size_t target_occupancy, |
|
279 |
size_t current_occupancy, |
|
280 |
size_t last_allocation_size, |
|
281 |
double last_allocation_duration, |
|
282 |
double last_marking_length); |
|
283 |
void send_adaptive_ihop_statistics(size_t threshold, |
|
284 |
size_t internal_target_occupancy, |
|
285 |
size_t current_occupancy, |
|
286 |
size_t additional_buffer_size, |
|
287 |
double predicted_allocation_rate, |
|
288 |
double predicted_marking_length, |
|
289 |
bool prediction_active); |
|
18025 | 290 |
}; |
47885
5caa1d5f74c1
8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents:
47216
diff
changeset
|
291 |
|
5caa1d5f74c1
8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents:
47216
diff
changeset
|
292 |
class G1FullGCTracer : public OldGCTracer { |
5caa1d5f74c1
8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents:
47216
diff
changeset
|
293 |
public: |
5caa1d5f74c1
8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents:
47216
diff
changeset
|
294 |
G1FullGCTracer() : OldGCTracer(G1Full) {} |
5caa1d5f74c1
8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents:
47216
diff
changeset
|
295 |
}; |
5caa1d5f74c1
8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents:
47216
diff
changeset
|
296 |
|
49982 | 297 |
#endif // INCLUDE_G1GC |
18025 | 298 |
|
299 |
class CMSTracer : public OldGCTracer { |
|
300 |
public: |
|
301 |
CMSTracer() : OldGCTracer(ConcurrentMarkSweep) {} |
|
302 |
}; |
|
303 |
||
304 |
class G1OldTracer : public OldGCTracer { |
|
37137
62fd3fb4b1b1
8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents:
34300
diff
changeset
|
305 |
protected: |
62fd3fb4b1b1
8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents:
34300
diff
changeset
|
306 |
void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp); |
18025 | 307 |
public: |
308 |
G1OldTracer() : OldGCTracer(G1Old) {} |
|
37137
62fd3fb4b1b1
8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents:
34300
diff
changeset
|
309 |
void set_gc_cause(GCCause::Cause cause); |
18025 | 310 |
}; |
311 |
||
30764 | 312 |
#endif // SHARE_VM_GC_SHARED_GCTRACE_HPP |