From 3f1927a7f3a2914402a25335c47a5a8bdd5511a6 Mon Sep 17 00:00:00 2001 From: Oli Gillespie Date: Thu, 4 May 2023 09:19:19 +0000 Subject: [PATCH] 8307346: Add missing gc+phases logging for ObjectCount(AfterGC) JFR event collection code Reviewed-by: tschatzl, shade, ayang --- src/hotspot/share/gc/g1/g1FullCollector.cpp | 5 ++++- src/hotspot/share/gc/parallel/psParallelCompact.cpp | 5 ++++- src/hotspot/share/gc/serial/genMarkSweep.cpp | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1FullCollector.cpp b/src/hotspot/share/gc/g1/g1FullCollector.cpp index d40dd306f5a..8fb36e73550 100644 --- a/src/hotspot/share/gc/g1/g1FullCollector.cpp +++ b/src/hotspot/share/gc/g1/g1FullCollector.cpp @@ -325,7 +325,10 @@ void G1FullCollector::phase1_mark_live_objects() { _heap->complete_cleaning(purged_class); } - scope()->tracer()->report_object_count_after_gc(&_is_alive); + { + GCTraceTime(Debug, gc, phases) debug("Report Object Count", scope()->timer()); + scope()->tracer()->report_object_count_after_gc(&_is_alive); + } #if TASKQUEUE_STATS oop_queue_set()->print_and_reset_taskqueue_stats("Oop Queue"); array_queue_set()->print_and_reset_taskqueue_stats("ObjArrayOop Queue"); diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp index 9c0febe90a4..417840d88a3 100644 --- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp +++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp @@ -2067,7 +2067,10 @@ void PSParallelCompact::marking_phase(ParallelOldTracer *gc_tracer) { JVMCI_ONLY(JVMCI::do_unloading(purged_class)); } - _gc_tracer.report_object_count_after_gc(is_alive_closure()); + { + GCTraceTime(Debug, gc, phases) tm("Report Object Count", &_gc_timer); + _gc_tracer.report_object_count_after_gc(is_alive_closure()); + } #if TASKQUEUE_STATS ParCompactionManager::oop_task_queues()->print_and_reset_taskqueue_stats("Oop Queue"); ParCompactionManager::_objarray_task_queues->print_and_reset_taskqueue_stats("ObjArrayOop Queue"); diff --git a/src/hotspot/share/gc/serial/genMarkSweep.cpp b/src/hotspot/share/gc/serial/genMarkSweep.cpp index a700307e7aa..d3a15be7e55 100644 --- a/src/hotspot/share/gc/serial/genMarkSweep.cpp +++ b/src/hotspot/share/gc/serial/genMarkSweep.cpp @@ -210,7 +210,10 @@ void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { JVMCI_ONLY(JVMCI::do_unloading(purged_class)); } - gc_tracer()->report_object_count_after_gc(&is_alive); + { + GCTraceTime(Debug, gc, phases) tm_m("Report Object Count", gc_timer()); + gc_tracer()->report_object_count_after_gc(&is_alive); + } }