From 4956880699c1947cab78e7b3db1f705e731815d3 Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 29 Apr 2016 08:39:22 +0200 Subject: [PATCH] 8155245: Add logging when MMU target is violated Reviewed-by: ehelin, mgerdin --- hotspot/src/share/vm/gc/g1/g1MMUTracker.cpp | 5 +++++ hotspot/src/share/vm/logging/logPrefix.hpp | 1 + hotspot/src/share/vm/logging/logTag.hpp | 1 + 3 files changed, 7 insertions(+) diff --git a/hotspot/src/share/vm/gc/g1/g1MMUTracker.cpp b/hotspot/src/share/vm/gc/g1/g1MMUTracker.cpp index e8c7a4e9f9b..fdb99afe7b7 100644 --- a/hotspot/src/share/vm/gc/g1/g1MMUTracker.cpp +++ b/hotspot/src/share/vm/gc/g1/g1MMUTracker.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/g1/g1MMUTracker.hpp" #include "gc/shared/gcTrace.hpp" +#include "logging/log.hpp" #include "runtime/mutexLocker.hpp" #include "utilities/ostream.hpp" @@ -107,6 +108,10 @@ void G1MMUTrackerQueue::add_pause(double start, double end) { // Current entry needs to be added before calculating the value double slice_time = calculate_gc_time(end); G1MMUTracer::report_mmu(_time_slice, slice_time, _max_gc_time); + + if (slice_time >= _max_gc_time) { + log_info(gc, mmu)("MMU target violated: %.1lfms (%.1lfms/%.1lfms)", slice_time * 1000.0, _max_gc_time * 1000.0, _time_slice * 1000); + } } // basically the _internal call does not remove expired entries diff --git a/hotspot/src/share/vm/logging/logPrefix.hpp b/hotspot/src/share/vm/logging/logPrefix.hpp index 8d2ae12adf3..7e4da0f058e 100644 --- a/hotspot/src/share/vm/logging/logPrefix.hpp +++ b/hotspot/src/share/vm/logging/logPrefix.hpp @@ -64,6 +64,7 @@ DEBUG_ONLY(size_t Test_log_prefix_prefixer(char* buf, size_t len);) LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, liveness)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, marking)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, metaspace)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, mmu)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, phases)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, phases, start)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, phases, task)) \ diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index d9759dca859..1f0a1c31e2c 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -67,6 +67,7 @@ LOG_TAG(logging) \ LOG_TAG(marking) \ LOG_TAG(metaspace) \ + LOG_TAG(mmu) \ LOG_TAG(modules) \ LOG_TAG(monitorinflation) \ LOG_TAG(monitormismatch) \