changeset 9660:ddc17a69ffc5

8140508: Add utility method for logging phases to G1CollectorPolicy Reviewed-by: mgerdin, tschatzl
author ehelin
date Fri, 30 Oct 2015 10:15:06 +0100
parents 8d33e189e86d
children 82b971bf9c3c
files src/share/vm/gc/g1/g1CollectedHeap.cpp src/share/vm/gc/g1/g1CollectorPolicy.cpp src/share/vm/gc/g1/g1CollectorPolicy.hpp src/share/vm/gc/g1/g1GCPhaseTimes.cpp src/share/vm/gc/g1/g1GCPhaseTimes.hpp
diffstat 5 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/g1/g1CollectedHeap.cpp	Fri Oct 30 16:18:58 2015 -0700
+++ b/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/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Fri Oct 30 16:18:58 2015 -0700
+++ b/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/src/share/vm/gc/g1/g1CollectorPolicy.hpp	Fri Oct 30 16:18:58 2015 -0700
+++ b/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/src/share/vm/gc/g1/g1GCPhaseTimes.cpp	Fri Oct 30 16:18:58 2015 -0700
+++ b/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/src/share/vm/gc/g1/g1GCPhaseTimes.hpp	Fri Oct 30 16:18:58 2015 -0700
+++ b/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