# HG changeset patch # User jmasa # Date 1357347886 28800 # Node ID 8ce5dcdbeb2623cae4ee040a88189461df54007f # Parent 80724d2b6f25f0946f930f9d6155e47bc21862bf 8005672: Clean up some changes to GC logging with GCCause's Reviewed-by: johnc, ysr diff -r 80724d2b6f25 -r 8ce5dcdbeb26 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Fri Jan 04 17:04:25 2013 -0800 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Fri Jan 04 17:04:46 2013 -0800 @@ -827,10 +827,10 @@ GenCollectedHeap* gch = GenCollectedHeap::heap(); if (PrintGCDetails) { if (Verbose) { - gclog_or_tty->print(" [%d %s-%s: "SIZE_FORMAT"("SIZE_FORMAT")]", + gclog_or_tty->print("[%d %s-%s: "SIZE_FORMAT"("SIZE_FORMAT")]", level(), short_name(), s, used(), capacity()); } else { - gclog_or_tty->print(" [%d %s-%s: "SIZE_FORMAT"K("SIZE_FORMAT"K)]", + gclog_or_tty->print("[%d %s-%s: "SIZE_FORMAT"K("SIZE_FORMAT"K)]", level(), short_name(), s, used() / K, capacity() / K); } } diff -r 80724d2b6f25 -r 8ce5dcdbeb26 hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Jan 04 17:04:25 2013 -0800 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Jan 04 17:04:46 2013 -0800 @@ -3668,7 +3668,7 @@ gclog_or_tty->stamp(PrintGCTimeStamps); GCCauseString gc_cause_str = GCCauseString("GC pause", gc_cause()) - .append(g1_policy()->gcs_are_young() ? " (young)" : " (mixed)") + .append(g1_policy()->gcs_are_young() ? "(young)" : "(mixed)") .append(g1_policy()->during_initial_mark_pause() ? " (initial-mark)" : ""); gclog_or_tty->print("[%s", (const char*)gc_cause_str); diff -r 80724d2b6f25 -r 8ce5dcdbeb26 hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp Fri Jan 04 17:04:25 2013 -0800 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp Fri Jan 04 17:04:46 2013 -0800 @@ -808,8 +808,9 @@ st->print(" to "); to_space()->print_on(st); } +// Note that a space is not printed before the [NAME: void PSYoungGen::print_used_change(size_t prev_used) const { - gclog_or_tty->print(" [%s:", name()); + gclog_or_tty->print("[%s:", name()); gclog_or_tty->print(" " SIZE_FORMAT "K" "->" SIZE_FORMAT "K" "(" SIZE_FORMAT "K)", diff -r 80724d2b6f25 -r 8ce5dcdbeb26 hotspot/src/share/vm/gc_interface/gcCause.hpp --- a/hotspot/src/share/vm/gc_interface/gcCause.hpp Fri Jan 04 17:04:25 2013 -0800 +++ b/hotspot/src/share/vm/gc_interface/gcCause.hpp Fri Jan 04 17:04:46 2013 -0800 @@ -99,9 +99,9 @@ public: GCCauseString(const char* prefix, GCCause::Cause cause) { if (PrintGCCause) { - _position = jio_snprintf(_buffer, _length, "%s (%s)", prefix, GCCause::to_string(cause)); + _position = jio_snprintf(_buffer, _length, "%s (%s) ", prefix, GCCause::to_string(cause)); } else { - _position = jio_snprintf(_buffer, _length, "%s", prefix); + _position = jio_snprintf(_buffer, _length, "%s ", prefix); } assert(_position >= 0 && _position <= _length, err_msg("Need to increase the buffer size in GCCauseString? %d", _position));