mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 22:04:51 +02:00
8058968: Compiler time traces should be improved
Use CITime consistently, make C2 to report to CompilerBroker, more probes. Reviewed-by: vlivanov, jrose
This commit is contained in:
parent
d63b9025d8
commit
f824f8c3cb
19 changed files with 386 additions and 313 deletions
|
@ -137,6 +137,8 @@ PerfVariable* CompileBroker::_perf_last_invalidated_type = NULL;
|
|||
elapsedTimer CompileBroker::_t_total_compilation;
|
||||
elapsedTimer CompileBroker::_t_osr_compilation;
|
||||
elapsedTimer CompileBroker::_t_standard_compilation;
|
||||
elapsedTimer CompileBroker::_t_invalidated_compilation;
|
||||
elapsedTimer CompileBroker::_t_bailedout_compilation;
|
||||
|
||||
int CompileBroker::_total_bailout_count = 0;
|
||||
int CompileBroker::_total_invalidated_count = 0;
|
||||
|
@ -2236,6 +2238,11 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
|
|||
// _perf variables are production performance counters which are
|
||||
// updated regardless of the setting of the CITime and CITimeEach flags
|
||||
//
|
||||
|
||||
// account all time, including bailouts and failures in this counter;
|
||||
// C1 and C2 counters are counting both successful and unsuccessful compiles
|
||||
_t_total_compilation.add(time);
|
||||
|
||||
if (!success) {
|
||||
_total_bailout_count++;
|
||||
if (UsePerfData) {
|
||||
|
@ -2243,6 +2250,7 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
|
|||
_perf_last_failed_type->set_value(counters->compile_type());
|
||||
_perf_total_bailout_count->inc();
|
||||
}
|
||||
_t_bailedout_compilation.add(time);
|
||||
} else if (code == NULL) {
|
||||
if (UsePerfData) {
|
||||
_perf_last_invalidated_method->set_value(counters->current_method());
|
||||
|
@ -2250,14 +2258,13 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
|
|||
_perf_total_invalidated_count->inc();
|
||||
}
|
||||
_total_invalidated_count++;
|
||||
_t_invalidated_compilation.add(time);
|
||||
} else {
|
||||
// Compilation succeeded
|
||||
|
||||
// update compilation ticks - used by the implementation of
|
||||
// java.lang.management.CompilationMBean
|
||||
_perf_total_compilation->inc(time.ticks());
|
||||
|
||||
_t_total_compilation.add(time);
|
||||
_peak_compilation_time = time.milliseconds() > _peak_compilation_time ? time.milliseconds() : _peak_compilation_time;
|
||||
|
||||
if (CITime) {
|
||||
|
@ -2325,37 +2332,47 @@ const char* CompileBroker::compiler_name(int comp_level) {
|
|||
|
||||
void CompileBroker::print_times() {
|
||||
tty->cr();
|
||||
tty->print_cr("Accumulated compiler times (for compiled methods only)");
|
||||
tty->print_cr("------------------------------------------------");
|
||||
tty->print_cr("Accumulated compiler times");
|
||||
tty->print_cr("----------------------------------------------------------");
|
||||
//0000000000111111111122222222223333333333444444444455555555556666666666
|
||||
//0123456789012345678901234567890123456789012345678901234567890123456789
|
||||
tty->print_cr(" Total compilation time : %6.3f s", CompileBroker::_t_total_compilation.seconds());
|
||||
tty->print_cr(" Standard compilation : %6.3f s, Average : %2.3f",
|
||||
tty->print_cr(" Total compilation time : %7.3f s", CompileBroker::_t_total_compilation.seconds());
|
||||
tty->print_cr(" Standard compilation : %7.3f s, Average : %2.3f s",
|
||||
CompileBroker::_t_standard_compilation.seconds(),
|
||||
CompileBroker::_t_standard_compilation.seconds() / CompileBroker::_total_standard_compile_count);
|
||||
tty->print_cr(" On stack replacement : %6.3f s, Average : %2.3f", CompileBroker::_t_osr_compilation.seconds(), CompileBroker::_t_osr_compilation.seconds() / CompileBroker::_total_osr_compile_count);
|
||||
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->print_cr(" On stack replacement : %7.3f s, Average : %2.3f s",
|
||||
CompileBroker::_t_osr_compilation.seconds(),
|
||||
CompileBroker::_t_osr_compilation.seconds() / CompileBroker::_total_osr_compile_count);
|
||||
tty->print_cr(" Invalidated : %7.3f s, Average : %2.3f s",
|
||||
CompileBroker::_t_invalidated_compilation.seconds(),
|
||||
CompileBroker::_t_invalidated_compilation.seconds() / CompileBroker::_total_invalidated_count);
|
||||
|
||||
AbstractCompiler *comp = compiler(CompLevel_simple);
|
||||
if (comp != NULL) {
|
||||
tty->cr();
|
||||
comp->print_timers();
|
||||
}
|
||||
comp = compiler(CompLevel_full_optimization);
|
||||
if (comp != NULL) {
|
||||
tty->cr();
|
||||
comp->print_timers();
|
||||
}
|
||||
tty->cr();
|
||||
tty->print_cr(" Total compiled methods : %6d methods", CompileBroker::_total_compile_count);
|
||||
tty->print_cr(" Standard compilation : %6d methods", CompileBroker::_total_standard_compile_count);
|
||||
tty->print_cr(" On stack replacement : %6d methods", CompileBroker::_total_osr_compile_count);
|
||||
tty->print_cr(" Total compiled methods : %8d methods", CompileBroker::_total_compile_count);
|
||||
tty->print_cr(" Standard compilation : %8d methods", CompileBroker::_total_standard_compile_count);
|
||||
tty->print_cr(" On stack replacement : %8d methods", CompileBroker::_total_osr_compile_count);
|
||||
int tcb = CompileBroker::_sum_osr_bytes_compiled + CompileBroker::_sum_standard_bytes_compiled;
|
||||
tty->print_cr(" Total compiled bytecodes : %6d bytes", tcb);
|
||||
tty->print_cr(" Standard compilation : %6d bytes", CompileBroker::_sum_standard_bytes_compiled);
|
||||
tty->print_cr(" On stack replacement : %6d bytes", CompileBroker::_sum_osr_bytes_compiled);
|
||||
tty->print_cr(" Total compiled bytecodes : %8d bytes", tcb);
|
||||
tty->print_cr(" Standard compilation : %8d bytes", CompileBroker::_sum_standard_bytes_compiled);
|
||||
tty->print_cr(" On stack replacement : %8d bytes", CompileBroker::_sum_osr_bytes_compiled);
|
||||
int bps = (int)(tcb / CompileBroker::_t_total_compilation.seconds());
|
||||
tty->print_cr(" Average compilation speed: %6d bytes/s", bps);
|
||||
tty->print_cr(" Average compilation speed : %8d bytes/s", bps);
|
||||
tty->cr();
|
||||
tty->print_cr(" nmethod code size : %6d bytes", CompileBroker::_sum_nmethod_code_size);
|
||||
tty->print_cr(" nmethod total size : %6d bytes", CompileBroker::_sum_nmethod_size);
|
||||
tty->print_cr(" nmethod code size : %8d bytes", CompileBroker::_sum_nmethod_code_size);
|
||||
tty->print_cr(" nmethod total size : %8d bytes", CompileBroker::_sum_nmethod_size);
|
||||
}
|
||||
|
||||
// Debugging output for failure
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue