8230431: Move G1 trace code from gcTrace* to G1 directory
authorsjohanss
Wed, 04 Sep 2019 09:47:51 +0200
changeset 58002 01d31583f25c
parent 58001 0437b0f20312
child 58003 a645b2f7bece
8230431: Move G1 trace code from gcTrace* to G1 directory Reviewed-by: kbarrett, lkorinth
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp
src/hotspot/share/gc/g1/g1FullGCScope.hpp
src/hotspot/share/gc/g1/g1IHOPControl.cpp
src/hotspot/share/gc/g1/g1MMUTracker.cpp
src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
src/hotspot/share/gc/g1/g1Trace.cpp
src/hotspot/share/gc/g1/g1Trace.hpp
src/hotspot/share/gc/shared/gcTrace.cpp
src/hotspot/share/gc/shared/gcTrace.hpp
src/hotspot/share/gc/shared/gcTraceSend.cpp
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Tue Sep 03 17:52:36 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Wed Sep 04 09:47:51 2019 +0200
@@ -59,6 +59,7 @@
 #include "gc/g1/g1SATBMarkQueueSet.hpp"
 #include "gc/g1/g1StringDedup.hpp"
 #include "gc/g1/g1ThreadLocalData.hpp"
+#include "gc/g1/g1Trace.hpp"
 #include "gc/g1/g1YCTypes.hpp"
 #include "gc/g1/g1YoungRemSetSamplingThread.hpp"
 #include "gc/g1/g1VMOperations.hpp"
@@ -70,7 +71,6 @@
 #include "gc/shared/gcId.hpp"
 #include "gc/shared/gcLocker.hpp"
 #include "gc/shared/gcTimer.hpp"
-#include "gc/shared/gcTrace.hpp"
 #include "gc/shared/gcTraceTime.inline.hpp"
 #include "gc/shared/generationSpec.hpp"
 #include "gc/shared/isGCActiveMark.hpp"
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Tue Sep 03 17:52:36 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Wed Sep 04 09:47:51 2019 +0200
@@ -37,12 +37,12 @@
 #include "gc/g1/g1RegionMarkStatsCache.inline.hpp"
 #include "gc/g1/g1StringDedup.hpp"
 #include "gc/g1/g1ThreadLocalData.hpp"
+#include "gc/g1/g1Trace.hpp"
 #include "gc/g1/heapRegion.inline.hpp"
 #include "gc/g1/heapRegionRemSet.hpp"
 #include "gc/g1/heapRegionSet.inline.hpp"
 #include "gc/shared/gcId.hpp"
 #include "gc/shared/gcTimer.hpp"
-#include "gc/shared/gcTrace.hpp"
 #include "gc/shared/gcTraceTime.inline.hpp"
 #include "gc/shared/gcVMOperations.hpp"
 #include "gc/shared/genOopClosures.inline.hpp"
--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp	Tue Sep 03 17:52:36 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp	Wed Sep 04 09:47:51 2019 +0200
@@ -31,10 +31,10 @@
 #include "gc/g1/g1MMUTracker.hpp"
 #include "gc/g1/g1Policy.hpp"
 #include "gc/g1/g1RemSet.hpp"
+#include "gc/g1/g1Trace.hpp"
 #include "gc/g1/g1VMOperations.hpp"
 #include "gc/shared/concurrentGCPhaseManager.hpp"
 #include "gc/shared/gcId.hpp"
-#include "gc/shared/gcTrace.hpp"
 #include "gc/shared/gcTraceTime.inline.hpp"
 #include "gc/shared/suspendibleThreadSet.hpp"
 #include "logging/log.hpp"
--- a/src/hotspot/share/gc/g1/g1FullGCScope.hpp	Tue Sep 03 17:52:36 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1FullGCScope.hpp	Wed Sep 04 09:47:51 2019 +0200
@@ -27,8 +27,8 @@
 
 #include "gc/g1/g1CollectedHeap.hpp"
 #include "gc/g1/g1HeapTransition.hpp"
