mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-24 21:34:52 +02:00
8005849: JEP 167: Event-Based JVM Tracing
Co-authored-by: Karen Kinnear <karen.kinnear@oracle.com> Co-authored-by: Bengt Rutisson <bengt.rutisson@oracle.com> Co-authored-by: Calvin Cheung <calvin.cheung@oracle.com> Co-authored-by: Erik Gahlin <erik.gahlin@oracle.com> Co-authored-by: Erik Helin <erik.helin@oracle.com> Co-authored-by: Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com> Co-authored-by: Keith McGuigan <keith.mcguigan@oracle.com> Co-authored-by: Mattias Tobiasson <mattias.tobiasson@oracle.com> Co-authored-by: Markus Gronlund <markus.gronlund@oracle.com> Co-authored-by: Mikael Auno <mikael.auno@oracle.com> Co-authored-by: Nils Eliasson <nils.eliasson@oracle.com> Co-authored-by: Nils Loodin <nils.loodin@oracle.com> Co-authored-by: Rickard Backman <rickard.backman@oracle.com> Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com> Co-authored-by: Yekaterina Kantserova <yekaterina.kantserova@oracle.com> Reviewed-by: acorn, coleenp, sla
This commit is contained in:
parent
6b2c468c35
commit
718f3252f6
195 changed files with 7628 additions and 1484 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -43,6 +43,7 @@
|
|||
#include "runtime/os.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/sweeper.hpp"
|
||||
#include "trace/tracing.hpp"
|
||||
#include "utilities/dtrace.hpp"
|
||||
#include "utilities/events.hpp"
|
||||
#ifdef COMPILER1
|
||||
|
@ -179,9 +180,11 @@ int CompileBroker::_sum_standard_bytes_compiled = 0;
|
|||
int CompileBroker::_sum_nmethod_size = 0;
|
||||
int CompileBroker::_sum_nmethod_code_size = 0;
|
||||
|
||||
CompileQueue* CompileBroker::_c2_method_queue = NULL;
|
||||
CompileQueue* CompileBroker::_c1_method_queue = NULL;
|
||||
CompileTask* CompileBroker::_task_free_list = NULL;
|
||||
long CompileBroker::_peak_compilation_time = 0;
|
||||
|
||||
CompileQueue* CompileBroker::_c2_method_queue = NULL;
|
||||
CompileQueue* CompileBroker::_c1_method_queue = NULL;
|
||||
CompileTask* CompileBroker::_task_free_list = NULL;
|
||||
|
||||
GrowableArray<CompilerThread*>* CompileBroker::_method_threads = NULL;
|
||||
|
||||
|
@ -1795,6 +1798,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
|||
ciMethod* target = ci_env.get_method_from_handle(target_handle);
|
||||
|
||||
TraceTime t1("compilation", &time);
|
||||
EventCompilation event;
|
||||
|
||||
AbstractCompiler *comp = compiler(task_level);
|
||||
if (comp == NULL) {
|
||||
|
@ -1836,6 +1840,16 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
|||
}
|
||||
// simulate crash during compilation
|
||||
assert(task->compile_id() != CICrashAt, "just as planned");
|
||||
if (event.should_commit()) {
|
||||
event.set_method(target->get_Method());
|
||||
event.set_compileID(compile_id);
|
||||
event.set_compileLevel(task->comp_level());
|
||||
event.set_succeded(task->is_success());
|
||||
event.set_isOsr(is_osr);
|
||||
event.set_codeSize((task->code() == NULL) ? 0 : task->code()->total_size());
|
||||
event.set_inlinedBytes(task->num_inlined_bytecodes());
|
||||
event.commit();
|
||||
}
|
||||
}
|
||||
pop_jni_handle_block();
|
||||
|
||||
|
@ -1916,6 +1930,10 @@ void CompileBroker::handle_full_code_cache() {
|
|||
}
|
||||
warning("CodeCache is full. Compiler has been disabled.");
|
||||
warning("Try increasing the code cache size using -XX:ReservedCodeCacheSize=");
|
||||
|
||||
CodeCache::report_codemem_full();
|
||||
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (CompileTheWorld || ExitOnFullCodeCache) {
|
||||
codecache_print(/* detailed= */ true);
|
||||
|
@ -2073,8 +2091,10 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
|
|||
// 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) {
|
||||
_t_total_compilation.add(time);
|
||||
if (is_osr) {
|
||||
_t_osr_compilation.add(time);
|
||||
_sum_osr_bytes_compiled += method->code_size() + task->num_inlined_bytecodes();
|
||||
|
@ -2172,7 +2192,6 @@ void CompileBroker::print_times() {
|
|||
tty->print_cr(" nmethod total size : %6d bytes", CompileBroker::_sum_nmethod_size);
|
||||
}
|
||||
|
||||
|
||||
// Debugging output for failure
|
||||
void CompileBroker::print_last_compile() {
|
||||
if ( _last_compile_level != CompLevel_none &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue