< prev index next >

src/hotspot/share/gc/g1/g1ConcurrentStartToMixedTimeTracker.hpp

Print this page
rev 60060 : imported patch 8210462-lkorinth-review

*** 1,7 **** /* ! * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 20,56 **** * or visit www.oracle.com if you need additional information or have any * questions. * */ ! #ifndef SHARE_GC_G1_G1INITIALMARKTOMIXEDTIMETRACKER_HPP ! #define SHARE_GC_G1_G1INITIALMARKTOMIXEDTIMETRACKER_HPP - #include "utilities/globalDefinitions.hpp" #include "utilities/debug.hpp" ! // Used to track time from the end of initial mark to the first mixed GC. ! // After calling the initial mark/mixed gc notifications, the result can be // obtained in last_marking_time() once, after which the tracking resets. // Any pauses recorded by add_pause() will be subtracted from that results. ! class G1InitialMarkToMixedTimeTracker { private: bool _active; ! double _initial_mark_end_time; double _mixed_start_time; double _total_pause_time; double wall_time() const { ! return _mixed_start_time - _initial_mark_end_time; } public: ! G1InitialMarkToMixedTimeTracker() { reset(); } ! // Record initial mark pause end, starting the time tracking. ! void record_initial_mark_end(double end_time) { ! assert(!_active, "Initial mark out of order."); ! _initial_mark_end_time = end_time; _active = true; } // Record the first mixed gc pause start, ending the time tracking. void record_mixed_gc_start(double start_time) { --- 20,56 ---- * or visit www.oracle.com if you need additional information or have any * questions. * */ ! #ifndef SHARE_GC_G1_G1CONCURRENTSTARTTOMIXEDTIMETRACKER_HPP ! #define SHARE_GC_G1_G1CONCURRENTSTARTTOMIXEDTIMETRACKER_HPP #include "utilities/debug.hpp" + #include "utilities/globalDefinitions.hpp" ! // Used to track time from the end of concurrent start to the first mixed GC. ! // After calling the concurrent start/mixed gc notifications, the result can be // obtained in last_marking_time() once, after which the tracking resets. // Any pauses recorded by add_pause() will be subtracted from that results. ! class G1ConcurrentStartToMixedTimeTracker { private: bool _active; ! double _concurrent_start_end_time; double _mixed_start_time; double _total_pause_time; double wall_time() const { ! return _mixed_start_time - _concurrent_start_end_time; } public: ! G1ConcurrentStartToMixedTimeTracker() { reset(); } ! // Record concurrent start pause end, starting the time tracking. ! void record_concurrent_start_end(double end_time) { ! assert(!_active, "Concurrent start out of order."); ! _concurrent_start_end_time = end_time; _active = true; } // Record the first mixed gc pause start, ending the time tracking. void record_mixed_gc_start(double start_time) {
*** 60,87 **** } } double last_marking_time() { assert(has_result(), "Do not have all measurements yet."); ! double result = (_mixed_start_time - _initial_mark_end_time) - _total_pause_time; reset(); return result; } void reset() { _active = false; _total_pause_time = 0.0; ! _initial_mark_end_time = -1.0; _mixed_start_time = -1.0; } void add_pause(double time) { if (_active) { _total_pause_time += time; } } // Returns whether we have a result that can be retrieved. ! bool has_result() const { return _mixed_start_time > 0.0 && _initial_mark_end_time > 0.0; } }; ! #endif // SHARE_GC_G1_G1INITIALMARKTOMIXEDTIMETRACKER_HPP --- 60,87 ---- } } double last_marking_time() { assert(has_result(), "Do not have all measurements yet."); ! double result = (_mixed_start_time - _concurrent_start_end_time) - _total_pause_time; reset(); return result; } void reset() { _active = false; _total_pause_time = 0.0; ! _concurrent_start_end_time = -1.0; _mixed_start_time = -1.0; } void add_pause(double time) { if (_active) { _total_pause_time += time; } } // Returns whether we have a result that can be retrieved. ! bool has_result() const { return _mixed_start_time > 0.0 && _concurrent_start_end_time > 0.0; } }; ! #endif // SHARE_GC_G1_G1CONCURRENTSTARTTOMIXEDTIMETRACKER_HPP
< prev index next >