+#include "gc/g1/g1Trace.hpp"
 #include "gc/shared/gcId.hpp"
-#include "gc/shared/gcTrace.hpp"
 #include "gc/shared/gcTraceTime.hpp"
 #include "gc/shared/gcTimer.hpp"
 #include "gc/shared/gcVMOperations.hpp"
--- a/src/hotspot/share/gc/g1/g1IHOPControl.cpp	Tue Sep 03 17:52:36 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1IHOPControl.cpp	Wed Sep 04 09:47:51 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 #include "gc/g1/g1CollectedHeap.inline.hpp"
 #include "gc/g1/g1IHOPControl.hpp"
 #include "gc/g1/g1Predictions.hpp"
-#include "gc/shared/gcTrace.hpp"
+#include "gc/g1/g1Trace.hpp"
 #include "logging/log.hpp"
 
 G1IHOPControl::G1IHOPControl(double initial_ihop_percent) :
--- a/src/hotspot/share/gc/g1/g1MMUTracker.cpp	Tue Sep 03 17:52:36 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1MMUTracker.cpp	Wed Sep 04 09:47:51 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/g1/g1MMUTracker.hpp"
-#include "gc/shared/gcTrace.hpp"
+#include "gc/g1/g1Trace.hpp"
 #include "logging/log.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/ostream.hpp"
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Tue Sep 03 17:52:36 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Wed Sep 04 09:47:51 2019 +0200
@@ -30,7 +30,7 @@
 #include "gc/g1/g1ParScanThreadState.inline.hpp"
 #include "gc/g1/g1RootClosures.hpp"
 #include "gc/g1/g1StringDedup.hpp"
