--- old/src/share/vm/gc_interface/allocTracer.cpp 2020-01-16 16:56:30.743457790 +0300 +++ new/src/share/vm/gc_interface/allocTracer.cpp 2020-01-16 16:56:30.695459339 +0300 @@ -28,22 +28,25 @@ #include "jfr/jfrEvents.hpp" #include "runtime/handles.hpp" #include "utilities/globalDefinitions.hpp" -#if INCLUDE_JFR #include "jfr/support/jfrAllocationTracer.hpp" -#endif void AllocTracer::send_allocation_outside_tlab_event(KlassHandle klass, HeapWord* obj, size_t alloc_size, Thread* thread) { JFR_ONLY(JfrAllocationTracer tracer(obj, alloc_size, thread);) + +#if INCLUDE_JFR EventObjectAllocationOutsideTLAB event; if (event.should_commit()) { event.set_objectClass(klass()); event.set_allocationSize(alloc_size); event.commit(); } +#endif } void AllocTracer::send_allocation_in_new_tlab_event(KlassHandle klass, HeapWord* obj, size_t tlab_size, size_t alloc_size, Thread* thread) { JFR_ONLY(JfrAllocationTracer tracer(obj, alloc_size, thread);) + +#if INCLUDE_JFR EventObjectAllocationInNewTLAB event; if (event.should_commit()) { event.set_objectClass(klass()); @@ -51,13 +54,16 @@ event.set_tlabSize(tlab_size); event.commit(); } +#endif } void AllocTracer::send_allocation_requiring_gc_event(size_t size, const GCId& gcId) { +#if INCLUDE_JFR EventAllocationRequiringGC event; if (event.should_commit()) { event.set_gcId(gcId.id()); event.set_size(size); event.commit(); } +#endif }