1 /*
2 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
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 *
51 }
52
53 void GCTimer::register_gc_phase_start(const char* name, const Ticks& time) {
54 _time_partitions.report_gc_phase_start(name, time);
55 }
56
57 void GCTimer::register_gc_phase_end(const Ticks& time) {
58 _time_partitions.report_gc_phase_end(time);
59 }
60
61 void STWGCTimer::register_gc_start(const Ticks& time) {
62 GCTimer::register_gc_start(time);
63 register_gc_pause_start("GC Pause", time);
64 }
65
66 void STWGCTimer::register_gc_end(const Ticks& time) {
67 register_gc_pause_end(time);
68 GCTimer::register_gc_end(time);
69 }
70
71 void ConcurrentGCTimer::register_gc_pause_start(const char* name) {
72 assert(!_is_concurrent_phase_active, "A pause phase can't be started while a concurrent phase is active.");
73 GCTimer::register_gc_pause_start(name);
74 }
75
76 void ConcurrentGCTimer::register_gc_pause_end() {
77 assert(!_is_concurrent_phase_active, "A pause phase can't be ended while a concurrent phase is active.");
78 GCTimer::register_gc_pause_end();
79 }
80
81 void ConcurrentGCTimer::register_gc_concurrent_start(const char* name, const Ticks& time) {
82 assert(!_is_concurrent_phase_active, "A concurrent phase is already active.");
83 _time_partitions.report_gc_phase_start(name, time, GCPhase::ConcurrentPhaseType);
84 _is_concurrent_phase_active = true;
85 }
86
87 void ConcurrentGCTimer::register_gc_concurrent_end(const Ticks& time) {
88 assert(_is_concurrent_phase_active, "A concurrent phase is not active.");
89 _time_partitions.report_gc_phase_end(time, GCPhase::ConcurrentPhaseType);
90 _is_concurrent_phase_active = false;
91 }
92
93 void PhasesStack::clear() {
94 _next_phase_level = 0;
95 }
96
97 void PhasesStack::push(int phase_index) {
98 assert(_next_phase_level < PHASE_LEVELS, "Overflow");
|
1 /*
2 * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
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 *
51 }
52
53 void GCTimer::register_gc_phase_start(const char* name, const Ticks& time) {
54 _time_partitions.report_gc_phase_start(name, time);
55 }
56
57 void GCTimer::register_gc_phase_end(const Ticks& time) {
58 _time_partitions.report_gc_phase_end(time);
59 }
60
61 void STWGCTimer::register_gc_start(const Ticks& time) {
62 GCTimer::register_gc_start(time);
63 register_gc_pause_start("GC Pause", time);
64 }
65
66 void STWGCTimer::register_gc_end(const Ticks& time) {
67 register_gc_pause_end(time);
68 GCTimer::register_gc_end(time);
69 }
70
71 void ConcurrentGCTimer::register_gc_pause_start(const char* name, const Ticks& time) {
72 assert(!_is_concurrent_phase_active, "A pause phase can't be started while a concurrent phase is active.");
73 GCTimer::register_gc_pause_start(name, time);
74 }
75
76 void ConcurrentGCTimer::register_gc_pause_end(const Ticks& time) {
77 assert(!_is_concurrent_phase_active, "A pause phase can't be ended while a concurrent phase is active.");
78 GCTimer::register_gc_pause_end(time);
79 }
80
81 void ConcurrentGCTimer::register_gc_concurrent_start(const char* name, const Ticks& time) {
82 assert(!_is_concurrent_phase_active, "A concurrent phase is already active.");
83 _time_partitions.report_gc_phase_start(name, time, GCPhase::ConcurrentPhaseType);
84 _is_concurrent_phase_active = true;
85 }
86
87 void ConcurrentGCTimer::register_gc_concurrent_end(const Ticks& time) {
88 assert(_is_concurrent_phase_active, "A concurrent phase is not active.");
89 _time_partitions.report_gc_phase_end(time, GCPhase::ConcurrentPhaseType);
90 _is_concurrent_phase_active = false;
91 }
92
93 void PhasesStack::clear() {
94 _next_phase_level = 0;
95 }
96
97 void PhasesStack::push(int phase_index) {
98 assert(_next_phase_level < PHASE_LEVELS, "Overflow");
|