-#include "gc/shared/gcTrace.hpp"
+#include "gc/g1/g1Trace.hpp"
 #include "gc/shared/taskqueue.inline.hpp"
 #include "memory/allocation.inline.hpp"
 #include "oops/access.inline.hpp"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1Trace.cpp	Wed Sep 04 09:47:51 2019 +0200
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/g1/g1EvacuationInfo.hpp"
+#include "gc/g1/g1Trace.hpp"
+#include "gc/g1/g1YCTypes.hpp"
+#include "gc/shared/gcHeapSummary.hpp"
+#include "jfr/jfrEvents.hpp"
+
+void G1NewTracer::report_yc_type(G1YCType type) {
+  _g1_young_gc_info.set_type(type);
+}
+
+void G1NewTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
+  YoungGCTracer::report_gc_end_impl(timestamp, time_partitions);
+  send_g1_young_gc_event();
+}
+
+void G1NewTracer::report_evacuation_info(G1EvacuationInfo* info) {
+  send_evacuation_info_event(info);
+}
+
+void G1NewTracer::report_evacuation_failed(EvacuationFailedInfo& ef_info) {
+  send_evacuation_failed_event(ef_info);
+  ef_info.reset();
+}
+
+void G1NewTracer::report_evacuation_statistics(const G1EvacSummary& young_summary, const G1EvacSummary& old_summary) const {
+  send_young_evacuation_statistics(young_summary);
+  send_old_evacuation_statistics(old_summary);
+}
+
+void G1NewTracer::report_basic_ihop_statistics(size_t threshold,
+                                               size_t target_ccupancy,
+                                               size_t current_occupancy,
+                                               size_t last_allocation_size,
+                                               double last_allocation_duration,
+                                               double last_marking_length) {
+  send_basic_ihop_statistics(threshold,
+                             target_ccupancy,
+                             current_occupancy,
+                             last_allocation_size,
+                             last_allocation_duration,
+                             last_marking_length);
+}
+
+void G1NewTracer::report_adaptive_ihop_statistics(size_t threshold,
+                                                  size_t internal_target_occupancy,
+                                                  size_t current_occupancy,
+                                                  size_t additional_buffer_size,
+                                                  double predicted_allocation_rate,
+                                                  double predicted_marking_length,
+                                                  bool prediction_active) {
+  send_adaptive_ihop_statistics(threshold,
+                                internal_target_occupancy,
+                                additional_buffer_size,
+                                current_occupancy,
+                                predicted_allocation_rate,
+                                predicted_marking_length,
+                                prediction_active);
+}
+
+void G1NewTracer::send_g1_young_gc_event() {
+  EventG1GarbageCollection e(UNTIMED);
+  if (e.should_commit()) {
+    e.set_gcId(GCId::current());
+    e.set_type(_g1_young_gc_info.type());
+    e.set_starttime(_shared_gc_info.start_timestamp());
+    e.set_endtime(_shared_gc_info.end_timestamp());
+    e.commit();
+  }
+}
+
+void G1NewTracer::send_evacuation_info_event(G1EvacuationInfo* info) {
+  EventEvacuationInformation e;
+  if (e.should_commit()) {
+    e.set_gcId(GCId::current());
+    e.set_cSetRegions(info->collectionset_regions());
+    e.set_cSetUsedBefore(info->collectionset_used_before());
+    e.set_cSetUsedAfter(info->collectionset_used_after());
+    e.set_allocationRegions(info->allocation_regions());
+    e.set_allocationRegionsUsedBefore(info->alloc_regions_used_before());
+    e.set_allocationRegionsUsedAfter(info->alloc_regions_used_before() + info->bytes_copied());
+    e.set_bytesCopied(info->bytes_copied());
+    e.set_regionsFreed(info->regions_freed());
+    e.commit();
+  }
+}
+
+void G1NewTracer::send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const {
+  EventEvacuationFailed e;
+  if (e.should_commit()) {
+    // Create JFR structured failure data
+    JfrStructCopyFailed evac_failed;
+    evac_failed.set_objectCount(ef_info.failed_count());
+    evac_failed.set_firstSize(ef_info.first_size());
+    evac_failed.set_smallestSize(ef_info.smallest_size());
+    evac_failed.set_totalSize(ef_info.total_size());
+    // Add to the event
+    e.set_gcId(GCId::current());
+    e.set_evacuationFailed(evac_failed);
+    e.commit();
+  }
+}
+
+static JfrStructG1EvacuationStatistics
+create_g1_evacstats(unsigned gcid, const G1EvacSummary& summary) {
+  JfrStructG1EvacuationStatistics s;
+  s.set_gcId(gcid);
+  s.set_allocated(summary.allocated() * HeapWordSize);
+  s.set_wasted(summary.wasted() * HeapWordSize);
+  s.set_used(summary.used() * HeapWordSize);
+  s.set_undoWaste(summary.undo_wasted() * HeapWordSize);
+  s.set_regionEndWaste(summary.region_end_waste() * HeapWordSize);
+  s.set_regionsRefilled(summary.regions_filled());
+  s.set_directAllocated(summary.direct_allocated() * HeapWordSize);
+  s.set_failureUsed(summary.failure_used() * HeapWordSize);
+  s.set_failureWaste(summary.failure_waste() * HeapWordSize);
+  return s;
+}
+
+void G1NewTracer::send_young_evacuation_statistics(const G1EvacSummary& summary) const {
+  EventG1EvacuationYoungStatistics surv_evt;
+  if (surv_evt.should_commit()) {
+    surv_evt.set_statistics(create_g1_evacstats(GCId::current(), summary));
+    surv_evt.commit();
+  }
+}
+
+void G1NewTracer::send_old_evacuation_statistics(const G1EvacSummary& summary) const {
+  EventG1EvacuationOldStatistics old_evt;
+  if (old_evt.should_commit()) {
+    old_evt.set_statistics(create_g1_evacstats(GCId::current(), summary));
+    old_evt.commit();
+  }
+}
+
+void G1NewTracer::send_basic_ihop_statistics(size_t threshold,
+                                             size_t target_occupancy,
+                                             size_t current_occupancy,
+                                             size_t last_allocation_size,
+                                             double last_allocation_duration,
+                                             double last_marking_length) {
+  EventG1BasicIHOP evt;
+  if (evt.should_commit()) {
+    evt.set_gcId(GCId::current());
+    evt.set_threshold(threshold);
+    evt.set_targetOccupancy(target_occupancy);
+    evt.set_thresholdPercentage(target_occupancy > 0 ? ((double)threshold / target_occupancy) : 0.0);
+    evt.set_currentOccupancy(current_occupancy);
+    evt.set_recentMutatorAllocationSize(last_allocation_size);
+    evt.set_recentMutatorDuration(last_allocation_duration * MILLIUNITS);
+    evt.set_recentAllocationRate(last_allocation_duration != 0.0 ? last_allocation_size / last_allocation_duration : 0.0);
+    evt.set_lastMarkingDuration(last_marking_length * MILLIUNITS);
+    evt.commit();
+  }
+}
+
+void G1NewTracer::send_adaptive_ihop_statistics(size_t threshold,
+                                                size_t internal_target_occupancy,
+                                                size_t current_occupancy,
+                                                size_t additional_buffer_size,
+                                                double predicted_allocation_rate,
+                                                double predicted_marking_length,
+                                                bool prediction_active) {
+  EventG1AdaptiveIHOP evt;
+  if (evt.should_commit()) {
+    evt.set_gcId(GCId::current());
+    evt.set_threshold(threshold);
+    evt.set_thresholdPercentage(internal_target_occupancy > 0 ? ((double)threshold / internal_target_occupancy) : 0.0);
+    evt.set_ihopTargetOccupancy(internal_target_occupancy);
+    evt.set_currentOccupancy(current_occupancy);
+    evt.set_additionalBufferSize(additional_buffer_size);
+    evt.set_predictedAllocationRate(predicted_allocation_rate);
+    evt.set_predictedMarkingDuration(predicted_marking_length * MILLIUNITS);
+    evt.set_predictionActive(prediction_active);
+    evt.commit();
+  }
+}
+
+void G1OldTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
+  _shared_gc_info.set_start_timestamp(timestamp);
+}
+
+void G1OldTracer::set_gc_cause(GCCause::Cause cause) {
+  _shared_gc_info.set_cause(cause);
+}
+
+void G1MMUTracer::report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec) {
+  send_g1_mmu_event(time_slice_sec * MILLIUNITS,
+                    gc_time_sec * MILLIUNITS,
+                    max_time_sec * MILLIUNITS);
+}
+
+void G1MMUTracer::send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms) {
+  EventG1MMU e;
+  if (e.should_commit()) {
+    e.set_gcId(GCId::current());
+    e.set_timeSlice(time_slice_ms);
+    e.set_gcTime(gc_time_ms);
+    e.set_pauseTarget(max_time_ms);
+    e.commit();
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1Trace.hpp	Wed Sep 04 09:47:51 2019 +0200
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_GC_G1_G1TRACE_HPP
+#define SHARE_GC_G1_G1TRACE_HPP
+
+#include "gc/g1/g1YCTypes.hpp"
+#include "gc/shared/gcTrace.hpp"
+
+class G1EvacuationInfo;
+class G1HeapSummary;
+class G1EvacSummary;
+
+class G1YoungGCInfo {
+  G1YCType _type;
+public:
+  G1YoungGCInfo() : _type(G1YCTypeEndSentinel) {}
+  void set_type(G1YCType type) {
+    _type = type;
+  }
+  G1YCType type() const { return _type; }
+};
+
+class G1NewTracer : public YoungGCTracer {
+  G1YoungGCInfo _g1_young_gc_info;
+
+public:
+  G1NewTracer() : YoungGCTracer(G1New) {}
+
+  void report_yc_type(G1YCType type);
+  void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
+  void report_evacuation_info(G1EvacuationInfo* info);
+  void report_evacuation_failed(EvacuationFailedInfo& ef_info);
+
+  void report_evacuation_statistics(const G1EvacSummary& young_summary, const G1EvacSummary& old_summary) const;
+
+  void report_basic_ihop_statistics(size_t threshold,
+                                    size_t target_occupancy,
+                                    size_t current_occupancy,
+                                    size_t last_allocation_size,
+                                    double last_allocation_duration,
+                                    double last_marking_length);
+  void report_adaptive_ihop_statistics(size_t threshold,
+                                       size_t internal_target_occupancy,
+                                       size_t current_occupancy,
+                                       size_t additional_buffer_size,
+                                       double predicted_allocation_rate,
+                                       double predicted_marking_length,
+                                       bool prediction_active);
+private:
+  void send_g1_young_gc_event();
+  void send_evacuation_info_event(G1EvacuationInfo* info);
+  void send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const;
+
+  void send_young_evacuation_statistics(const G1EvacSummary& summary) const;
+  void send_old_evacuation_statistics(const G1EvacSummary& summary) const;
+
+  void send_basic_ihop_statistics(size_t threshold,
+                                  size_t target_occupancy,
+                                  size_t current_occupancy,
+                                  size_t last_allocation_size,
+                                  double last_allocation_duration,
+                                  double last_marking_length);
+  void send_adaptive_ihop_statistics(size_t threshold,
+                                     size_t internal_target_occupancy,
+                                     size_t current_occupancy,
+                                     size_t additional_buffer_size,
+                                     double predicted_allocation_rate,
+                                     double predicted_marking_length,
+                                     bool prediction_active);
+};
+
+class G1OldTracer : public OldGCTracer {
+ protected:
+  void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
+ public:
+  G1OldTracer() : OldGCTracer(G1Old) {}
+  void set_gc_cause(GCCause::Cause cause);
+};
+
+class G1FullGCTracer : public OldGCTracer {
+public:
+  G1FullGCTracer() : OldGCTracer(G1Full) {}
+};
+
+class G1MMUTracer : public AllStatic {
+  static void send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms);
+
+public:
+  static void report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec);
+};
+
+#endif
--- a/src/hotspot/share/gc/shared/gcTrace.cpp	Tue Sep 03 17:52:36 2019 +0200
+++ b/src/hotspot/share/gc/shared/gcTrace.cpp	Wed Sep 04 09:47:51 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/ticks.hpp"
-#if INCLUDE_G1GC
-#include "gc/g1/g1EvacuationInfo.hpp"
-#endif
 
 void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
   _shared_gc_info.set_cause(cause);
