< prev index next >

src/share/vm/gc/shared/gcTraceSend.cpp

Print this page
rev 9286 : imported patch 8136679-jfr-event-for-dynamic-ihop

@@ -33,10 +33,11 @@
 #include "trace/tracing.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc/g1/evacuationInfo.hpp"
 #include "gc/g1/g1YCTypes.hpp"
+#include "tracefiles/traceEventClasses.hpp"
 #endif
 
 // All GC dependencies against the trace framework is contained within this file.
 
 typedef uintptr_t TraceAddress;

@@ -263,10 +264,47 @@
   if (old_evt.should_commit()) {
     old_evt.set_stats(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_ize,
+                                             double last_allocation_duration,
+                                             double last_marking_length) {
+  EventGCG1BasicIHOP evt;
+  if (evt.should_commit()) {
+    evt.set_gcId(GCId::current());
+    evt.set_threshold(threshold);
+    evt.set_targetOccupancy(target_occupancy);
+    evt.set_thresholdPercentage(threshold * 100.0 / target_occupancy);
+    evt.set_currentOccupancy(current_occupancy);
+    evt.set_lastAllocationSize(last_allocation_ize);
+    evt.set_lastAllocationDuration(last_allocation_duration);
+    evt.set_lastAllocationRate(last_allocation_duration != 0.0 ? last_allocation_ize / last_allocation_duration : 0.0);
+    evt.set_lastMarkingLength(last_marking_length);
+    evt.commit();
+  }
+}
+
+void G1NewTracer::send_adaptive_ihop_statistics(size_t additional_buffer_size,
+                                                double predicted_allocation_rate,
+                                                double predicted_marking_length,
+                                                bool prediction_active) {
+  EventGCG1AdaptiveIHOP evt;
+  if (evt.should_commit()) {
+    evt.set_gcId(GCId::current());
+    evt.set_additionalBufferSize(additional_buffer_size);
+    evt.set_predictedAllocationRate(predicted_allocation_rate);
+    evt.set_predictedMarkingLength(predicted_marking_length);
+    evt.set_predictionActive(prediction_active);
+    evt.commit();
+  }
+}
+
 #endif
 
 static TraceStructVirtualSpace to_trace_struct(const VirtualSpaceSummary& summary) {
   TraceStructVirtualSpace space;
   space.set_start((TraceAddress)summary.start());
< prev index next >