8155245: Add logging when MMU target is violated
authorsjohanss
Fri, 29 Apr 2016 08:39:22 +0200
changeset 38128 22391eb0c22d
parent 38127 2ab00cd4556e
child 38145 164415057be1
8155245: Add logging when MMU target is violated Reviewed-by: ehelin, mgerdin
hotspot/src/share/vm/gc/g1/g1MMUTracker.cpp
hotspot/src/share/vm/logging/logPrefix.hpp
hotspot/src/share/vm/logging/logTag.hpp
--- a/hotspot/src/share/vm/gc/g1/g1MMUTracker.cpp	Thu Apr 28 23:08:16 2016 -0700
+++ b/hotspot/src/share/vm/gc/g1/g1MMUTracker.cpp	Fri Apr 29 08:39:22 2016 +0200
@@ -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 @@
   // 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
--- a/hotspot/src/share/vm/logging/logPrefix.hpp	Thu Apr 28 23:08:16 2016 -0700
+++ b/hotspot/src/share/vm/logging/logPrefix.hpp	Fri Apr 29 08:39:22 2016 +0200
@@ -64,6 +64,7 @@
   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)) \
--- a/hotspot/src/share/vm/logging/logTag.hpp	Thu Apr 28 23:08:16 2016 -0700
+++ b/hotspot/src/share/vm/logging/logTag.hpp	Fri Apr 29 08:39:22 2016 +0200
@@ -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) \