src/share/vm/gc_implementation/shared/gcTraceSend.cpp
Print this page
rev 5098 : 8020692: TestGCEventMixed.java failed because of timestamp in event after end event
*** 26,35 ****
--- 26,36 ----
#include "gc_implementation/shared/gcHeapSummary.hpp"
#include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
#include "gc_implementation/shared/gcWhen.hpp"
#include "gc_implementation/shared/copyFailedInfo.hpp"
+ #include "runtime/os.hpp"
#include "trace/tracing.hpp"
#include "trace/traceBackend.hpp"
#if INCLUDE_ALL_GCS
#include "gc_implementation/g1/evacuationInfo.hpp"
#include "gc_implementation/g1/g1YCTypes.hpp"
*** 52,66 ****
event.commit();
}
}
void GCTracer::send_reference_stats_event(ReferenceType type, size_t count) const {
! EventGCReferenceStatistics e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_type((u1)type);
e.set_count(count);
e.commit();
}
}
void ParallelOldTracer::send_parallel_old_event() const {
--- 53,68 ----
event.commit();
}
}
void GCTracer::send_reference_stats_event(ReferenceType type, size_t count) const {
! EventGCReferenceStatistics e(UNTIMED);
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_type((u1)type);
e.set_count(count);
+ e.set_endtime(os::elapsed_counter());
e.commit();
}
}
void ParallelOldTracer::send_parallel_old_event() const {
*** 103,126 ****
failed_info.set_totalSize(cf_info.total_size());
return failed_info;
}
void YoungGCTracer::send_promotion_failed_event(const PromotionFailedInfo& pf_info) const {
! EventPromotionFailed e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_data(to_trace_struct(pf_info));
e.set_thread(pf_info.thread()->thread_id());
e.commit();
}
}
// Common to CMS and G1
void OldGCTracer::send_concurrent_mode_failure_event() {
! EventConcurrentModeFailure e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.commit();
}
}
#if INCLUDE_ALL_GCS
--- 105,130 ----
failed_info.set_totalSize(cf_info.total_size());
return failed_info;
}
void YoungGCTracer::send_promotion_failed_event(const PromotionFailedInfo& pf_info) const {
! EventPromotionFailed e(UNTIMED);
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_data(to_trace_struct(pf_info));
e.set_thread(pf_info.thread()->thread_id());
+ e.set_endtime(os::elapsed_counter());
e.commit();
}
}
// Common to CMS and G1
void OldGCTracer::send_concurrent_mode_failure_event() {
! EventConcurrentModeFailure e(UNTIMED);
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
+ e.set_endtime(os::elapsed_counter());
e.commit();
}
}
#if INCLUDE_ALL_GCS
*** 134,163 ****
e.commit();
}
}
void G1NewTracer::send_evacuation_info_event(EvacuationInfo* info) {
! EventEvacuationInfo e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_cSetRegions(info->collectionset_regions());
e.set_cSetUsedBefore(info->collectionset_used_before());
e.set_cSetUsedAfter(info->collectionset_used_after());
e.set_allocationRegions(info->allocation_regions());
e.set_allocRegionsUsedBefore(info->alloc_regions_used_before());
e.set_allocRegionsUsedAfter(info->alloc_regions_used_before() + info->bytes_copied());
e.set_bytesCopied(info->bytes_copied());
e.set_regionsFreed(info->regions_freed());
e.commit();
}
}
void G1NewTracer::send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const {
! EventEvacuationFailed e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_data(to_trace_struct(ef_info));
e.commit();
}
}
#endif
--- 138,169 ----
e.commit();
}
}
void G1NewTracer::send_evacuation_info_event(EvacuationInfo* info) {
! EventEvacuationInfo e(UNTIMED);
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_cSetRegions(info->collectionset_regions());
e.set_cSetUsedBefore(info->collectionset_used_before());
e.set_cSetUsedAfter(info->collectionset_used_after());
e.set_allocationRegions(info->allocation_regions());
e.set_allocRegionsUsedBefore(info->alloc_regions_used_before());
e.set_allocRegionsUsedAfter(info->alloc_regions_used_before() + info->bytes_copied());
e.set_bytesCopied(info->bytes_copied());
e.set_regionsFreed(info->regions_freed());
+ e.set_endtime(os::elapsed_counter());
e.commit();
}
}
void G1NewTracer::send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const {
! EventEvacuationFailed e(UNTIMED);
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_data(to_trace_struct(ef_info));
+ e.set_endtime(os::elapsed_counter());
e.commit();
}
}
#endif
*** 187,202 ****
GCHeapSummaryEventSender(GCId id, GCWhen::Type when) : _id(id), _when(when) {}
void visit(const GCHeapSummary* heap_summary) const {
const VirtualSpaceSummary& heap_space = heap_summary->heap();
! EventGCHeapSummary e;
if (e.should_commit()) {
e.set_gcId(_id);
e.set_when((u1)_when);
e.set_heapSpace(to_trace_struct(heap_space));
e.set_heapUsed(heap_summary->used());
e.commit();
}
}
void visit(const PSHeapSummary* ps_heap_summary) const {
--- 193,209 ----
GCHeapSummaryEventSender(GCId id, GCWhen::Type when) : _id(id), _when(when) {}
void visit(const GCHeapSummary* heap_summary) const {
const VirtualSpaceSummary& heap_space = heap_summary->heap();
! EventGCHeapSummary e(UNTIMED);
if (e.should_commit()) {
e.set_gcId(_id);
e.set_when((u1)_when);
e.set_heapSpace(to_trace_struct(heap_space));
e.set_heapUsed(heap_summary->used());
+ e.set_endtime(os::elapsed_counter());
e.commit();
}
}
void visit(const PSHeapSummary* ps_heap_summary) const {
*** 207,227 ****
const VirtualSpaceSummary& young_summary = ps_heap_summary->young();
const SpaceSummary& eden_space = ps_heap_summary->eden();
const SpaceSummary& from_space = ps_heap_summary->from();
const SpaceSummary& to_space = ps_heap_summary->to();
! EventPSHeapSummary e;
if (e.should_commit()) {
e.set_gcId(_id);
e.set_when((u1)_when);
e.set_oldSpace(to_trace_struct(ps_heap_summary->old()));
e.set_oldObjectSpace(to_trace_struct(ps_heap_summary->old_space()));
e.set_youngSpace(to_trace_struct(ps_heap_summary->young()));
e.set_edenSpace(to_trace_struct(ps_heap_summary->eden()));
e.set_fromSpace(to_trace_struct(ps_heap_summary->from()));
e.set_toSpace(to_trace_struct(ps_heap_summary->to()));
e.commit();
}
}
};
--- 214,235 ----
const VirtualSpaceSummary& young_summary = ps_heap_summary->young();
const SpaceSummary& eden_space = ps_heap_summary->eden();
const SpaceSummary& from_space = ps_heap_summary->from();
const SpaceSummary& to_space = ps_heap_summary->to();
! EventPSHeapSummary e(UNTIMED);
if (e.should_commit()) {
e.set_gcId(_id);
e.set_when((u1)_when);
e.set_oldSpace(to_trace_struct(ps_heap_summary->old()));
e.set_oldObjectSpace(to_trace_struct(ps_heap_summary->old_space()));
e.set_youngSpace(to_trace_struct(ps_heap_summary->young()));
e.set_edenSpace(to_trace_struct(ps_heap_summary->eden()));
e.set_fromSpace(to_trace_struct(ps_heap_summary->from()));
e.set_toSpace(to_trace_struct(ps_heap_summary->to()));
+ e.set_endtime(os::elapsed_counter());
e.commit();
}
}
};
*** 239,255 ****
return meta_sizes;
}
void GCTracer::send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const {
! EventMetaspaceSummary e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_when((u1) when);
e.set_metaspace(to_trace_struct(meta_space_summary.meta_space()));
e.set_dataSpace(to_trace_struct(meta_space_summary.data_space()));
e.set_classSpace(to_trace_struct(meta_space_summary.class_space()));
e.commit();
}
}
class PhaseSender : public PhaseVisitor {
--- 247,264 ----
return meta_sizes;
}
void GCTracer::send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const {
! EventMetaspaceSummary e(UNTIMED);
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_when((u1) when);
e.set_metaspace(to_trace_struct(meta_space_summary.meta_space()));
e.set_dataSpace(to_trace_struct(meta_space_summary.data_space()));
e.set_classSpace(to_trace_struct(meta_space_summary.class_space()));
+ e.set_endtime(os::elapsed_counter());
e.commit();
}
}
class PhaseSender : public PhaseVisitor {
*** 280,291 ****
case 2: send_phase<EventGCPhasePauseLevel2>(pause); break;
case 3: send_phase<EventGCPhasePauseLevel3>(pause); break;
default: /* Ignore sending this phase */ break;
}
}
-
- #undef send_phase
};
void GCTracer::send_phase_events(TimePartitions* time_partitions) const {
PhaseSender phase_reporter(_shared_gc_info.id());
--- 289,298 ----