15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_G1_G1INITIALMARKTOMIXEDTIMETRACKER_HPP
26 #define SHARE_VM_GC_G1_G1INITIALMARKTOMIXEDTIMETRACKER_HPP
27
28 #include "utilities/globalDefinitions.hpp"
29 #include "utilities/debug.hpp"
30
31 // Used to track time from the end of initial mark to the first mixed GC.
32 // After calling the initial mark/mixed gc notifications, the result can be
33 // obtained in last_marking_time() once, after which the tracking resets.
34 // Any pauses recorded by add_pause() will be subtracted from that results.
35 class G1InitialMarkToMixedTimeTracker VALUE_OBJ_CLASS_SPEC {
36 private:
37 bool _active;
38 double _initial_mark_end_time;
39 double _mixed_start_time;
40 double _total_pause_time;
41
42 double wall_time() const {
43 return _mixed_start_time - _initial_mark_end_time;
44 }
45 public:
46 G1InitialMarkToMixedTimeTracker() { reset(); }
47
48 // Record initial mark pause end, starting the time tracking.
49 void record_initial_mark_end(double end_time) {
50 assert(!_active, "Initial mark out of order.");
51 _initial_mark_end_time = end_time;
52 _active = true;
53 }
54
55 // Record the first mixed gc pause start, ending the time tracking.
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_G1_G1INITIALMARKTOMIXEDTIMETRACKER_HPP
26 #define SHARE_VM_GC_G1_G1INITIALMARKTOMIXEDTIMETRACKER_HPP
27
28 #include "utilities/globalDefinitions.hpp"
29 #include "utilities/debug.hpp"
30
31 // Used to track time from the end of initial mark to the first mixed GC.
32 // After calling the initial mark/mixed gc notifications, the result can be
33 // obtained in last_marking_time() once, after which the tracking resets.
34 // Any pauses recorded by add_pause() will be subtracted from that results.
35 class G1InitialMarkToMixedTimeTracker {
36 private:
37 bool _active;
38 double _initial_mark_end_time;
39 double _mixed_start_time;
40 double _total_pause_time;
41
42 double wall_time() const {
43 return _mixed_start_time - _initial_mark_end_time;
44 }
45 public:
46 G1InitialMarkToMixedTimeTracker() { reset(); }
47
48 // Record initial mark pause end, starting the time tracking.
49 void record_initial_mark_end(double end_time) {
50 assert(!_active, "Initial mark out of order.");
51 _initial_mark_end_time = end_time;
52 _active = true;
53 }
54
55 // Record the first mixed gc pause start, ending the time tracking.
|