@@ -183,73 +180,3 @@
 void OldGCTracer::report_concurrent_mode_failure() {
   send_concurrent_mode_failure_event();
 }
-
-#if INCLUDE_G1GC
-void G1MMUTracer::report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec) {
-  send_g1_mmu_event(time_slice_sec * MILLIUNITS,
-                    gc_time_sec * MILLIUNITS,
-                    max_time_sec * MILLIUNITS);
-}
-
-void G1NewTracer::report_yc_type(G1YCType type) {
-  _g1_young_gc_info.set_type(type);
-}
-
-void G1NewTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
-  YoungGCTracer::report_gc_end_impl(timestamp, time_partitions);
-  send_g1_young_gc_event();
-}
-
-void G1NewTracer::report_evacuation_info(G1EvacuationInfo* info) {
-  send_evacuation_info_event(info);
-}
-
-void G1NewTracer::report_evacuation_failed(EvacuationFailedInfo& ef_info) {
-  send_evacuation_failed_event(ef_info);
-  ef_info.reset();
-}
-
-void G1NewTracer::report_evacuation_statistics(const G1EvacSummary& young_summary, const G1EvacSummary& old_summary) const {
-  send_young_evacuation_statistics(young_summary);
-  send_old_evacuation_statistics(old_summary);
-}
-
-void G1NewTracer::report_basic_ihop_statistics(size_t threshold,
-                                               size_t target_ccupancy,
-                                               size_t current_occupancy,
-                                               size_t last_allocation_size,
-                                               double last_allocation_duration,
-                                               double last_marking_length) {
-  send_basic_ihop_statistics(threshold,
-                             target_ccupancy,
-                             current_occupancy,
-                             last_allocation_size,
-                             last_allocation_duration,
-                             last_marking_length);
-}
-
-void G1NewTracer::report_adaptive_ihop_statistics(size_t threshold,
-                                                  size_t internal_target_occupancy,
-                                                  size_t current_occupancy,
-                                                  size_t additional_buffer_size,
-                                                  double predicted_allocation_rate,
-                                                  double predicted_marking_length,
-                                                  bool prediction_active) {
-  send_adaptive_ihop_statistics(threshold,
-                                internal_target_occupancy,
-                                additional_buffer_size,
-                                current_occupancy,
-                                predicted_allocation_rate,
-                                predicted_marking_length,
-                                prediction_active);
-}
-
-void G1OldTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
-  _shared_gc_info.set_start_timestamp(timestamp);
-}
-
-void G1OldTracer::set_gc_cause(GCCause::Cause cause) {
-  _shared_gc_info.set_cause(cause);
-}
-
-#endif // INCLUDE_G1GC
--- a/src/hotspot/share/gc/shared/gcTrace.hpp	Tue Sep 03 17:52:36 2019 +0200
+++ b/src/hotspot/share/gc/shared/gcTrace.hpp	Wed Sep 04 09:47:51 2019 +0200
@@ -34,17 +34,11 @@
 #include "memory/referenceType.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/ticks.hpp"
