< prev index next >
src/share/vm/services/runtimeService.cpp
Print this page
rev 6868 : 8059216: Make PrintGCApplicationStoppedTime print information about stopping threads
Reviewed-by: dholmes, brutisso
*** 44,53 ****
--- 44,54 ----
PerfCounter* RuntimeService::_safepoint_time_ticks = NULL;
PerfCounter* RuntimeService::_application_time_ticks = NULL;
PerfCounter* RuntimeService::_thread_interrupt_signaled_count = NULL;
PerfCounter* RuntimeService::_interrupted_before_count = NULL;
PerfCounter* RuntimeService::_interrupted_during_count = NULL;
+ double RuntimeService::_last_safepoint_sync_time_sec = 0.0;
void RuntimeService::init() {
// Make sure the VM version is initialized
Abstract_VM_Version::initialize();
*** 126,135 ****
--- 127,137 ----
last_application_time_sec());
}
// update the time stamp to begin recording safepoint time
_safepoint_timer.update();
+ _last_safepoint_sync_time_sec = 0.0;
if (UsePerfData) {
_total_safepoints->inc();
if (_app_timer.is_updated()) {
_application_time_ticks->inc(_app_timer.ticks_since_update());
}
*** 138,147 ****
--- 140,152 ----
void RuntimeService::record_safepoint_synchronized() {
if (UsePerfData) {
_sync_time_ticks->inc(_safepoint_timer.ticks_since_update());
}
+ if (PrintGCApplicationStoppedTime) {
+ _last_safepoint_sync_time_sec = last_safepoint_time_sec();
+ }
}
void RuntimeService::record_safepoint_end() {
#ifndef USDT2
HS_DTRACE_PROBE(hs_private, safepoint__end);
*** 153,164 ****
// during the current safepoint operation.
if (PrintGCApplicationStoppedTime) {
gclog_or_tty->date_stamp(PrintGCDateStamps);
gclog_or_tty->stamp(PrintGCTimeStamps);
gclog_or_tty->print_cr("Total time for which application threads "
! "were stopped: %3.7f seconds",
! last_safepoint_time_sec());
}
// update the time stamp to begin recording app time
_app_timer.update();
if (UsePerfData) {
--- 158,171 ----
// during the current safepoint operation.
if (PrintGCApplicationStoppedTime) {
gclog_or_tty->date_stamp(PrintGCDateStamps);
gclog_or_tty->stamp(PrintGCTimeStamps);
gclog_or_tty->print_cr("Total time for which application threads "
! "were stopped: %3.7f seconds, "
! "Stopping threads took: %3.7f seconds",
! last_safepoint_time_sec(),
! _last_safepoint_sync_time_sec);
}
// update the time stamp to begin recording app time
_app_timer.update();
if (UsePerfData) {
< prev index next >