1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Sat Apr 07 09:06:55 2012 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Fri Apr 13 01:59:38 2012 +0200 1.3 @@ -29,6 +29,7 @@ 1.4 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" 1.5 #include "gc_implementation/g1/g1CollectorPolicy.hpp" 1.6 #include "gc_implementation/g1/g1ErgoVerbose.hpp" 1.7 +#include "gc_implementation/g1/g1Log.hpp" 1.8 #include "gc_implementation/g1/heapRegionRemSet.hpp" 1.9 #include "gc_implementation/shared/gcPolicyCounters.hpp" 1.10 #include "runtime/arguments.hpp" 1.11 @@ -885,7 +886,7 @@ 1.12 1.13 void G1CollectorPolicy::record_collection_pause_start(double start_time_sec, 1.14 size_t start_used) { 1.15 - if (PrintGCDetails) { 1.16 + if (G1Log::finer()) { 1.17 gclog_or_tty->stamp(PrintGCTimeStamps); 1.18 gclog_or_tty->print("[GC pause"); 1.19 gclog_or_tty->print(" (%s)", gcs_are_young() ? "young" : "mixed"); 1.20 @@ -1022,11 +1023,16 @@ 1.21 if (val > max) 1.22 max = val; 1.23 total += val; 1.24 - buf.append(" %3.1lf", val); 1.25 + if (G1Log::finest()) { 1.26 + buf.append(" %.1lf", val); 1.27 + } 1.28 } 1.29 - buf.append_and_print_cr(""); 1.30 + 1.31 + if (G1Log::finest()) { 1.32 + buf.append_and_print_cr(""); 1.33 + } 1.34 double avg = total / (double) no_of_gc_threads(); 1.35 - buf.append_and_print_cr(" Avg: %5.1lf, Min: %5.1lf, Max: %5.1lf, Diff: %5.1lf]", 1.36 + buf.append_and_print_cr(" Avg: %.1lf Min: %.1lf Max: %.1lf Diff: %.1lf]", 1.37 avg, min, max, max - min); 1.38 } 1.39 1.40 @@ -1223,7 +1229,7 @@ 1.41 1.42 // These values are used to update the summary information that is 1.43 // displayed when TraceGen0Time is enabled, and are output as part 1.44 - // of the PrintGCDetails output, in the non-parallel case. 1.45 + // of the "finer" output, in the non-parallel case. 1.46 1.47 double ext_root_scan_time = avg_value(_par_last_ext_root_scan_times_ms); 1.48 double satb_filtering_time = avg_value(_par_last_satb_filtering_times_ms); 1.49 @@ -1356,8 +1362,7 @@ 1.50 } 1.51 } 1.52 1.53 - // PrintGCDetails output 1.54 - if (PrintGCDetails) { 1.55 + if (G1Log::finer()) { 1.56 bool print_marking_info = 1.57 _g1->mark_in_progress() && !last_pause_included_initial_mark; 1.58 1.59 @@ -1376,11 +1381,15 @@ 1.60 print_par_stats(2, "SATB Filtering", _par_last_satb_filtering_times_ms); 1.61 } 1.62 print_par_stats(2, "Update RS", _par_last_update_rs_times_ms); 1.63 - print_par_sizes(3, "Processed Buffers", _par_last_update_rs_processed_buffers); 1.64 + if (G1Log::finest()) { 1.65 + print_par_sizes(3, "Processed Buffers", _par_last_update_rs_processed_buffers); 1.66 + } 1.67 print_par_stats(2, "Scan RS", _par_last_scan_rs_times_ms); 1.68 print_par_stats(2, "Object Copy", _par_last_obj_copy_times_ms); 1.69 print_par_stats(2, "Termination", _par_last_termination_times_ms); 1.70 - print_par_sizes(3, "Termination Attempts", _par_last_termination_attempts); 1.71 + if (G1Log::finest()) { 1.72 + print_par_sizes(3, "Termination Attempts", _par_last_termination_attempts); 1.73 + } 1.74 1.75 for (int i = 0; i < _parallel_gc_threads; i++) { 1.76 _par_last_gc_worker_times_ms[i] = _par_last_gc_worker_end_times_ms[i] - 1.77 @@ -1406,7 +1415,9 @@ 1.78 print_stats(1, "SATB Filtering", satb_filtering_time); 1.79 } 1.80 print_stats(1, "Update RS", update_rs_time); 1.81 - print_stats(2, "Processed Buffers", (int)update_rs_processed_buffers); 1.82 + if (G1Log::finest()) { 1.83 + print_stats(2, "Processed Buffers", (int)update_rs_processed_buffers); 1.84 + } 1.85 print_stats(1, "Scan RS", scan_rs_time); 1.86 print_stats(1, "Object Copying", obj_copy_time); 1.87 } 1.88 @@ -1610,7 +1621,7 @@ 1.89 proper_unit_for_byte_size((bytes)) 1.90 1.91 void G1CollectorPolicy::print_heap_transition() { 1.92 - if (PrintGCDetails) { 1.93 + if (G1Log::finer()) { 1.94 YoungList* young_list = _g1->young_list(); 1.95 size_t eden_bytes = young_list->eden_used_bytes(); 1.96 size_t survivor_bytes = young_list->survivor_used_bytes(); 1.97 @@ -1637,7 +1648,7 @@ 1.98 EXT_SIZE_PARAMS(capacity)); 1.99 1.100 _prev_eden_capacity = eden_capacity; 1.101 - } else if (PrintGC) { 1.102 + } else if (G1Log::fine()) { 1.103 _g1->print_size_transition(gclog_or_tty, 1.104 _cur_collection_pause_used_at_start_bytes, 1.105 _g1->used(), _g1->capacity());