8242400: Shenandoah: Restore logging to pre-jdk8241984 format

Reviewed-by: shade
This commit is contained in:
Zhengyu Gu 2020-04-09 08:43:03 -04:00
parent cdfe841d3d
commit 136450572e
3 changed files with 9 additions and 7 deletions

View File

@ -2817,7 +2817,7 @@ void ShenandoahHeap::entry_roots() {
void ShenandoahHeap::entry_cleanup() {
static const char* msg = "Concurrent cleanup";
ShenandoahConcurrentPhase gc_phase(msg);
ShenandoahConcurrentPhase gc_phase(msg, true /* log_heap_usage */);
EventMark em("%s", msg);
ShenandoahGCSubPhase phase(ShenandoahPhaseTimings::conc_cleanup);

View File

@ -86,7 +86,7 @@ ShenandoahGCPauseMark::ShenandoahGCPauseMark(uint gc_id, SvcGCMarker::reason_typ
}
ShenandoahPausePhase::ShenandoahPausePhase(const char* title) :
GCTraceTimeWrapper<LogLevel::Info, LOG_TAGS(gc)>(title),
_tracer(title),
_timer(ShenandoahHeap::heap()->gc_timer()) {
_timer->register_gc_pause_start(title);
}
@ -95,8 +95,8 @@ ShenandoahPausePhase::~ShenandoahPausePhase() {
_timer->register_gc_pause_end();
}
ShenandoahConcurrentPhase::ShenandoahConcurrentPhase(const char* title) :
GCTraceConcTimeImpl<LogLevel::Info, LOG_TAGS(gc)>(title),
ShenandoahConcurrentPhase::ShenandoahConcurrentPhase(const char* title, bool log_heap_usage) :
_tracer(title, NULL, GCCause::_no_gc, log_heap_usage),
_timer(ShenandoahHeap::heap()->gc_timer()) {
_timer->register_gc_concurrent_start(title);
}

View File

@ -54,8 +54,9 @@ public:
~ShenandoahGCSession();
};
class ShenandoahPausePhase : public GCTraceTimeWrapper<LogLevel::Info, LOG_TAGS(gc)> {
class ShenandoahPausePhase : public StackObj {
private:
GCTraceTimeWrapper<LogLevel::Info, LOG_TAGS(gc)> _tracer;
ConcurrentGCTimer* const _timer;
public:
@ -63,12 +64,13 @@ public:
~ShenandoahPausePhase();
};
class ShenandoahConcurrentPhase : public GCTraceConcTimeImpl<LogLevel::Info, LOG_TAGS(gc)> {
class ShenandoahConcurrentPhase : public StackObj {
private:
GCTraceTimeWrapper<LogLevel::Info, LOG_TAGS(gc)> _tracer;
ConcurrentGCTimer* const _timer;
public:
ShenandoahConcurrentPhase(const char* title);
ShenandoahConcurrentPhase(const char* title, bool log_heap_usage = false);
~ShenandoahConcurrentPhase();
};