Tue, 28 Oct 2014 18:41:34 +0400
8059216: Make PrintGCApplicationStoppedTime print information about stopping threads
Reviewed-by: dholmes, brutisso
src/share/vm/services/runtimeService.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/services/runtimeService.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/services/runtimeService.cpp Thu Oct 30 13:03:30 2014 +0100 1.2 +++ b/src/share/vm/services/runtimeService.cpp Tue Oct 28 18:41:34 2014 +0400 1.3 @@ -46,6 +46,7 @@ 1.4 PerfCounter* RuntimeService::_thread_interrupt_signaled_count = NULL; 1.5 PerfCounter* RuntimeService::_interrupted_before_count = NULL; 1.6 PerfCounter* RuntimeService::_interrupted_during_count = NULL; 1.7 +double RuntimeService::_last_safepoint_sync_time_sec = 0.0; 1.8 1.9 void RuntimeService::init() { 1.10 // Make sure the VM version is initialized 1.11 @@ -128,6 +129,7 @@ 1.12 1.13 // update the time stamp to begin recording safepoint time 1.14 _safepoint_timer.update(); 1.15 + _last_safepoint_sync_time_sec = 0.0; 1.16 if (UsePerfData) { 1.17 _total_safepoints->inc(); 1.18 if (_app_timer.is_updated()) { 1.19 @@ -140,6 +142,9 @@ 1.20 if (UsePerfData) { 1.21 _sync_time_ticks->inc(_safepoint_timer.ticks_since_update()); 1.22 } 1.23 + if (PrintGCApplicationStoppedTime) { 1.24 + _last_safepoint_sync_time_sec = last_safepoint_time_sec(); 1.25 + } 1.26 } 1.27 1.28 void RuntimeService::record_safepoint_end() { 1.29 @@ -155,8 +160,10 @@ 1.30 gclog_or_tty->date_stamp(PrintGCDateStamps); 1.31 gclog_or_tty->stamp(PrintGCTimeStamps); 1.32 gclog_or_tty->print_cr("Total time for which application threads " 1.33 - "were stopped: %3.7f seconds", 1.34 - last_safepoint_time_sec()); 1.35 + "were stopped: %3.7f seconds, " 1.36 + "Stopping threads took: %3.7f seconds", 1.37 + last_safepoint_time_sec(), 1.38 + _last_safepoint_sync_time_sec); 1.39 } 1.40 1.41 // update the time stamp to begin recording app time
2.1 --- a/src/share/vm/services/runtimeService.hpp Thu Oct 30 13:03:30 2014 +0100 2.2 +++ b/src/share/vm/services/runtimeService.hpp Tue Oct 28 18:41:34 2014 +0400 2.3 @@ -40,6 +40,7 @@ 2.4 2.5 static TimeStamp _safepoint_timer; 2.6 static TimeStamp _app_timer; 2.7 + static double _last_safepoint_sync_time_sec; 2.8 2.9 public: 2.10 static void init();