--- old/src/share/vm/gc/g1/concurrentMark.cpp 2015-12-15 14:11:13.300651820 -0800 +++ new/src/share/vm/gc/g1/concurrentMark.cpp 2015-12-15 14:11:13.208651823 -0800 @@ -436,6 +436,7 @@ _has_aborted(false), _restart_for_overflow(false), _concurrent_marking_in_progress(false), + _concurrent_phase_started(false), // _verbose_level set below @@ -1003,6 +1004,19 @@ } } +void ConcurrentMark::register_concurrent_phase_start(const char* title) { + assert(!_concurrent_phase_started, "Sanity"); + _concurrent_phase_started = true; + _g1h->gc_timer_cm()->register_gc_concurrent_start(title); +} + +void ConcurrentMark::register_concurrent_phase_end() { + if (_concurrent_phase_started) { + _concurrent_phase_started = false; + _g1h->gc_timer_cm()->register_gc_concurrent_end(); + } +} + void ConcurrentMark::markFromRoots() { // we might be tempted to assert that: // assert(asynch == !SafepointSynchronize::is_at_safepoint(), @@ -2609,6 +2623,10 @@ satb_mq_set.is_active() /* expected_active */); _g1h->trace_heap_after_concurrent_cycle(); + + // Close any open concurrent phase timing + register_concurrent_phase_end(); + _g1h->register_concurrent_cycle_end(); }