src/hotspot/share/gc/shared/allocTracer.cpp
changeset 50113 caf115bb98ad
parent 47779 24022215d092
--- a/src/hotspot/share/gc/shared/allocTracer.cpp	Tue May 15 11:28:29 2018 -0700
+++ b/src/hotspot/share/gc/shared/allocTracer.cpp	Tue May 15 20:24:34 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -24,13 +24,16 @@
 
 #include "precompiled.hpp"
 #include "gc/shared/allocTracer.hpp"
+#include "jfr/jfrEvents.hpp"
 #include "runtime/handles.hpp"
-#include "trace/tracing.hpp"
-#include "trace/traceMacros.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+#if INCLUDE_JFR
+#include "jfr/support/jfrAllocationTracer.hpp"
+#endif
 
 void AllocTracer::send_allocation_outside_tlab(Klass* klass, HeapWord* obj, size_t alloc_size, Thread* thread) {
-  TRACE_ALLOCATION(obj, alloc_size, thread);
+  JFR_ONLY(JfrAllocationTracer tracer(obj, alloc_size, thread);)
   EventObjectAllocationOutsideTLAB event;
   if (event.should_commit()) {
     event.set_objectClass(klass);
@@ -40,7 +43,7 @@
 }
 
 void AllocTracer::send_allocation_in_new_tlab(Klass* klass, HeapWord* obj, size_t tlab_size, size_t alloc_size, Thread* thread) {
-  TRACE_ALLOCATION(obj, tlab_size, thread);
+  JFR_ONLY(JfrAllocationTracer tracer(obj, alloc_size, thread);)
   EventObjectAllocationInNewTLAB event;
   if (event.should_commit()) {
     event.set_objectClass(klass);