# HG changeset patch # User Rene Schuenemann # Date 1527684377 -7200 # Wed May 30 14:46:17 2018 +0200 # Node ID 024bfa4c55b72770ab6ca6fa7aab18d7595d58fb # Parent 48d4abe945f186e371633fcabee5aeb20d44cd4b Print the code cache full count for all code heaps and add additional counters for compiler stopped and compiler started. 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 @@ -1602,9 +1602,10 @@ st->print("CodeCache:"); } st->print_cr(" size=" SIZE_FORMAT "Kb used=" SIZE_FORMAT - "Kb max_used=" SIZE_FORMAT "Kb free=" SIZE_FORMAT "Kb", + "Kb max_used=" SIZE_FORMAT "Kb free=" SIZE_FORMAT "Kb full_count=" UINT32_FORMAT, total/K, (total - heap->unallocated_capacity())/K, - heap->max_allocated_capacity()/K, heap->unallocated_capacity()/K); + heap->max_allocated_capacity()/K, heap->unallocated_capacity()/K, + get_codemem_full_count(heap->code_blob_type())); if (detailed) { st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]", @@ -1622,6 +1623,9 @@ "enabled" : Arguments::mode() == Arguments::_int ? "disabled (interpreter mode)" : "disabled (not enough contiguous free space left)"); + st->print_cr(" stopped_count=" UINT32_FORMAT " restarted_count=" UINT32_FORMAT, + CompileBroker::get_total_compiler_stopped_count(), + CompileBroker::get_total_compiler_restarted_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 += 1; + } else { + _total_compiler_stopped_count += 1; + } + } + 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();