< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.cpp

Print this page
rev 8818 : [mq]: dlindholm-changes

@@ -67,10 +67,11 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/stack.inline.hpp"
+#include "tracefiles/traceEventClasses.hpp"
 
 size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
 
 // turn it on so that the contents of the young list (scan-only /
 // to-be-collected) are printed at "strategic" points before / during

@@ -5575,12 +5576,39 @@
   redirty_logged_cards();
   COMPILER2_PRESENT(DerivedPointerTable::update_pointers());
 }
 
 void G1CollectedHeap::record_obj_copy_mem_stats() {
-  _survivor_evac_stats.send_obj_copy_mem_event(InCSetState::get_str(InCSetState::Young));
-  _old_evac_stats.send_obj_copy_mem_event(InCSetState::get_str(InCSetState::Old));
+  EventGCG1EvacuationYoungStatistics surv_evt;
+  if (surv_evt.should_commit()) {
+    surv_evt.set_gcId(GCId::peek().id());
+    surv_evt.set_allocated(_survivor_evac_stats.allocated() * HeapWordSize);
+    surv_evt.set_wasted(_survivor_evac_stats.wasted() * HeapWordSize);
+    surv_evt.set_used(_survivor_evac_stats.used() * HeapWordSize);
+    surv_evt.set_undoWaste(_survivor_evac_stats.undo_wasted() * HeapWordSize);
+    surv_evt.set_regionEndWaste(_survivor_evac_stats.region_end_waste() * HeapWordSize);
+    surv_evt.set_regionsRefilled(_survivor_evac_stats.regions_refilled());
+    surv_evt.set_directAllocated(_survivor_evac_stats.direct_allocated() * HeapWordSize);
+    surv_evt.set_failureUsed(_survivor_evac_stats.failure_used() * HeapWordSize);
+    surv_evt.set_failureWaste(_survivor_evac_stats.failure_waste() * HeapWordSize);
+    surv_evt.commit();
+  }
+
+  EventGCG1EvacuationOldStatistics old_evt;
+  if (old_evt.should_commit()) {
+    old_evt.set_gcId(GCId::peek().id());
+    old_evt.set_allocated(_old_evac_stats.allocated() * HeapWordSize);
+    old_evt.set_wasted(_old_evac_stats.wasted() * HeapWordSize);
+    old_evt.set_used(_old_evac_stats.used() * HeapWordSize);
+    old_evt.set_undoWaste(_old_evac_stats.undo_wasted() * HeapWordSize);
+    old_evt.set_regionEndWaste(_old_evac_stats.region_end_waste() * HeapWordSize);
+    old_evt.set_regionsRefilled(_old_evac_stats.regions_refilled());
+    old_evt.set_directAllocated(_old_evac_stats.direct_allocated() * HeapWordSize);
+    old_evt.set_failureUsed(_old_evac_stats.failure_used() * HeapWordSize);
+    old_evt.set_failureWaste(_old_evac_stats.failure_waste() * HeapWordSize);
+    old_evt.commit();
+  }
 }
 
 void G1CollectedHeap::free_region(HeapRegion* hr,
                                   FreeRegionList* free_list,
                                   bool par,
< prev index next >