Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8241001: Improve logging in the ConcurrentGCBreakpoint mechanism
Demoted most breakpoint logging to trace level.

Reviewed-by: pliden, sjohanss
  • Loading branch information
Kim Barrett committed Mar 20, 2020
1 parent 104927e commit 333a832cea163f2217c232c4412b0a17fd1f00e6
Showing with 11 additions and 12 deletions.
  1. +9 −11 src/hotspot/share/gc/shared/concurrentGCBreakpoints.cpp
  2. +2 −1 src/hotspot/share/logging/logPrefix.hpp
@@ -68,10 +68,10 @@ void ConcurrentGCBreakpoints::run_to_idle_impl(bool acquiring_control) {
MonitorLocker ml(monitor());
if (acquiring_control) {
assert(!is_controlled(), "precondition");
log_debug(gc, breakpoint)("acquire_control");
log_trace(gc, breakpoint)("acquire_control");
} else {
assert(is_controlled(), "precondition");
log_debug(gc, breakpoint)("run_to_idle");
log_trace(gc, breakpoint)("run_to_idle");
}
reset_request_state();
_want_idle = true;
@@ -88,7 +88,7 @@ void ConcurrentGCBreakpoints::acquire_control() {
void ConcurrentGCBreakpoints::release_control() {
assert_Java_thread();
MonitorLocker ml(monitor());
log_debug(gc, breakpoint)("release_control");
log_trace(gc, breakpoint)("release_control");
reset_request_state();
ml.notify_all();
}
@@ -103,13 +103,13 @@ bool ConcurrentGCBreakpoints::run_to(const char* breakpoint) {

MonitorLocker ml(monitor());
assert(is_controlled(), "precondition");
log_debug(gc, breakpoint)("run_to %s", breakpoint);
log_trace(gc, breakpoint)("run_to %s", breakpoint);
reset_request_state();
_run_to = breakpoint;
ml.notify_all();

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());
Universe::heap()->collect(GCCause::_wb_breakpoint);
}
@@ -119,10 +119,10 @@ bool ConcurrentGCBreakpoints::run_to(const char* breakpoint) {
if (_want_idle) {
// Completed cycle and resumed idle without hitting requested stop.
// 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.
} 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.
} else {
ml.wait();
@@ -159,18 +159,16 @@ void ConcurrentGCBreakpoints::notify_active_to_idle() {
// Notify pending run_to request of miss by replacing the run_to() request
// with a run_to_idle() request.
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;
_want_idle = true;
} else {
log_debug(gc, breakpoint)("Now idle");
}
_is_idle = true;
monitor()->notify_all();
}

void ConcurrentGCBreakpoints::notify_idle_to_active() {
assert_locked_or_safepoint(monitor());
log_debug(gc, breakpoint)("Now active");
_is_idle = false;
}
@@ -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.
*
* 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, region)) \
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, compaction)) \
LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, cpu)) \

0 comments on commit 333a832

Please sign in to comment.