src/share/vm/gc_implementation/shared/gcTraceSend.cpp
Print this page
rev 5685 : 8028128: Add a type safe alternative for working with counter based data
Reviewed-by:
*** 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 {
--- 53,67 ----
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 {
*** 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
--- 104,127 ----
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
*** 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
--- 135,164 ----
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
*** 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 {
--- 188,203 ----
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 {
*** 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();
}
}
};
--- 208,228 ----
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();
}
}
};
*** 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 {
--- 240,256 ----
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 {