< prev index next >

src/share/vm/gc_implementation/shared/objectCountEventSender.cpp

Print this page
rev 8957 : 8223147: JFR Backport
8199712: Flight Recorder
8203346: JFR: Inconsistent signature of jfr_add_string_constant
8195817: JFR.stop should require name of recording
8195818: JFR.start should increase autogenerated name by one
8195819: Remove recording=x from jcmd JFR.check output
8203921: JFR thread sampling is missing fixes from JDK-8194552
8203929: Limit amount of data for JFR.dump
8203664: JFR start failure after AppCDS archive created with JFR StartFlightRecording
8003209: JFR events for network utilization
8207392: [PPC64] Implement JFR profiling

*** 24,59 **** #include "precompiled.hpp" #include "gc_implementation/shared/gcId.hpp" #include "gc_implementation/shared/objectCountEventSender.hpp" #include "memory/heapInspection.hpp" - #include "trace/tracing.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" #include "utilities/ticks.hpp" #if INCLUDE_SERVICES ! void ObjectCountEventSender::send(const KlassInfoEntry* entry, GCId gc_id, const Ticks& timestamp) { ! #if INCLUDE_TRACE ! assert(Tracing::is_event_enabled(EventObjectCountAfterGC::eventId), ! "Only call this method if the event is enabled"); ! EventObjectCountAfterGC event(UNTIMED); event.set_gcId(gc_id.id()); ! event.set_class(entry->klass()); ! event.set_count(entry->count()); ! event.set_totalSize(entry->words() * BytesPerWord); event.set_endtime(timestamp); event.commit(); ! #endif // INCLUDE_TRACE } ! bool ObjectCountEventSender::should_send_event() { ! #if INCLUDE_TRACE ! return Tracing::is_event_enabled(EventObjectCountAfterGC::eventId); ! #else ! return false; ! #endif // INCLUDE_TRACE } #endif // INCLUDE_SERVICES --- 24,78 ---- #include "precompiled.hpp" #include "gc_implementation/shared/gcId.hpp" #include "gc_implementation/shared/objectCountEventSender.hpp" + #include "jfr/jfrEvents.hpp" #include "memory/heapInspection.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" #include "utilities/ticks.hpp" + + #if INCLUDE_SERVICES ! bool ObjectCountEventSender::should_send_event() { ! #if INCLUDE_JFR ! return _should_send_requestable_event || EventObjectCountAfterGC::is_enabled(); ! #else ! return false; ! #endif // INCLUDE_JFR ! } ! bool ObjectCountEventSender::_should_send_requestable_event = false; ! ! void ObjectCountEventSender::enable_requestable_event() { ! _should_send_requestable_event = true; ! } ! ! void ObjectCountEventSender::disable_requestable_event() { ! _should_send_requestable_event = false; ! } ! ! template <typename T> ! void ObjectCountEventSender::send_event_if_enabled(Klass* klass, GCId gc_id, jlong count, julong size, const Ticks& timestamp) { ! T event(UNTIMED); ! if (event.should_commit()) { event.set_gcId(gc_id.id()); ! event.set_objectClass(klass); ! event.set_count(count); ! event.set_totalSize(size); event.set_endtime(timestamp); event.commit(); ! } } ! void ObjectCountEventSender::send(const KlassInfoEntry* entry, GCId gc_id, const Ticks& timestamp) { ! Klass* klass = entry->klass(); ! jlong count = entry->count(); ! julong total_size = entry->words() * BytesPerWord; ! ! send_event_if_enabled<EventObjectCount>(klass, gc_id, count, total_size, timestamp); ! send_event_if_enabled<EventObjectCountAfterGC>(klass, gc_id, count, total_size, timestamp); } #endif // INCLUDE_SERVICES
< prev index next >