8140508: Add utility method for logging phases to G1CollectorPolicy
authorehelin
Fri, 30 Oct 2015 10:15:06 +0100
changeset 33738 1708291bd3d7
parent 33737 a1bd57411686
child 33739 e1df46512ae2
8140508: Add utility method for logging phases to G1CollectorPolicy Reviewed-by: mgerdin, tschatzl
hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp
hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp
hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp
hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Fri Oct 30 16:18:58 2015 -0700
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Fri Oct 30 10:15:06 2015 +0100
@@ -3735,8 +3735,7 @@
       gclog_or_tty->print(" (to-space exhausted)");
     }
     gclog_or_tty->print_cr(", %3.7f secs]", pause_time_sec);
-    g1_policy()->phase_times()->note_gc_end();
-    g1_policy()->phase_times()->print(pause_time_sec);
+    g1_policy()->print_phases(pause_time_sec);
     g1_policy()->print_detailed_heap_transition();
   } else {
     if (evacuation_failed()) {
--- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Fri Oct 30 16:18:58 2015 -0700
+++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Fri Oct 30 10:15:06 2015 +0100
@@ -1271,6 +1271,10 @@
   gclog_or_tty->cr();
 }
 
+void G1CollectorPolicy::print_phases(double pause_time_sec) {
+  phase_times()->print(pause_time_sec);
+}
+
 void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time,
                                                      double update_rs_processed_buffers,
                                                      double goal_ms) {
--- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp	Fri Oct 30 16:18:58 2015 -0700
+++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp	Fri Oct 30 10:15:06 2015 +0100
@@ -593,6 +593,8 @@
   void print_heap_transition() const;
   void print_detailed_heap_transition(bool full = false) const;
 
+  virtual void print_phases(double pause_time_sec);
+
   void record_stop_world_start();
   void record_concurrent_pause();
 
--- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp	Fri Oct 30 16:18:58 2015 -0700
+++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp	Fri Oct 30 10:15:06 2015 +0100
@@ -362,6 +362,8 @@
 };
 
 void G1GCPhaseTimes::print(double pause_time_sec) {
+  note_gc_end();
+
   G1GCParPhasePrinter par_phase_printer(this);
 
   if (_root_region_scan_wait_time_ms > 0.0) {
--- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp	Fri Oct 30 16:18:58 2015 -0700
+++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp	Fri Oct 30 10:15:06 2015 +0100
@@ -121,10 +121,11 @@
   void print_stats(int level, const char* str, size_t value);
   void print_stats(int level, const char* str, double value, uint workers);
 
+  void note_gc_end();
+
  public:
   G1GCPhaseTimes(uint max_gc_threads);
   void note_gc_start(uint active_gc_threads, bool mark_in_progress);
-  void note_gc_end();
   void print(double pause_time_sec);
 
   // record the time a phase took in seconds