8149648: Add number of regions to the G1HeapSummary event
authordavid
Thu, 11 Feb 2016 16:49:12 +0100
changeset 36095 2d530b26ae5c
parent 36094 bd3e4031b89c
child 36096 5737705c0412
8149648: Add number of regions to the G1HeapSummary event Reviewed-by: sjohanss, jwilhelm
hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
hotspot/src/share/vm/gc/shared/gcHeapSummary.hpp
hotspot/src/share/vm/gc/shared/gcTraceSend.cpp
hotspot/src/share/vm/trace/trace.xml
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Thu Feb 11 12:11:02 2016 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Thu Feb 11 16:49:12 2016 +0100
@@ -2847,7 +2847,7 @@
     (g1_policy()->young_list_target_length() * HeapRegion::GrainBytes) - survivor_used_bytes;
 
   VirtualSpaceSummary heap_summary = create_heap_space_summary();
-  return G1HeapSummary(heap_summary, used(), eden_used_bytes, eden_capacity_bytes, survivor_used_bytes);
+  return G1HeapSummary(heap_summary, used(), eden_used_bytes, eden_capacity_bytes, survivor_used_bytes, num_regions());
 }
 
 G1EvacSummary G1CollectedHeap::create_g1_evac_summary(G1EvacStats* stats) {
--- a/hotspot/src/share/vm/gc/shared/gcHeapSummary.hpp	Thu Feb 11 12:11:02 2016 +0000
+++ b/hotspot/src/share/vm/gc/shared/gcHeapSummary.hpp	Thu Feb 11 16:49:12 2016 +0100
@@ -131,12 +131,14 @@
   size_t  _edenUsed;
   size_t  _edenCapacity;
   size_t  _survivorUsed;
+  uint    _numberOfRegions;
  public:
-   G1HeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, size_t edenUsed, size_t edenCapacity, size_t survivorUsed) :
-       GCHeapSummary(heap_space, heap_used), _edenUsed(edenUsed), _edenCapacity(edenCapacity), _survivorUsed(survivorUsed) { }
+   G1HeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, size_t edenUsed, size_t edenCapacity, size_t survivorUsed, uint numberOfRegions) :
+      GCHeapSummary(heap_space, heap_used), _edenUsed(edenUsed), _edenCapacity(edenCapacity), _survivorUsed(survivorUsed), _numberOfRegions(numberOfRegions) { }
    const size_t edenUsed() const { return _edenUsed; }
    const size_t edenCapacity() const { return _edenCapacity; }
    const size_t survivorUsed() const { return _survivorUsed; }
+   const uint   numberOfRegions() const { return _numberOfRegions; }
 
    virtual void accept(GCHeapSummaryVisitor* visitor) const {
      visitor->visit(this);
--- a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp	Thu Feb 11 12:11:02 2016 +0000
+++ b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp	Thu Feb 11 16:49:12 2016 +0100
@@ -359,6 +359,7 @@
       e.set_edenUsedSize(g1_heap_summary->edenUsed());
       e.set_edenTotalSize(g1_heap_summary->edenCapacity());
       e.set_survivorUsedSize(g1_heap_summary->survivorUsed());
+      e.set_numberOfRegions(g1_heap_summary->numberOfRegions());
       e.commit();
     }
   }
--- a/hotspot/src/share/vm/trace/trace.xml	Thu Feb 11 12:11:02 2016 +0000
+++ b/hotspot/src/share/vm/trace/trace.xml	Thu Feb 11 16:49:12 2016 +0100
@@ -283,6 +283,7 @@
       <value type="BYTES64" field="edenUsedSize" label="Eden Used Size" />
       <value type="BYTES64" field="edenTotalSize" label="Eden Total Size" />
       <value type="BYTES64" field="survivorUsedSize" label="Survivor Used Size" />
+      <value type="UINT" field="numberOfRegions" label="Number of Regions" />
     </event>
 
     <event id="GCGarbageCollection" path="vm/gc/collector/garbage_collection" label="Garbage Collection"