< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp

Print this page
rev 59188 : 8244243: Shenandoah: Cleanup Shenandoah phase timing tracking and JFR event supporting

*** 33,43 **** #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahHeuristics.hpp" #include "gc/shenandoah/shenandoahUtils.hpp" #include "utilities/debug.hpp" ! ShenandoahPhaseTimings::Phase ShenandoahGCPhase::_current_phase = ShenandoahPhaseTimings::_invalid_phase; ShenandoahGCSession::ShenandoahGCSession(GCCause::Cause cause) : _heap(ShenandoahHeap::heap()), _timer(_heap->gc_timer()), _tracer(_heap->tracer()) { --- 33,43 ---- #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahHeuristics.hpp" #include "gc/shenandoah/shenandoahUtils.hpp" #include "utilities/debug.hpp" ! ShenandoahPhaseTimings::Phase ShenandoahTimingsTracker::_current_phase = ShenandoahPhaseTimings::_invalid_phase; ShenandoahGCSession::ShenandoahGCSession(GCCause::Cause cause) : _heap(ShenandoahHeap::heap()), _timer(_heap->gc_timer()), _tracer(_heap->tracer()) {
*** 83,139 **** /* recordGCEndTime = */ true, /* countCollection = */ true ); } ! ShenandoahPausePhase::ShenandoahPausePhase(const char* title, bool log_heap_usage) : _tracer(title, NULL, GCCause::_no_gc, log_heap_usage), _timer(ShenandoahHeap::heap()->gc_timer()) { _timer->register_gc_pause_start(title); } ShenandoahPausePhase::~ShenandoahPausePhase() { _timer->register_gc_pause_end(); } ! ShenandoahConcurrentPhase::ShenandoahConcurrentPhase(const char* title, bool log_heap_usage) : _tracer(title, NULL, GCCause::_no_gc, log_heap_usage), _timer(ShenandoahHeap::heap()->gc_timer()) { _timer->register_gc_concurrent_start(title); } ShenandoahConcurrentPhase::~ShenandoahConcurrentPhase() { _timer->register_gc_concurrent_end(); } ! ShenandoahGCPhase::ShenandoahGCPhase(ShenandoahPhaseTimings::Phase phase) : _timings(ShenandoahHeap::heap()->phase_timings()), _phase(phase) { assert(!Thread::current()->is_Worker_thread() && (Thread::current()->is_VM_thread() || Thread::current()->is_ConcurrentGC_thread()), "Must be set by these threads"); _parent_phase = _current_phase; _current_phase = phase; _start = os::elapsedTime(); } ! ShenandoahGCPhase::~ShenandoahGCPhase() { _timings->record_phase_time(_phase, os::elapsedTime() - _start); _current_phase = _parent_phase; } ! bool ShenandoahGCPhase::is_current_phase_valid() { return _current_phase < ShenandoahPhaseTimings::_num_phases; } ! ShenandoahGCSubPhase::ShenandoahGCSubPhase(ShenandoahPhaseTimings::Phase phase) : ! ShenandoahGCPhase(phase), _timer(ShenandoahHeap::heap()->gc_timer()) { _timer->register_gc_phase_start(ShenandoahPhaseTimings::phase_name(phase), Ticks::now()); } ! ShenandoahGCSubPhase::~ShenandoahGCSubPhase() { _timer->register_gc_phase_end(Ticks::now()); } ShenandoahGCWorkerPhase::ShenandoahGCWorkerPhase(const ShenandoahPhaseTimings::Phase phase) : _timings(ShenandoahHeap::heap()->phase_timings()), _phase(phase) { --- 83,141 ---- /* recordGCEndTime = */ true, /* countCollection = */ true ); } ! ShenandoahPausePhase::ShenandoahPausePhase(const char* title, ShenandoahPhaseTimings::Phase phase, bool log_heap_usage) : ! ShenandoahTimingsTracker(phase), _tracer(title, NULL, GCCause::_no_gc, log_heap_usage), _timer(ShenandoahHeap::heap()->gc_timer()) { _timer->register_gc_pause_start(title); } ShenandoahPausePhase::~ShenandoahPausePhase() { _timer->register_gc_pause_end(); } ! ShenandoahConcurrentPhase::ShenandoahConcurrentPhase(const char* title, ShenandoahPhaseTimings::Phase phase, bool log_heap_usage) : ! ShenandoahTimingsTracker(phase), _tracer(title, NULL, GCCause::_no_gc, log_heap_usage), _timer(ShenandoahHeap::heap()->gc_timer()) { _timer->register_gc_concurrent_start(title); } ShenandoahConcurrentPhase::~ShenandoahConcurrentPhase() { _timer->register_gc_concurrent_end(); } ! ShenandoahTimingsTracker::ShenandoahTimingsTracker(ShenandoahPhaseTimings::Phase phase) : _timings(ShenandoahHeap::heap()->phase_timings()), _phase(phase) { assert(!Thread::current()->is_Worker_thread() && (Thread::current()->is_VM_thread() || Thread::current()->is_ConcurrentGC_thread()), "Must be set by these threads"); _parent_phase = _current_phase; _current_phase = phase; _start = os::elapsedTime(); } ! ShenandoahTimingsTracker::~ShenandoahTimingsTracker() { _timings->record_phase_time(_phase, os::elapsedTime() - _start); _current_phase = _parent_phase; } ! bool ShenandoahTimingsTracker::is_current_phase_valid() { return _current_phase < ShenandoahPhaseTimings::_num_phases; } ! ShenandoahGCPhase::ShenandoahGCPhase(ShenandoahPhaseTimings::Phase phase) : ! ShenandoahTimingsTracker(phase), _timer(ShenandoahHeap::heap()->gc_timer()) { _timer->register_gc_phase_start(ShenandoahPhaseTimings::phase_name(phase), Ticks::now()); } ! ShenandoahGCPhase::~ShenandoahGCPhase() { _timer->register_gc_phase_end(Ticks::now()); } ShenandoahGCWorkerPhase::ShenandoahGCWorkerPhase(const ShenandoahPhaseTimings::Phase phase) : _timings(ShenandoahHeap::heap()->phase_timings()), _phase(phase) {
< prev index next >