comparison src/share/vm/services/runtimeService.cpp @ 1260:8859772195c6

6782663: Data produced by PrintGCApplicationConcurrentTime and PrintGCApplicationStoppedTime is not accurate. Summary: Update and display the timers associated with these flags for all safepoints. Reviewed-by: ysr, jcoomes
author johnc
date Tue, 09 Feb 2010 13:56:09 -0800
parents a61af66fc99e
children c18cbe5936b8
comparison
equal deleted inserted replaced
1259:9eee977dd1a9 1260:8859772195c6
1 /* 1 /*
2 * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
102 } 102 }
103 } 103 }
104 104
105 void RuntimeService::record_safepoint_begin() { 105 void RuntimeService::record_safepoint_begin() {
106 HS_DTRACE_PROBE(hs_private, safepoint__begin); 106 HS_DTRACE_PROBE(hs_private, safepoint__begin);
107
108 // Print the time interval in which the app was executing
109 if (PrintGCApplicationConcurrentTime) {
110 gclog_or_tty->print_cr("Application time: %3.7f seconds",
111 last_application_time_sec());
112 }
113
107 // update the time stamp to begin recording safepoint time 114 // update the time stamp to begin recording safepoint time
108 _safepoint_timer.update(); 115 _safepoint_timer.update();
109 if (UsePerfData) { 116 if (UsePerfData) {
110 _total_safepoints->inc(); 117 _total_safepoints->inc();
111 if (_app_timer.is_updated()) { 118 if (_app_timer.is_updated()) {
120 } 127 }
121 } 128 }
122 129
123 void RuntimeService::record_safepoint_end() { 130 void RuntimeService::record_safepoint_end() {
124 HS_DTRACE_PROBE(hs_private, safepoint__end); 131 HS_DTRACE_PROBE(hs_private, safepoint__end);
132
133 // Print the time interval for which the app was stopped
134 // during the current safepoint operation.
135 if (PrintGCApplicationStoppedTime) {
136 gclog_or_tty->print_cr("Total time for which application threads "
137 "were stopped: %3.7f seconds",
138 last_safepoint_time_sec());
139 }
140
125 // update the time stamp to begin recording app time 141 // update the time stamp to begin recording app time
126 _app_timer.update(); 142 _app_timer.update();
127 if (UsePerfData) { 143 if (UsePerfData) {
128 _safepoint_time_ticks->inc(_safepoint_timer.ticks_since_update()); 144 _safepoint_time_ticks->inc(_safepoint_timer.ticks_since_update());
129 } 145 }