# HG changeset patch # User shade # Date 1538055008 -7200 # Thu Sep 27 15:30:08 2018 +0200 # Node ID a0f03149672ac154492bad48640e6f2ea8790392 # Parent eb3e72f181af1945573507d98854479c748e34e5 8211228: Zero build is broken after JDK-8196341 (Add JFR events for parallel phases of G1) Reviewed-by: XXX diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -3169,24 +3169,24 @@ } bool G1ParEvacuateFollowersClosure::offer_termination() { - EventGCPhaseParallel event; + JFR_ONLY(EventGCPhaseParallel event;) G1ParScanThreadState* const pss = par_scan_state(); start_term_time(); const bool res = terminator()->offer_termination(); end_term_time(); - event.commit(GCId::current(), pss->worker_id(), G1GCPhaseTimes::phase_name(G1GCPhaseTimes::Termination)); + JFR_ONLY(event.commit(GCId::current(), pss->worker_id(), G1GCPhaseTimes::phase_name(G1GCPhaseTimes::Termination));) return res; } void G1ParEvacuateFollowersClosure::do_void() { - EventGCPhaseParallel event; + JFR_ONLY(EventGCPhaseParallel event;) G1ParScanThreadState* const pss = par_scan_state(); pss->trim_queue(); - event.commit(GCId::current(), pss->worker_id(), G1GCPhaseTimes::phase_name(G1GCPhaseTimes::ObjCopy)); + JFR_ONLY(event.commit(GCId::current(), pss->worker_id(), G1GCPhaseTimes::phase_name(G1GCPhaseTimes::ObjCopy));) do { - EventGCPhaseParallel event; + JFR_ONLY(EventGCPhaseParallel event;) pss->steal_and_trim_queue(queues()); - event.commit(GCId::current(), pss->worker_id(), G1GCPhaseTimes::phase_name(G1GCPhaseTimes::ObjCopy)); + JFR_ONLY(event.commit(GCId::current(), pss->worker_id(), G1GCPhaseTimes::phase_name(G1GCPhaseTimes::ObjCopy));) } while (!offer_termination()); } @@ -4056,7 +4056,7 @@ break; } - EventGCPhaseParallel event; + JFR_ONLY(EventGCPhaseParallel event;) double start_time = os::elapsedTime(); end = MIN2(end, _num_work_items); @@ -4071,11 +4071,11 @@ if (is_young) { young_time += time_taken; has_young_time = true; - event.commit(GCId::current(), worker_id, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::YoungFreeCSet)); + JFR_ONLY(event.commit(GCId::current(), worker_id, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::YoungFreeCSet));) } else { non_young_time += time_taken; has_non_young_time = true; - event.commit(GCId::current(), worker_id, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::NonYoungFreeCSet)); + JFR_ONLY(event.commit(GCId::current(), worker_id, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::NonYoungFreeCSet));) } start_time = end_time; } diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp --- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp +++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp @@ -541,7 +541,7 @@ G1GCParPhaseTimesTracker::~G1GCParPhaseTimesTracker() { if (_phase_times != NULL) { _phase_times->record_time_secs(_phase, _worker_id, (Ticks::now() - _start_time).seconds()); - _event.commit(GCId::current(), _worker_id, G1GCPhaseTimes::phase_name(_phase)); + JFR_ONLY(_event.commit(GCId::current(), _worker_id, G1GCPhaseTimes::phase_name(_phase));) } } diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp --- a/src/hotspot/share/gc/g1/g1RemSet.cpp +++ b/src/hotspot/share/gc/g1/g1RemSet.cpp @@ -394,13 +394,13 @@ scan_card(mr, region_idx_for_card); } - event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::ScanRS)); + JFR_ONLY(event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::ScanRS));) } void G1ScanRSForRegionClosure::scan_strong_code_roots(HeapRegion* r) { - EventGCPhaseParallel event; + JFR_ONLY(EventGCPhaseParallel event;) r->strong_code_roots_do(_pss->closures()->weak_codeblobs()); - event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::CodeRoots)); + JFR_ONLY(event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::CodeRoots));) } bool G1ScanRSForRegionClosure::do_heap_region(HeapRegion* r) {