1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Apr 25 15:51:10 2012 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Apr 25 12:36:37 2012 +0200 1.3 @@ -1248,12 +1248,13 @@ 1.4 IsGCActiveMark x; 1.5 1.6 // Timing 1.7 - bool system_gc = (gc_cause() == GCCause::_java_lang_system_gc); 1.8 - assert(!system_gc || explicit_gc, "invariant"); 1.9 + assert(gc_cause() != GCCause::_java_lang_system_gc || explicit_gc, "invariant"); 1.10 gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps); 1.11 TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); 1.12 - TraceTime t(system_gc ? "Full GC (System.gc())" : "Full GC", 1.13 - G1Log::fine(), true, gclog_or_tty); 1.14 + 1.15 + char verbose_str[128]; 1.16 + sprintf(verbose_str, "Full GC (%s)", GCCause::to_string(gc_cause())); 1.17 + TraceTime t(verbose_str, G1Log::fine(), true, gclog_or_tty); 1.18 1.19 TraceCollectorStats tcs(g1mm()->full_collection_counters()); 1.20 TraceMemoryManagerStats tms(true /* fullGC */, gc_cause()); 1.21 @@ -3588,25 +3589,22 @@ 1.22 1.23 // Inner scope for scope based logging, timers, and stats collection 1.24 { 1.25 - char verbose_str[128]; 1.26 - sprintf(verbose_str, "GC pause "); 1.27 - if (g1_policy()->gcs_are_young()) { 1.28 - strcat(verbose_str, "(young)"); 1.29 - } else { 1.30 - strcat(verbose_str, "(mixed)"); 1.31 - } 1.32 if (g1_policy()->during_initial_mark_pause()) { 1.33 - strcat(verbose_str, " (initial-mark)"); 1.34 // We are about to start a marking cycle, so we increment the 1.35 // full collection counter. 1.36 increment_total_full_collections(); 1.37 } 1.38 - 1.39 // if the log level is "finer" is on, we'll print long statistics information 1.40 // in the collector policy code, so let's not print this as the output 1.41 // is messy if we do. 1.42 gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps); 1.43 TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); 1.44 + 1.45 + char verbose_str[128]; 1.46 + sprintf(verbose_str, "GC pause (%s) (%s)%s", 1.47 + GCCause::to_string(gc_cause()), 1.48 + g1_policy()->gcs_are_young() ? "young" : "mixed", 1.49 + g1_policy()->during_initial_mark_pause() ? " (initial-mark)" : ""); 1.50 TraceTime t(verbose_str, G1Log::fine() && !G1Log::finer(), true, gclog_or_tty); 1.51 1.52 TraceCollectorStats tcs(g1mm()->incremental_collection_counters());