8241001: Improve logging in the ConcurrentGCBreakpoint mechanism

Demoted most breakpoint logging to trace level.

Reviewed-by: pliden, sjohanss
This commit is contained in:
Kim Barrett 2020-03-20 01:20:37 -04:00
parent 104927e514
commit 333a832cea
2 changed files with 11 additions and 12 deletions

View File

@ -68,10 +68,10 @@ void ConcurrentGCBreakpoints::run_to_idle_impl(bool acquiring_control) {
MonitorLocker ml(monitor()); MonitorLocker ml(monitor());
if (acquiring_control) { if (acquiring_control) {
assert(!is_controlled(), "precondition"); assert(!is_controlled(), "precondition");
log_debug(gc, breakpoint)("acquire_control"); log_trace(gc, breakpoint)("acquire_control");
} else { } else {
assert(is_controlled(), "precondition"); assert(is_controlled(), "precondition");
log_debug(gc, breakpoint)("run_to_idle"); log_trace(gc, breakpoint)("run_to_idle");
} }
reset_request_state(); reset_request_state();
_want_idle = true; _want_idle = true;
@ -88,7 +88,7 @@ void ConcurrentGCBreakpoints::acquire_control() {
void ConcurrentGCBreakpoints::release_control() { void ConcurrentGCBreakpoints::release_control() {
assert_Java_thread(); assert_Java_thread();
MonitorLocker ml(monitor()); MonitorLocker ml(monitor());
log_debug(gc, breakpoint)("release_control"); log_trace(gc, breakpoint)("release_control");
reset_request_state(); reset_request_state();
ml.notify_all(); ml.notify_all();
} }
@ -103,13 +103,13 @@ bool ConcurrentGCBreakpoints::run_to(const char* breakpoint) {
MonitorLocker ml(monitor()); MonitorLocker ml(monitor());
assert(is_controlled(), "precondition"); assert(is_controlled(), "precondition");
log_debug(gc, breakpoint)("run_to %s", breakpoint); log_trace(gc, breakpoint)("run_to %s", breakpoint);
reset_request_state(); reset_request_state();
_run_to = breakpoint; _run_to = breakpoint;
ml.notify_all(); ml.notify_all();
if (_is_idle) { if (_is_idle) {
log_debug(gc, breakpoint)("run_to requesting collection %s", breakpoint); log_trace(gc, breakpoint)("run_to requesting collection %s", breakpoint);
MutexUnlocker mul(monitor()); MutexUnlocker mul(monitor());
Universe::heap()->collect(GCCause::_wb_breakpoint); Universe::heap()->collect(GCCause::_wb_breakpoint);
} }
@ -119,10 +119,10 @@ bool ConcurrentGCBreakpoints::run_to(const char* breakpoint) {
if (_want_idle) { if (_want_idle) {
// Completed cycle and resumed idle without hitting requested stop. // Completed cycle and resumed idle without hitting requested stop.
// That replaced our request with a run_to_idle() request. // That replaced our request with a run_to_idle() request.
log_debug(gc, breakpoint)("run_to missed %s", breakpoint); log_trace(gc, breakpoint)("run_to missed %s", breakpoint);
return false; // Missed. return false; // Missed.
} else if (_is_stopped) { } else if (_is_stopped) {
log_debug(gc, breakpoint)("run_to stopped at %s", breakpoint); log_trace(gc, breakpoint)("run_to stopped at %s", breakpoint);
return true; // Success. return true; // Success.
} else { } else {
ml.wait(); ml.wait();
@ -159,11 +159,10 @@ void ConcurrentGCBreakpoints::notify_active_to_idle() {
// Notify pending run_to request of miss by replacing the run_to() request // Notify pending run_to request of miss by replacing the run_to() request
// with a run_to_idle() request. // with a run_to_idle() request.
if (_run_to != NULL) { if (_run_to != NULL) {
log_debug(gc, breakpoint)("Now idle and clearing breakpoint %s", _run_to); log_debug(gc, breakpoint)
("Concurrent cycle completed without reaching breakpoint %s", _run_to);
_run_to = NULL; _run_to = NULL;
_want_idle = true; _want_idle = true;
} else {
log_debug(gc, breakpoint)("Now idle");
} }
_is_idle = true; _is_idle = true;
monitor()->notify_all(); monitor()->notify_all();
@ -171,6 +170,5 @@ void ConcurrentGCBreakpoints::notify_active_to_idle() {
void ConcurrentGCBreakpoints::notify_idle_to_active() { void ConcurrentGCBreakpoints::notify_idle_to_active() {
assert_locked_or_safepoint(monitor()); assert_locked_or_safepoint(monitor());
log_debug(gc, breakpoint)("Now active");
_is_idle = false; _is_idle = false;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -48,6 +48,7 @@ DEBUG_ONLY(size_t Test_log_prefix_prefixer(char* buf, size_t len);)
LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, alloc)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, alloc)) \
LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, alloc, region)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, alloc, region)) \
LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, barrier)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, barrier)) \
LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, breakpoint)) \
LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, classhisto)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, classhisto)) \
LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, compaction)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, compaction)) \
LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, cpu)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, cpu)) \