src/hotspot/share/c1/c1_GraphBuilder.cpp
changeset 50113 caf115bb98ad
parent 49877 d84f06a0cae1
child 51333 f6641fcf7b7e
--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp	Tue May 15 11:28:29 2018 -0700
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp	Tue May 15 20:24:34 2018 +0200
@@ -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 @@
   }
 }
 
+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 @@
         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);