-#if INCLUDE_G1GC
-#include "gc/g1/g1YCTypes.hpp"
-#endif
 
-class G1EvacuationInfo;
 class GCHeapSummary;
 class MetaspaceChunkFreeListSummary;
 class MetaspaceSummary;
 class PSHeapSummary;
-class G1HeapSummary;
-class G1EvacSummary;
 class ReferenceProcessorStats;
 class TimePartitions;
 class BoolObjectClosure;
@@ -97,20 +91,6 @@
   void* dense_prefix() const { return _dense_prefix; }
 };
 
-#if INCLUDE_G1GC
-
-class G1YoungGCInfo {
-  G1YCType _type;
- public:
-  G1YoungGCInfo() : _type(G1YCTypeEndSentinel) {}
-  void set_type(G1YCType type) {
-    _type = type;
-  }
-  G1YCType type() const { return _type; }
-};
-
-#endif // INCLUDE_G1GC
-
 class GCTracer : public ResourceObj {
  protected:
   SharedGCInfo _shared_gc_info;
@@ -232,81 +212,9 @@
   ParNewTracer() : YoungGCTracer(ParNew) {}
 };
 
-#if INCLUDE_G1GC
-class G1MMUTracer : public AllStatic {
-  static void send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms);
-
- public:
-  static void report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec);
-};
-
-class G1NewTracer : public YoungGCTracer {
-  G1YoungGCInfo _g1_young_gc_info;
-
- public:
-  G1NewTracer() : YoungGCTracer(G1New) {}
-
-  void report_yc_type(G1YCType type);
-  void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
-  void report_evacuation_info(G1EvacuationInfo* info);
-  void report_evacuation_failed(EvacuationFailedInfo& ef_info);
-
-  void report_evacuation_statistics(const G1EvacSummary& young_summary, const G1EvacSummary& old_summary) const;
-
-  void report_basic_ihop_statistics(size_t threshold,
-                                    size_t target_occupancy,
-                                    size_t current_occupancy,
-                                    size_t last_allocation_size,
-                                    double last_allocation_duration,
-                                    double last_marking_length);
-  void report_adaptive_ihop_statistics(size_t threshold,
-                                       size_t internal_target_occupancy,
-                                       size_t current_occupancy,
-                                       size_t additional_buffer_size,
-                                       double predicted_allocation_rate,
-                                       double predicted_marking_length,
-                                       bool prediction_active);
- private:
-  void send_g1_young_gc_event();
-  void send_evacuation_info_event(G1EvacuationInfo* info);
-  void send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const;
-
-  void send_young_evacuation_statistics(const G1EvacSummary& summary) const;
-  void send_old_evacuation_statistics(const G1EvacSummary& summary) const;
-
-  void send_basic_ihop_statistics(size_t threshold,
-                                  size_t target_occupancy,
-                                  size_t current_occupancy,
-                                  size_t last_allocation_size,
-                                  double last_allocation_duration,
-                                  double last_marking_length);
-  void send_adaptive_ihop_statistics(size_t threshold,
-                                     size_t internal_target_occupancy,
-                                     size_t current_occupancy,
-                                     size_t additional_buffer_size,
-                                     double predicted_allocation_rate,
-                                     double predicted_marking_length,
-                                     bool prediction_active);
-};
-
-class G1FullGCTracer : public OldGCTracer {
- public:
-  G1FullGCTracer() : OldGCTracer(G1Full) {}
-};
-
-#endif // INCLUDE_G1GC
-
 class CMSTracer : public OldGCTracer {
  public:
   CMSTracer() : OldGCTracer(ConcurrentMarkSweep) {}
 };
 
