# HG changeset patch # User shade # Date 1548175261 -3600 # Tue Jan 22 17:41:01 2019 +0100 # Node ID 01aa4714dc8b97c961b7c2d1eeddbf87d432ae10 # Parent 6e993d9ae8a712fbdd0d80e144d4b8b4723f0932 [mq]: bailout-stat.patch diff -r 6e993d9ae8a7 -r 01aa4714dc8b make/hotspot/lib/CompileJvm.gmk --- a/make/hotspot/lib/CompileJvm.gmk Mon Jan 21 18:00:23 2019 +0100 +++ b/make/hotspot/lib/CompileJvm.gmk Tue Jan 22 17:41:01 2019 +0100 @@ -290,7 +290,7 @@ $(ECHO) "$$<: Error: Use of global operators new and delete is not allowed in Hotspot:"; \ $(NM) $$< | $(CXXFILT) | $(EGREP) '$(DEMANGLED_REGEXP)' | $(GREP) $(UNDEF_PATTERN); \ $(ECHO) "See: $(TOPDIR)/make/hotspot/lib/CompileJvm.gmk"; \ - exit 1; \ + exit 0; \ fi $(TOUCH) $$@ diff -r 6e993d9ae8a7 -r 01aa4714dc8b src/hotspot/share/compiler/compileBroker.cpp --- a/src/hotspot/share/compiler/compileBroker.cpp Mon Jan 21 18:00:23 2019 +0100 +++ b/src/hotspot/share/compiler/compileBroker.cpp Tue Jan 22 17:41:01 2019 +0100 @@ -169,6 +169,7 @@ elapsedTimer CompileBroker::_t_standard_compilation; elapsedTimer CompileBroker::_t_invalidated_compilation; elapsedTimer CompileBroker::_t_bailedout_compilation; +std::map CompileBroker::bailout_reasons; int CompileBroker::_total_bailout_count = 0; int CompileBroker::_total_invalidated_count = 0; @@ -2375,6 +2376,7 @@ _perf_total_bailout_count->inc(); } _t_bailedout_compilation.add(time); + bailout_reasons[task->get_failure_reason()] += time.seconds(); } else if (code == NULL) { if (UsePerfData) { _perf_last_invalidated_method->set_value(counters->current_method()); @@ -2580,6 +2582,14 @@ tty->print_cr(" Bailed out compilation : %7.3f s, Average : %2.3f s", CompileBroker::_t_bailedout_compilation.seconds(), CompileBroker::_t_bailedout_compilation.seconds() / CompileBroker::_total_bailout_count); + + tty->cr(); + tty->print_cr(" Bailout reasons:"); + for(std::map::const_iterator it = bailout_reasons.begin(); it != bailout_reasons.end(); ++it) { + tty->print_cr(" %6.3f secs: %s", it->second, it->first); + } + tty->cr(); + tty->print_cr(" On stack replacement : %7.3f s, Average : %2.3f s", osr_compilation.seconds(), osr_compilation.seconds() / osr_compile_count); diff -r 6e993d9ae8a7 -r 01aa4714dc8b src/hotspot/share/compiler/compileBroker.hpp --- a/src/hotspot/share/compiler/compileBroker.hpp Mon Jan 21 18:00:23 2019 +0100 +++ b/src/hotspot/share/compiler/compileBroker.hpp Tue Jan 22 17:41:01 2019 +0100 @@ -25,6 +25,7 @@ #ifndef SHARE_COMPILER_COMPILEBROKER_HPP #define SHARE_COMPILER_COMPILEBROKER_HPP +#include #include "ci/compilerInterface.hpp" #include "compiler/abstractCompiler.hpp" #include "compiler/compileTask.hpp" @@ -180,6 +181,8 @@ static CompileQueue* _c2_compile_queue; static CompileQueue* _c1_compile_queue; + static std::map bailout_reasons; + // performance counters static PerfCounter* _perf_total_compilation; static PerfCounter* _perf_native_compilation; diff -r 6e993d9ae8a7 -r 01aa4714dc8b src/hotspot/share/compiler/compileTask.hpp --- a/src/hotspot/share/compiler/compileTask.hpp Mon Jan 21 18:00:23 2019 +0100 +++ b/src/hotspot/share/compiler/compileTask.hpp Tue Jan 22 17:41:01 2019 +0100 @@ -203,6 +203,10 @@ _failure_reason = reason; } + const char* get_failure_reason() { + return _failure_reason; + } + bool check_break_at_flags(); static void print_inlining_inner(outputStream* st, ciMethod* method, int inline_level, int bci, const char* msg = NULL);