# HG changeset patch # User Rene Schuenemann # Date 1527684377 -7200 # Wed May 30 14:46:17 2018 +0200 # Node ID 7d651d1867175d3105d50ee8b90a2193c9f843e4 # Parent 48d4abe945f186e371633fcabee5aeb20d44cd4b 8204476: Add additional statistics to CodeCache::print_summary diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -1593,6 +1593,7 @@ } void CodeCache::print_summary(outputStream* st, bool detailed) { + int full_count = 0; FOR_ALL_HEAPS(heap_iterator) { CodeHeap* heap = (*heap_iterator); size_t total = (heap->high_boundary() - heap->low_boundary()); @@ -1611,6 +1612,8 @@ p2i(heap->low_boundary()), p2i(heap->high()), p2i(heap->high_boundary())); + + full_count += get_codemem_full_count(heap->code_blob_type()); } } @@ -1622,6 +1625,10 @@ "enabled" : Arguments::mode() == Arguments::_int ? "disabled (interpreter mode)" : "disabled (not enough contiguous free space left)"); + st->print_cr(" stopped_count=%d, restarted_count=%d", + CompileBroker::get_total_compiler_stopped_count(), + CompileBroker::get_total_compiler_restarted_count()); + st->print_cr(" full_count=%d", full_count); } } diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp --- a/src/hotspot/share/compiler/compileBroker.cpp +++ b/src/hotspot/share/compiler/compileBroker.cpp @@ -170,21 +170,23 @@ elapsedTimer CompileBroker::_t_invalidated_compilation; elapsedTimer CompileBroker::_t_bailedout_compilation; -int CompileBroker::_total_bailout_count = 0; -int CompileBroker::_total_invalidated_count = 0; -int CompileBroker::_total_compile_count = 0; -int CompileBroker::_total_osr_compile_count = 0; -int CompileBroker::_total_standard_compile_count = 0; +int CompileBroker::_total_bailout_count = 0; +int CompileBroker::_total_invalidated_count = 0; +int CompileBroker::_total_compile_count = 0; +int CompileBroker::_total_osr_compile_count = 0; +int CompileBroker::_total_standard_compile_count = 0; +int CompileBroker::_total_compiler_stopped_count = 0; +int CompileBroker::_total_compiler_restarted_count = 0; -int CompileBroker::_sum_osr_bytes_compiled = 0; -int CompileBroker::_sum_standard_bytes_compiled = 0; -int CompileBroker::_sum_nmethod_size = 0; -int CompileBroker::_sum_nmethod_code_size = 0; +int CompileBroker::_sum_osr_bytes_compiled = 0; +int CompileBroker::_sum_standard_bytes_compiled = 0; +int CompileBroker::_sum_nmethod_size = 0; +int CompileBroker::_sum_nmethod_code_size = 0; -long CompileBroker::_peak_compilation_time = 0; +long CompileBroker::_peak_compilation_time = 0; -CompileQueue* CompileBroker::_c2_compile_queue = NULL; -CompileQueue* CompileBroker::_c1_compile_queue = NULL; +CompileQueue* CompileBroker::_c2_compile_queue = NULL; +CompileQueue* CompileBroker::_c1_compile_queue = NULL; diff --git a/src/hotspot/share/compiler/compileBroker.hpp b/src/hotspot/share/compiler/compileBroker.hpp --- a/src/hotspot/share/compiler/compileBroker.hpp +++ b/src/hotspot/share/compiler/compileBroker.hpp @@ -219,6 +219,8 @@ static int _total_native_compile_count; static int _total_osr_compile_count; static int _total_standard_compile_count; + static int _total_compiler_stopped_count; + static int _total_compiler_restarted_count; static int _sum_osr_bytes_compiled; static int _sum_standard_bytes_compiled; static int _sum_nmethod_size; @@ -338,7 +340,15 @@ static bool set_should_compile_new_jobs(jint new_state) { // Return success if the current caller set it jint old = Atomic::cmpxchg(new_state, &_should_compile_new_jobs, 1-new_state); - return (old == (1-new_state)); + bool success = (old == (1-new_state)); + if (success) { + if (new_state == run_compilation) { + _total_compiler_restarted_count++; + } else { + _total_compiler_stopped_count++; + } + } + return success; } static void disable_compilation_forever() { @@ -393,18 +403,20 @@ static CompileLog* get_log(CompilerThread* ct); - static int get_total_compile_count() { return _total_compile_count; } - static int get_total_bailout_count() { return _total_bailout_count; } - static int get_total_invalidated_count() { return _total_invalidated_count; } - static int get_total_native_compile_count() { return _total_native_compile_count; } - static int get_total_osr_compile_count() { return _total_osr_compile_count; } - static int get_total_standard_compile_count() { return _total_standard_compile_count; } - static int get_sum_osr_bytes_compiled() { return _sum_osr_bytes_compiled; } - static int get_sum_standard_bytes_compiled() { return _sum_standard_bytes_compiled; } - static int get_sum_nmethod_size() { return _sum_nmethod_size;} - static int get_sum_nmethod_code_size() { return _sum_nmethod_code_size; } - static long get_peak_compilation_time() { return _peak_compilation_time; } - static long get_total_compilation_time() { return _t_total_compilation.milliseconds(); } + static int get_total_compile_count() { return _total_compile_count; } + static int get_total_bailout_count() { return _total_bailout_count; } + static int get_total_invalidated_count() { return _total_invalidated_count; } + static int get_total_native_compile_count() { return _total_native_compile_count; } + static int get_total_osr_compile_count() { return _total_osr_compile_count; } + static int get_total_standard_compile_count() { return _total_standard_compile_count; } + static int get_total_compiler_stopped_count() { return _total_compiler_stopped_count; } + static int get_total_compiler_restarted_count() { return _total_compiler_restarted_count; } + static int get_sum_osr_bytes_compiled() { return _sum_osr_bytes_compiled; } + static int get_sum_standard_bytes_compiled() { return _sum_standard_bytes_compiled; } + static int get_sum_nmethod_size() { return _sum_nmethod_size;} + static int get_sum_nmethod_code_size() { return _sum_nmethod_code_size; } + static long get_peak_compilation_time() { return _peak_compilation_time; } + static long get_total_compilation_time() { return _t_total_compilation.milliseconds(); } // Log that compilation profiling is skipped because metaspace is full. static void log_metaspace_failure();