# HG changeset patch # User tonyp # Date 1292810236 18000 # Node ID 7c5250dbd5847b446ddd0fe4f83d6b464ad925b5 # Parent 74ee0db180fa7788c7f41b4db39b8b9e9bc39bd4 6896624: G1: hotspot:::gc and hotspot:::mem-pool-gc probes are not fired Summary: Fire the gc-begin and gc-end probes for G1. Reviewed-by: kamg, ysr, jcoomes diff -r 74ee0db180fa -r 7c5250dbd584 src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Dec 17 23:41:31 2010 -0800 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Sun Dec 19 20:57:16 2010 -0500 @@ -1192,6 +1192,7 @@ return false; } + DTraceGCProbeMarker gc_probe_marker(true /* full */); ResourceMark rm; if (PrintHeapAtGC) { @@ -3213,13 +3214,14 @@ return false; } + DTraceGCProbeMarker gc_probe_marker(false /* full */); + ResourceMark rm; + if (PrintHeapAtGC) { Universe::print_heap_before_gc(); } { - ResourceMark rm; - // This call will decide whether this pause is an initial-mark // pause. If it is, during_initial_mark_pause() will return true // for the duration of this pause. diff -r 74ee0db180fa -r 7c5250dbd584 src/share/vm/gc_implementation/shared/vmGCOperations.hpp --- a/src/share/vm/gc_implementation/shared/vmGCOperations.hpp Fri Dec 17 23:41:31 2010 -0800 +++ b/src/share/vm/gc_implementation/shared/vmGCOperations.hpp Sun Dec 19 20:57:16 2010 -0500 @@ -209,4 +209,15 @@ HeapWord* result() const { return _res; } }; +class DTraceGCProbeMarker : public StackObj { +public: + DTraceGCProbeMarker(bool full) { + VM_GC_Operation::notify_gc_begin(full); + } + + ~DTraceGCProbeMarker() { + VM_GC_Operation::notify_gc_end(); + } +}; + #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP