# HG changeset patch # User jmasa # Date 1357347886 28800 # Node ID 0b54ffe4c2d37fe7609fb4369813af6650a850ef # Parent 6e9174173e00ad8060d6f283d16e6e4f99e91991 8005672: Clean up some changes to GC logging with GCCause's Reviewed-by: johnc, ysr diff -r 6e9174173e00 -r 0b54ffe4c2d3 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Fri Jan 04 17:04:25 2013 -0800 +++ b/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 6e9174173e00 -r 0b54ffe4c2d3 src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Jan 04 17:04:25 2013 -0800 +++ b/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 6e9174173e00 -r 0b54ffe4c2d3 src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp Fri Jan 04 17:04:25 2013 -0800 +++ b/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 6e9174173e00 -r 0b54ffe4c2d3 src/share/vm/gc_interface/gcCause.hpp --- a/src/share/vm/gc_interface/gcCause.hpp Fri Jan 04 17:04:25 2013 -0800 +++ b/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));