< prev index next >

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

Print this page
rev 8823 : imported patch 8133530-add-jfr-event-for-evacuation
rev 8824 : imported patch erik-comments

@@ -232,10 +232,41 @@
     e.set_gcId(_shared_gc_info.gc_id().id());
     e.set_data(to_trace_struct(ef_info));
     e.commit();
   }
 }
+
+void G1NewTracer::send_young_evacuation_statistics(const G1EvacSummary& summary) const {
+  EventGCG1EvacuationYoungStatistics surv_evt;
+  if (surv_evt.should_commit()) {
+    surv_evt.set_stats(create_g1_evacstats(summary));
+    surv_evt.commit();
+  }    
+}
+
+void G1NewTracer::send_old_evacuation_statistics(const G1EvacSummary& summary) const {
+  EventGCG1EvacuationOldStatistics old_evt;
+  if (old_evt.should_commit()) {
+    old_evt.set_stats(create_g1_evacstats(summary));
+    old_evt.commit();
+  }
+}
+
+TraceStructG1EvacStats G1NewTracer::create_g1_evacstats(const G1EvacSummary& summary) const {
+  TraceStructG1EvacStats s;
+  s.set_gcId(_shared_gc_info.gc_id().id());
+  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;
+}
 #endif
 
 static TraceStructVirtualSpace to_trace_struct(const VirtualSpaceSummary& summary) {
   TraceStructVirtualSpace space;
   space.set_start((TraceAddress)summary.start());
< prev index next >