1.1 --- a/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp Mon Mar 24 09:14:14 2014 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp Tue Mar 18 19:07:22 2014 +0100 1.3 @@ -27,6 +27,7 @@ 1.4 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" 1.5 #include "gc_implementation/g1/g1GCPhaseTimes.hpp" 1.6 #include "gc_implementation/g1/g1Log.hpp" 1.7 +#include "gc_implementation/g1/g1StringDedup.hpp" 1.8 1.9 // Helper class for avoiding interleaved logging 1.10 class LineBuffer: public StackObj { 1.11 @@ -168,7 +169,9 @@ 1.12 _last_termination_attempts(_max_gc_threads, SIZE_FORMAT), 1.13 _last_gc_worker_end_times_ms(_max_gc_threads, "%.1lf", false), 1.14 _last_gc_worker_times_ms(_max_gc_threads, "%.1lf"), 1.15 - _last_gc_worker_other_times_ms(_max_gc_threads, "%.1lf") 1.16 + _last_gc_worker_other_times_ms(_max_gc_threads, "%.1lf"), 1.17 + _cur_string_dedup_queue_fixup_worker_times_ms(_max_gc_threads, "%.1lf"), 1.18 + _cur_string_dedup_table_fixup_worker_times_ms(_max_gc_threads, "%.1lf") 1.19 { 1.20 assert(max_gc_threads > 0, "Must have some GC threads"); 1.21 } 1.22 @@ -229,6 +232,16 @@ 1.23 _last_gc_worker_other_times_ms.verify(); 1.24 } 1.25 1.26 +void G1GCPhaseTimes::note_string_dedup_fixup_start() { 1.27 + _cur_string_dedup_queue_fixup_worker_times_ms.reset(); 1.28 + _cur_string_dedup_table_fixup_worker_times_ms.reset(); 1.29 +} 1.30 + 1.31 +void G1GCPhaseTimes::note_string_dedup_fixup_end() { 1.32 + _cur_string_dedup_queue_fixup_worker_times_ms.verify(); 1.33 + _cur_string_dedup_table_fixup_worker_times_ms.verify(); 1.34 +} 1.35 + 1.36 void G1GCPhaseTimes::print_stats(int level, const char* str, double value) { 1.37 LineBuffer(level).append_and_print_cr("[%s: %.1lf ms]", str, value); 1.38 } 1.39 @@ -253,6 +266,11 @@ 1.40 // Strong code root purge time 1.41 misc_time_ms += _cur_strong_code_root_purge_time_ms; 1.42 1.43 + if (G1StringDedup::is_enabled()) { 1.44 + // String dedup fixup time 1.45 + misc_time_ms += _cur_string_dedup_fixup_time_ms; 1.46 + } 1.47 + 1.48 // Subtract the time taken to clean the card table from the 1.49 // current value of "other time" 1.50 misc_time_ms += _cur_clear_ct_time_ms; 1.51 @@ -303,6 +321,11 @@ 1.52 print_stats(1, "Code Root Fixup", _cur_collection_code_root_fixup_time_ms); 1.53 print_stats(1, "Code Root Migration", _cur_strong_code_root_migration_time_ms); 1.54 print_stats(1, "Code Root Purge", _cur_strong_code_root_purge_time_ms); 1.55 + if (G1StringDedup::is_enabled()) { 1.56 + print_stats(1, "String Dedup Fixup", _cur_string_dedup_fixup_time_ms, _active_gc_threads); 1.57 + _cur_string_dedup_queue_fixup_worker_times_ms.print(2, "Queue Fixup (ms)"); 1.58 + _cur_string_dedup_table_fixup_worker_times_ms.print(2, "Table Fixup (ms)"); 1.59 + } 1.60 print_stats(1, "Clear CT", _cur_clear_ct_time_ms); 1.61 double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms(); 1.62 print_stats(1, "Other", misc_time_ms);