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
25 #include "precompiled.hpp"
26 #include "gc_implementation/shared/copyFailedInfo.hpp"
27 #include "gc_implementation/shared/gcHeapSummary.hpp"
28 #include "gc_implementation/shared/gcId.hpp"
29 #include "gc_implementation/shared/gcTimer.hpp"
30 #include "gc_implementation/shared/gcTrace.hpp"
31 #include "gc_implementation/shared/objectCountEventSender.hpp"
32 #include "memory/heapInspection.hpp"
33 #include "memory/referenceProcessorStats.hpp"
34 #include "runtime/os.hpp"
35 #include "utilities/globalDefinitions.hpp"
36 #include "utilities/ticks.inline.hpp"
37
38 #if INCLUDE_ALL_GCS
39 #include "gc_implementation/g1/evacuationInfo.hpp"
40 #endif
41
42 #define assert_unset_gc_id() assert(_shared_gc_info.gc_id().is_undefined(), "GC already started?")
43 #define assert_set_gc_id() assert(!_shared_gc_info.gc_id().is_undefined(), "GC not started?")
44
45 void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
46 assert_unset_gc_id();
47
48 GCId gc_id = GCId::create();
49 _shared_gc_info.set_gc_id(gc_id);
50 _shared_gc_info.set_cause(cause);
51 _shared_gc_info.set_start_timestamp(timestamp);
52 }
53
54 void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) {
55 assert_unset_gc_id();
56
155 void YoungGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
156 assert_set_gc_id();
157 assert(_tenuring_threshold != UNSET_TENURING_THRESHOLD, "Tenuring threshold has not been reported");
158
159 GCTracer::report_gc_end_impl(timestamp, time_partitions);
160 send_young_gc_event();
161
162 _tenuring_threshold = UNSET_TENURING_THRESHOLD;
163 }
164
165 void YoungGCTracer::report_promotion_failed(const PromotionFailedInfo& pf_info) {
166 assert_set_gc_id();
167
168 send_promotion_failed_event(pf_info);
169 }
170
171 void YoungGCTracer::report_tenuring_threshold(const uint tenuring_threshold) {
172 _tenuring_threshold = tenuring_threshold;
173 }
174
175 void OldGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
176 assert_set_gc_id();
177
178 GCTracer::report_gc_end_impl(timestamp, time_partitions);
179 send_old_gc_event();
180 }
181
182 void ParallelOldTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
183 assert_set_gc_id();
184
185 OldGCTracer::report_gc_end_impl(timestamp, time_partitions);
186 send_parallel_old_event();
187 }
188
189 void ParallelOldTracer::report_dense_prefix(void* dense_prefix) {
190 assert_set_gc_id();
191
192 _parallel_old_gc_info.report_dense_prefix(dense_prefix);
193 }
194
195 void OldGCTracer::report_concurrent_mode_failure() {
196 assert_set_gc_id();
197
198 send_concurrent_mode_failure_event();
199 }
200
201 #if INCLUDE_ALL_GCS
202 void G1NewTracer::report_yc_type(G1YCType type) {
203 assert_set_gc_id();
204
205 _g1_young_gc_info.set_type(type);
206 }
207
208 void G1NewTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
209 assert_set_gc_id();
210
211 YoungGCTracer::report_gc_end_impl(timestamp, time_partitions);
212 send_g1_young_gc_event();
213 }
214
215 void G1NewTracer::report_evacuation_info(EvacuationInfo* info) {
216 assert_set_gc_id();
217
218 send_evacuation_info_event(info);
219 }
220
221 void G1NewTracer::report_evacuation_failed(EvacuationFailedInfo& ef_info) {
|
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
25 #include "precompiled.hpp"
26 #include "gc_implementation/shared/copyFailedInfo.hpp"
27 #include "gc_implementation/shared/gcHeapSummary.hpp"
28 #include "gc_implementation/shared/gcId.hpp"
29 #include "gc_implementation/shared/gcTimer.hpp"
30 #include "gc_implementation/shared/gcTrace.hpp"
31 #include "gc_implementation/shared/objectCountEventSender.hpp"
32 #include "memory/heapInspection.hpp"
33 #include "memory/referenceProcessorStats.hpp"
34 #include "runtime/os.hpp"
35 #include "utilities/globalDefinitions.hpp"
36 #include "utilities/ticks.hpp"
37
38 #if INCLUDE_ALL_GCS
39 #include "gc_implementation/g1/evacuationInfo.hpp"
40 #endif
41
42 #define assert_unset_gc_id() assert(_shared_gc_info.gc_id().is_undefined(), "GC already started?")
43 #define assert_set_gc_id() assert(!_shared_gc_info.gc_id().is_undefined(), "GC not started?")
44
45 void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
46 assert_unset_gc_id();
47
48 GCId gc_id = GCId::create();
49 _shared_gc_info.set_gc_id(gc_id);
50 _shared_gc_info.set_cause(cause);
51 _shared_gc_info.set_start_timestamp(timestamp);
52 }
53
54 void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) {
55 assert_unset_gc_id();
56
155 void YoungGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
156 assert_set_gc_id();
157 assert(_tenuring_threshold != UNSET_TENURING_THRESHOLD, "Tenuring threshold has not been reported");
158
159 GCTracer::report_gc_end_impl(timestamp, time_partitions);
160 send_young_gc_event();
161
162 _tenuring_threshold = UNSET_TENURING_THRESHOLD;
163 }
164
165 void YoungGCTracer::report_promotion_failed(const PromotionFailedInfo& pf_info) {
166 assert_set_gc_id();
167
168 send_promotion_failed_event(pf_info);
169 }
170
171 void YoungGCTracer::report_tenuring_threshold(const uint tenuring_threshold) {
172 _tenuring_threshold = tenuring_threshold;
173 }
174
175 bool YoungGCTracer::should_report_promotion_events() const {
176 return should_report_promotion_in_new_plab_event() ||
177 should_report_promotion_outside_plab_event();
178 }
179
180 bool YoungGCTracer::should_report_promotion_in_new_plab_event() const {
181 return should_send_promotion_in_new_plab_event();
182 }
183
184 bool YoungGCTracer::should_report_promotion_outside_plab_event() const {
185 return should_send_promotion_outside_plab_event();
186 }
187
188 void YoungGCTracer::report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
189 uint age, bool tenured,
190 size_t plab_size) const {
191 send_promotion_in_new_plab_event(klass, obj_size, age, tenured, plab_size);
192 }
193
194 void YoungGCTracer::report_promotion_outside_plab_event(Klass* klass, size_t obj_size,
195 uint age, bool tenured) const {
196 send_promotion_outside_plab_event(klass, obj_size, age, tenured);
197 }
198
199 void OldGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
200 assert_set_gc_id();
201
202 GCTracer::report_gc_end_impl(timestamp, time_partitions);
203 send_old_gc_event();
204 }
205
206 void ParallelOldTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
207 assert_set_gc_id();
208
209 OldGCTracer::report_gc_end_impl(timestamp, time_partitions);
210 send_parallel_old_event();
211 }
212
213 void ParallelOldTracer::report_dense_prefix(void* dense_prefix) {
214 assert_set_gc_id();
215
216 _parallel_old_gc_info.report_dense_prefix(dense_prefix);
217 }
218
219 void OldGCTracer::report_concurrent_mode_failure() {
220 assert_set_gc_id();
221
222 send_concurrent_mode_failure_event();
223 }
224
225 #if INCLUDE_ALL_GCS
226 void G1MMUTracer::report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec) {
227 send_g1_mmu_event(time_slice_sec * MILLIUNITS,
228 gc_time_sec * MILLIUNITS,
229 max_time_sec * MILLIUNITS);
230 }
231
232 void G1NewTracer::report_yc_type(G1YCType type) {
233 assert_set_gc_id();
234
235 _g1_young_gc_info.set_type(type);
236 }
237
238 void G1NewTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
239 assert_set_gc_id();
240
241 YoungGCTracer::report_gc_end_impl(timestamp, time_partitions);
242 send_g1_young_gc_event();
243 }
244
245 void G1NewTracer::report_evacuation_info(EvacuationInfo* info) {
246 assert_set_gc_id();
247
248 send_evacuation_info_event(info);
249 }
250
251 void G1NewTracer::report_evacuation_failed(EvacuationFailedInfo& ef_info) {
|