--- old/src/share/vm/gc/parallel/parallelScavengeHeap.cpp 2017-09-01 13:03:00.022221465 +0200 +++ new/src/share/vm/gc/parallel/parallelScavengeHeap.cpp 2017-09-01 13:02:59.886216061 +0200 @@ -574,16 +574,10 @@ } void ParallelScavengeHeap::print_tracing_info() const { - if (TraceYoungGenTime) { - double time = PSScavenge::accumulated_time()->seconds(); - tty->print_cr("[Accumulated GC generation 0 time %3.7f secs]", time); - } - if (TraceOldGenTime) { - double time = UseParallelOldGC ? PSParallelCompact::accumulated_time()->seconds() : PSMarkSweep::accumulated_time()->seconds(); - tty->print_cr("[Accumulated GC generation 1 time %3.7f secs]", time); - } - AdaptiveSizePolicyOutput::print(); + log_debug(gc, heap, exit)("Accumulated young generation GC time %3.7f secs", PSScavenge::accumulated_time()->seconds()); + log_debug(gc, heap, exit)("Accumulated old generation GC time %3.7f secs", + UseParallelOldGC ? PSParallelCompact::accumulated_time()->seconds() : PSMarkSweep::accumulated_time()->seconds()); } --- old/src/share/vm/gc/parallel/psMarkSweep.cpp 2017-09-01 13:03:00.722249283 +0200 +++ new/src/share/vm/gc/parallel/psMarkSweep.cpp 2017-09-01 13:03:00.570243242 +0200 @@ -174,7 +174,7 @@ TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(true /* Full GC */,gc_cause); - if (TraceOldGenTime) accumulated_time()->start(); + if (log_is_enabled(Debug, gc, heap, exit)) accumulated_time()->start(); // Let the size policy know we're starting size_policy->major_collection_begin(); @@ -343,7 +343,7 @@ // We collected the heap, recalculate the metaspace capacity MetaspaceGC::compute_new_size(); - if (TraceOldGenTime) accumulated_time()->stop(); + if (log_is_enabled(Debug, gc, heap, exit)) accumulated_time()->stop(); young_gen->print_used_change(young_gen_prev_used); old_gen->print_used_change(old_gen_prev_used); --- old/src/share/vm/gc/parallel/psParallelCompact.cpp 2017-09-01 13:03:01.338273762 +0200 +++ new/src/share/vm/gc/parallel/psParallelCompact.cpp 2017-09-01 13:03:01.206268516 +0200 @@ -1779,7 +1779,7 @@ TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(true /* Full GC */,gc_cause); - if (TraceOldGenTime) accumulated_time()->start(); + if (log_is_enabled(Debug, gc, heap, exit)) accumulated_time()->start(); // Let the size policy know we're starting size_policy->major_collection_begin(); @@ -1898,7 +1898,7 @@ // Resize the metaspace capacity after a collection MetaspaceGC::compute_new_size(); - if (TraceOldGenTime) { + if (log_is_enabled(Debug, gc, heap, exit)) { accumulated_time()->stop(); } --- old/src/share/vm/gc/parallel/psScavenge.cpp 2017-09-01 13:03:02.002300149 +0200 +++ new/src/share/vm/gc/parallel/psScavenge.cpp 2017-09-01 13:03:01.866294744 +0200 @@ -307,7 +307,7 @@ TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(false /* not full GC */,gc_cause); - if (TraceYoungGenTime) accumulated_time()->start(); + if (log_is_enabled(Debug, gc, heap, exit)) accumulated_time()->start(); // Let the size policy know we're starting size_policy->minor_collection_begin(); @@ -609,7 +609,7 @@ CardTableExtension::verify_all_young_refs_imprecise(); } - if (TraceYoungGenTime) accumulated_time()->stop(); + if (log_is_enabled(Debug, gc, heap, exit)) accumulated_time()->stop(); young_gen->print_used_change(pre_gc_values.young_gen_used()); old_gen->print_used_change(pre_gc_values.old_gen_used()); --- old/src/share/vm/gc/shared/genCollectedHeap.cpp 2017-09-01 13:03:02.658326217 +0200 +++ new/src/share/vm/gc/shared/genCollectedHeap.cpp 2017-09-01 13:03:02.518320654 +0200 @@ -1162,12 +1162,8 @@ } void GenCollectedHeap::print_tracing_info() const { - if (TraceYoungGenTime) { - _young_gen->print_summary_info(); - } - if (TraceOldGenTime) { - _old_gen->print_summary_info(); - } + _young_gen->print_summary_info(); + _old_gen->print_summary_info(); } void GenCollectedHeap::print_heap_change(size_t young_prev_used, size_t old_prev_used) const { --- old/src/share/vm/gc/shared/generation.cpp 2017-09-01 13:03:03.342353399 +0200 +++ new/src/share/vm/gc/shared/generation.cpp 2017-09-01 13:03:03.206347994 +0200 @@ -94,23 +94,15 @@ p2i(_virtual_space.high_boundary())); } -void Generation::print_summary_info() { print_summary_info_on(tty); } - -void Generation::print_summary_info_on(outputStream* st) { +void Generation::print_summary_info() { StatRecord* sr = stat_record(); double time = sr->accumulated_time.seconds(); - // I didn't want to change the logging when removing the level concept, - // but I guess this logging could say young/old or something instead of 0/1. - uint level; - if (GenCollectedHeap::heap()->is_young_gen(this)) { - level = 0; - } else { - level = 1; - } - st->print_cr("[Accumulated GC generation %d time %3.7f secs, " - "%u GC's, avg GC time %3.7f]", - level, time, sr->invocations, - sr->invocations > 0 ? time / sr->invocations : 0.0); + log_debug(gc, heap, exit)("Accumulated %s generation GC time %3.7f secs, " + "%u GC's, avg GC time %3.7f", + GenCollectedHeap::heap()->is_young_gen(this) ? "young" : "old" , + time, + sr->invocations, + sr->invocations > 0 ? time / sr->invocations : 0.0); } // Utility iterator classes --- old/src/share/vm/gc/shared/generation.hpp 2017-09-01 13:03:03.966378196 +0200 +++ new/src/share/vm/gc/shared/generation.hpp 2017-09-01 13:03:03.830372791 +0200 @@ -550,7 +550,6 @@ StatRecord* stat_record() { return &_stat_record; } virtual void print_summary_info(); - virtual void print_summary_info_on(outputStream* st); // Performance Counter support virtual void update_counters() = 0; --- old/src/share/vm/runtime/globals.hpp 2017-09-01 13:03:04.606403629 +0200 +++ new/src/share/vm/runtime/globals.hpp 2017-09-01 13:03:04.462397906 +0200 @@ -2344,12 +2344,6 @@ range(30*K, max_uintx/BytesPerWord) \ constraint(InitialBootClassLoaderMetaspaceSizeConstraintFunc, AfterErgo)\ \ - product(bool, TraceYoungGenTime, false, \ - "Trace accumulated time for young collection") \ - \ - product(bool, TraceOldGenTime, false, \ - "Trace accumulated time for old collection") \ - \ product(bool, PrintHeapAtSIGBREAK, true, \ "Print heap layout in response to SIGBREAK") \ \