8199712: Flight Recorder

Co-authored-by: Markus Gronlund <markus.gronlund@oracle.com>
Reviewed-by: coleenp, ihse, erikj, dsamersoff, mseledtsov, egahlin, mgronlun
This commit is contained in:
Erik Gahlin 2018-05-15 20:24:34 +02:00
parent f575533a17
commit a060be188d
1062 changed files with 119159 additions and 3164 deletions

View file

@ -35,6 +35,7 @@
#include "ci/ciUtilities.inline.hpp"
#include "compiler/compileBroker.hpp"
#include "interpreter/bytecode.hpp"
#include "jfr/jfrEvents.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/sharedRuntime.hpp"
@ -4300,6 +4301,30 @@ void GraphBuilder::append_char_access(ciMethod* callee, bool is_store) {
}
}
static void post_inlining_event(EventCompilerInlining* event,
int compile_id,
const char* msg,
bool success,
int bci,
ciMethod* caller,
ciMethod* callee) {
assert(caller != NULL, "invariant");
assert(callee != NULL, "invariant");
assert(event != NULL, "invariant");
assert(event->should_commit(), "invariant");
JfrStructCalleeMethod callee_struct;
callee_struct.set_type(callee->holder()->name()->as_utf8());
callee_struct.set_name(callee->name()->as_utf8());
callee_struct.set_descriptor(callee->signature()->as_symbol()->as_utf8());
event->set_compileId(compile_id);
event->set_message(msg);
event->set_succeeded(success);
event->set_bci(bci);
event->set_caller(caller->get_Method());
event->set_callee(callee_struct);
event->commit();
}
void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool success) {
CompileLog* log = compilation()->log();
if (log != NULL) {
@ -4315,18 +4340,10 @@ void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool succes
log->inline_fail("reason unknown");
}
}
#if INCLUDE_TRACE
EventCompilerInlining event;
if (event.should_commit()) {
event.set_compileId(compilation()->env()->task()->compile_id());
event.set_message(msg);
event.set_succeeded(success);
event.set_bci(bci());
event.set_caller(method()->get_Method());
event.set_callee(callee->to_trace_struct());
event.commit();
post_inlining_event(&event, compilation()->env()->task()->compile_id(), msg, success, bci(), method(), callee);
}
#endif // INCLUDE_TRACE
CompileTask::print_inlining_ul(callee, scope()->level(), bci(), msg);