-class G1OldTracer : public OldGCTracer {
- protected:
-  void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
- public:
-  G1OldTracer() : OldGCTracer(G1Old) {}
-  void set_gc_cause(GCCause::Cause cause);
-};
-
 #endif // SHARE_GC_SHARED_GCTRACE_HPP
--- a/src/hotspot/share/gc/shared/gcTraceSend.cpp	Tue Sep 03 17:52:36 2019 +0200
+++ b/src/hotspot/share/gc/shared/gcTraceSend.cpp	Wed Sep 04 09:47:51 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,10 +31,6 @@
 #include "jfr/jfrEvents.hpp"
 #include "runtime/os.hpp"
 #include "utilities/macros.hpp"
-#if INCLUDE_G1GC
-#include "gc/g1/g1EvacuationInfo.hpp"
-#include "gc/g1/g1YCTypes.hpp"
-#endif
 
 // All GC dependencies against the trace framework is contained within this file.
 
@@ -186,131 +182,6 @@
   }
 }
 
-#if INCLUDE_G1GC
-void G1NewTracer::send_g1_young_gc_event() {
-  EventG1GarbageCollection e(UNTIMED);
-  if (e.should_commit()) {
-    e.set_gcId(GCId::current());
-    e.set_type(_g1_young_gc_info.type());
-    e.set_starttime(_shared_gc_info.start_timestamp());
-    e.set_endtime(_shared_gc_info.end_timestamp());
-    e.commit();
-  }
-}
-
-void G1MMUTracer::send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms) {
-  EventG1MMU e;
-  if (e.should_commit()) {
-    e.set_gcId(GCId::current());
-    e.set_timeSlice(time_slice_ms);
-    e.set_gcTime(gc_time_ms);
-    e.set_pauseTarget(max_time_ms);
-    e.commit();
-  }
-}
-
-void G1NewTracer::send_evacuation_info_event(G1EvacuationInfo* info) {
-  EventEvacuationInformation e;
-  if (e.should_commit()) {
-    e.set_gcId(GCId::current());
-    e.set_cSetRegions(info->collectionset_regions());
-    e.set_cSetUsedBefore(info->collectionset_used_before());
-    e.set_cSetUsedAfter(info->collectionset_used_after());
-    e.set_allocationRegions(info->allocation_regions());
-    e.set_allocationRegionsUsedBefore(info->alloc_regions_used_before());
-    e.set_allocationRegionsUsedAfter(info->alloc_regions_used_before() + info->bytes_copied());
-    e.set_bytesCopied(info->bytes_copied());
-    e.set_regionsFreed(info->regions_freed());
-    e.commit();
-  }
-}
-
-void G1NewTracer::send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const {
-  EventEvacuationFailed e;
-  if (e.should_commit()) {
-    e.set_gcId(GCId::current());
-    e.set_evacuationFailed(to_struct(ef_info));
-    e.commit();
-  }
-}
-
-static JfrStructG1EvacuationStatistics
-create_g1_evacstats(unsigned gcid, const G1EvacSummary& summary) {
-  JfrStructG1EvacuationStatistics s;
-  s.set_gcId(gcid);
-  s.set_allocated(summary.allocated() * HeapWordSize);
-  s.set_wasted(summary.wasted() * HeapWordSize);
-  s.set_used(summary.used() * HeapWordSize);
-  s.set_undoWaste(summary.undo_wasted() * HeapWordSize);
-  s.set_regionEndWaste(summary.region_end_waste() * HeapWordSize);
-  s.set_regionsRefilled(summary.regions_filled());
-  s.set_directAllocated(summary.direct_allocated() * HeapWordSize);
-  s.set_failureUsed(summary.failure_used() * HeapWordSize);
-  s.set_failureWaste(summary.failure_waste() * HeapWordSize);
-  return s;
-}
-
-void G1NewTracer::send_young_evacuation_statistics(const G1EvacSummary& summary) const {
-  EventG1EvacuationYoungStatistics surv_evt;
-  if (surv_evt.should_commit()) {
-    surv_evt.set_statistics(create_g1_evacstats(GCId::current(), summary));
-    surv_evt.commit();
-  }
-}
-
-void G1NewTracer::send_old_evacuation_statistics(const G1EvacSummary& summary) const {
-  EventG1EvacuationOldStatistics old_evt;
-  if (old_evt.should_commit()) {
-    old_evt.set_statistics(create_g1_evacstats(GCId::current(), summary));
-    old_evt.commit();
-  }
-}
-
-void G1NewTracer::send_basic_ihop_statistics(size_t threshold,
-                                             size_t target_occupancy,
-                                             size_t current_occupancy,
-                                             size_t last_allocation_size,
-                                             double last_allocation_duration,
-                                             double last_marking_length) {
-  EventG1BasicIHOP evt;
-  if (evt.should_commit()) {
-    evt.set_gcId(GCId::current());
-    evt.set_threshold(threshold);
-    evt.set_targetOccupancy(target_occupancy);
-    evt.set_thresholdPercentage(target_occupancy > 0 ? ((double)threshold / target_occupancy) : 0.0);
-    evt.set_currentOccupancy(current_occupancy);
-    evt.set_recentMutatorAllocationSize(last_allocation_size);
-    evt.set_recentMutatorDuration(last_allocation_duration * MILLIUNITS);
-    evt.set_recentAllocationRate(last_allocation_duration != 0.0 ? last_allocation_size / last_allocation_duration : 0.0);
-    evt.set_lastMarkingDuration(last_marking_length * MILLIUNITS);
-    evt.commit();
-  }
-}
-
-void G1NewTracer::send_adaptive_ihop_statistics(size_t threshold,
-                                                size_t internal_target_occupancy,
-                                                size_t current_occupancy,
-                                                size_t additional_buffer_size,
-                                                double predicted_allocation_rate,
-                                                double predicted_marking_length,
-                                                bool prediction_active) {
-  EventG1AdaptiveIHOP evt;
-  if (evt.should_commit()) {
-    evt.set_gcId(GCId::current());
-    evt.set_threshold(threshold);
-    evt.set_thresholdPercentage(internal_target_occupancy > 0 ? ((double)threshold / internal_target_occupancy) : 0.0);
-    evt.set_ihopTargetOccupancy(internal_target_occupancy);
-    evt.set_currentOccupancy(current_occupancy);
-    evt.set_additionalBufferSize(additional_buffer_size);
-    evt.set_predictedAllocationRate(predicted_allocation_rate);
-    evt.set_predictedMarkingDuration(predicted_marking_length * MILLIUNITS);
-    evt.set_predictionActive(prediction_active);
-    evt.commit();
-  }
-}
-
-#endif // INCLUDE_G1GC
-
 static JfrStructVirtualSpace to_struct(const VirtualSpaceSummary& summary) {
   JfrStructVirtualSpace space;
   space.set_start((TraceAddress)summary.start());