public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [RFC] Enhanced Garbage Collection Probe Points
@ 2012-08-02 13:11 Lukas Berk
  2012-08-03 13:56 ` Mark Wielaard
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Lukas Berk @ 2012-08-02 13:11 UTC (permalink / raw)
  To: distro-pkg-dev; +Cc: systemtap


[-- Attachment #1.1: Type: text/plain, Size: 732 bytes --]

Hey,

I've been working on adding improved probe point within the garbage
collection system.  This will allow system administrators using various
tools to better analyze which garbage collection algorithms are
effective and java developers to better understand how (often) their
objects are being collected.

Specific probe points that I've aimed to include are:

- G1, concurrent mark sweep, parallel mark sweep, and tenured
  collections

- new generation definitions

- parallel scavenges

- parallel compaction

- object 'moves/resizes' between memory addresses

Please note that the attached patch should be appended to the
patch/systemtap.patch file.  Any feedback or suggestions would be
greatly appreciated.

Cheers,

Lukas

[-- Attachment #1.2: systemtap.patch --]
[-- Type: text/plain, Size: 13519 bytes --]

diff -Nru openjdk.orig/hotspot/src/share/vm/memory/generation.cpp openjdk/hotspot/src/share/vm/memory/generation.cpp
--- openjdk.orig/hotspot/src/share/vm/memory/generation.cpp	2012-06-15 11:36:43.022837742 -0400
+++ openjdk/hotspot/src/share/vm/memory/generation.cpp	2012-06-15 13:35:39.714838057 -0400
@@ -40,6 +40,11 @@
 #include "runtime/java.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/events.hpp"
+#include "utilities/dtrace.hpp"
+
+#ifndef USDT2
+  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig, bool, bool, size_t, bool);
+#endif /* !USDT2 */
 
 Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
   _level(level),
@@ -471,6 +476,9 @@
   ReferenceProcessorSpanMutator
     x(ref_processor(), GenCollectedHeap::heap()->reserved_region());
   GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs);
+#ifndef USDT2
+  HS_DTRACE_PROBE4(hotspot, gc__collection__contig, full, clear_all_soft_refs, size, is_tlab);
+#endif  /* !USDT2 */
   SpecializationStats::print();
 }
 
diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
--- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-06-15 11:36:42.164837741 -0400
+++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-06-15 13:35:45.224838227 -0400
@@ -55,6 +55,11 @@
 #include "runtime/vmThread.hpp"
 #include "services/memoryService.hpp"
 #include "services/runtimeService.hpp"
+#include "utilities/dtrace.hpp"
+
+#ifndef USDT2
+  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig, bool, bool, size_t, bool);
+#endif /* !USDT2 */
 
 // statics
 CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
@@ -1655,6 +1660,10 @@
                            size_t size,
                            bool   tlab)
 {
+
+#ifndef USDT2
+  HS_DTRACE_PROBE4(hotspot, gc__collection__contig, full, clear_all_soft_refs, size, tlab);
+#endif /* !USDT2 */
   if (!UseCMSCollectionPassing && _collectorState > Idling) {
     // For debugging purposes skip the collection if the state
     // is not currently idle
diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-06-15 11:36:41.816837741 -0400
+++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-06-15 13:35:56.298821181 -0400
@@ -49,6 +49,11 @@
 #include "utilities/copy.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/workgroup.hpp"
+#include "utilities/dtrace.hpp"
+
+#ifndef USDT2
+  HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew, bool, bool, size_t, bool);
+#endif /* !USDT2 */
 
 #ifdef _MSC_VER
 #pragma warning( push )
@@ -878,6 +883,9 @@
                                bool   clear_all_soft_refs,
                                size_t size,
                                bool   is_tlab) {
+#ifndef USDT2
+  HS_DTRACE_PROBE4(hotspot, gc__collection__parnew, full, clear_all_soft_refs, size, is_tlab);
+#endif  /* !USDT2 */
   assert(full || size > 0, "otherwise we don't want to collect");
   GenCollectedHeap* gch = GenCollectedHeap::heap();
   assert(gch->kind() == CollectedHeap::GenCollectedHeap,
diff -Nru openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp
--- openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-06-15 11:36:42.970837742 -0400
+++ openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-06-15 13:36:05.328838805 -0400
@@ -39,6 +39,11 @@
 #include "runtime/java.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/stack.inline.hpp"
+#include "utilities/dtrace.hpp"
+
+#ifndef USDT2
+  HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew, bool, bool, size_t, bool);
+#endif /* !USDT2 */
 #ifdef TARGET_OS_FAMILY_linux
 # include "thread_linux.inline.hpp"
 #endif
@@ -528,6 +533,9 @@
                                bool   clear_all_soft_refs,
                                size_t size,
                                bool   is_tlab) {
+#ifndef USDT2
+  HS_DTRACE_PROBE4(hotspot, gc__collection__defnew, full, clear_all_soft_refs, size, is_tlab);
+#endif  /* !USDT2 */
   assert(full || size > 0, "otherwise we don't want to collect");
   GenCollectedHeap* gch = GenCollectedHeap::heap();
   _next_gen = gch->next_gen(this);
diff -Nru openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp
--- openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-06-15 11:36:43.016837742 -0400
+++ openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-06-15 13:36:08.848839364 -0400
@@ -33,6 +33,11 @@
 #include "memory/tenuredGeneration.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/java.hpp"
+#include "utilities/dtrace.hpp"
+
+#ifndef USDT2
+  HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured, bool, bool, size_t, bool);
+#endif /* !USDT2 */
 
 TenuredGeneration::TenuredGeneration(ReservedSpace rs,
                                      size_t initial_byte_size, int level,
@@ -307,6 +312,9 @@
                                 size_t size,
                                 bool   is_tlab) {
   retire_alloc_buffers_before_full_gc();
+#ifndef USDT2
+  HS_DTRACE_PROBE4(hotspot, gc__collection__tenured, full, clear_all_soft_refs, size, is_tlab);
+#endif  /* !USDT2 */
   OneContigSpaceCardGeneration::collect(full, clear_all_soft_refs,
                                         size, is_tlab);
 }
diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp
--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp
@@ -40,8 +40,13 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/vmThread.hpp"
+#include "utilities/dtrace.hpp"
 #include "utilities/vmError.hpp"
 
+#ifndef USDT2
+  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parscavenge, *uintptr_t, *uintptr_t);
+#endif /* !USDT2 */
+
 PSYoungGen*  ParallelScavengeHeap::_young_gen = NULL;
 PSOldGen*    ParallelScavengeHeap::_old_gen = NULL;
 PSPermGen*   ParallelScavengeHeap::_perm_gen = NULL;
@@ -806,6 +811,9 @@
   }
 
   VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
+#ifndef USDT2
+  HS_DTRACE_PROBE2(hotspot, gc__collection__parscavenge, &op, cause);
+#endif /* !USDT2 */
   VMThread::execute(&op);
 }

diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
--- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-06-26 09:24:22.472325287 -0400
+++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-07-05 10:43:08.273800575 -0400
@@ -45,8 +45,13 @@
 #include "runtime/thread.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/copy.hpp"
+#include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 
+#ifndef USDT2
+  HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1, *uintptr_t, *uintptr_t);
+#endif /* !USDT2 */
+
 class HeapRegion;
 
 void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp,
@@ -83,7 +88,9 @@
   // We should save the marks of the currently locked biased monitors.
   // The marking doesn't preserve the marks of biased objects.
   BiasedLocking::preserve_marks();
-
+#ifndef USDT2
+  HS_DTRACE_PROBE2(hotspot, gc__collection__G1, &sh, sh->gc_cause());
+#endif /* !USDT2 */
   mark_sweep_phase1(marked_for_unloading, clear_all_softrefs);
 
   mark_sweep_phase2();
diff -Nru openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp openjdk/hotspot/src/share/vm/compiler/oopMap.cpp
--- openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp	2012-06-26 09:24:22.390325184 -0400
+++ openjdk/hotspot/src/share/vm/compiler/oopMap.cpp	2012-07-06 10:12:44.981413003 -0400
@@ -33,9 +33,13 @@
 #include "memory/resourceArea.hpp"
 #include "runtime/frame.inline.hpp"
 #include "runtime/signature.hpp"
+#include "utilities/dtrace.hpp"
 #ifdef COMPILER1
 #include "c1/c1_Defs.hpp"
 #endif
+#ifndef USDT2
+  HS_DTRACE_PROBE_DECL1(provider, gc__collection__delete, *uintptr_t);
+#endif /* !USDT2 */
 
 // OopMapStream
 
@@ -677,6 +681,9 @@
                     " - Derived: " INTPTR_FORMAT "  Base: " INTPTR_FORMAT " (Offset: %d)",
           derived_loc, (address)*derived_loc, (address)base, offset);
     }
+#ifndef USDT2
+  HS_DTRACE_PROBE1(hotspot, gc__collection__delete, entry);
+#endif /* !USDT2 */
 
     // Delete entry
     delete entry;
--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-12 09:48:40.349999515 -0400
+++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-19 18:38:07.560757426 -0400
@@ -53,11 +53,18 @@
 #include "runtime/vmThread.hpp"
 #include "services/management.hpp"
 #include "services/memoryService.hpp"
+#include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/stack.inline.hpp"
 
 #include <math.h>
 
+#ifndef USDT2
+  HS_DTRACE_PROBE_DECL2(provider, gc__collection__ParallelCompact__clear, *uintptr_t, *uintptr_t);
+  HS_DTRACE_PROBE_DECL2(provider, gc__collection__partest1, *uintptr_t, *uintptr_t);
+  HS_DTRACE_PROBE_DECL4(provider, gc__collection__move, *uintptr_t, *uintptr_t, *uintptr_t, *uintptr_t);
+#endif /* !USDT2 */
+
 // All sizes are in HeapWords.
 const size_t ParallelCompactData::Log2RegionSize  = 9; // 512 words
 const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
@@ -433,6 +439,9 @@
 
 void ParallelCompactData::clear()
 {
+#ifndef USDT2
+  HS_DTRACE_PROBE2(hotspot, gc__collection__ParallelCompact__clear, &_region_data, _region_data->data_location());
+#endif /* !USDT2 */
   memset(_region_data, 0, _region_vspace->committed_size());
 }
 
@@ -1970,6 +1979,9 @@
          "should be in vm thread");
 
   ParallelScavengeHeap* heap = gc_heap();
+#ifndef USDT2
+  HS_DTRACE_PROBE2(hotspot, gc__collection__partest1, heap, heap->gc_cause());
+#endif /* !USDT2 */
   GCCause::Cause gc_cause = heap->gc_cause();
   assert(!heap->is_gc_active(), "not reentrant");
 
@@ -3376,6 +3388,9 @@
   // past the end of the partial object entering the region (if any).
   HeapWord* const dest_addr = sd.partial_obj_end(dp_region);
   HeapWord* const new_top = _space_info[space_id].new_top();
+#ifndef USDT2
+  HS_DTRACE_PROBE4(hotspot, gc__collection__move, &beg_addr, &end_addr, &dest_addr, &new_top);
+#endif /* !USDT2 */
   assert(new_top >= dest_addr, "bad new_top value");
   const size_t words = pointer_delta(new_top, dest_addr);
 
--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-07-12 09:48:40.401000822 -0400
+++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-07-19 18:36:43.787767399 -0400
@@ -51,8 +51,12 @@
 #include "runtime/vmThread.hpp"
 #include "runtime/vm_operations.hpp"
 #include "services/memoryService.hpp"
+#include "utilities/dtrace.hpp"
 #include "utilities/stack.inline.hpp"
 
+#ifndef USDT2
+  HS_DTRACE_PROBE_DECL2(provider, name, *uintptr_t, *uintptr_t);
+#endif /* !USDT2 */
 
 HeapWord*                  PSScavenge::_to_space_top_before_gc = NULL;
 int                        PSScavenge::_consecutive_skipped_scavenges = 0;
@@ -226,7 +230,13 @@
   PSAdaptiveSizePolicy* policy = heap->size_policy();
   IsGCActiveMark mark;
 
+#ifndef USDT2
+  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__begin, *heap, heap->gc_cause());
+#endif /* !USDT2 */
   const bool scavenge_done = PSScavenge::invoke_no_policy();
+#ifndef USDT2
+  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__end, *heap, heap->gc_cause());
+#endif /* !USDT2 */
   const bool need_full_gc = !scavenge_done ||
     policy->should_full_GC(heap->old_gen()->free_in_bytes());
   bool full_gc_done = false;
@@ -243,9 +253,27 @@
     const bool clear_all_softrefs = cp->should_clear_all_soft_refs();
 
     if (UseParallelOldGC) {
+#ifndef USDT2
+  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__begin, *heap, heap->gc_cause()); 
+#endif /* !USDT2 */
+
       full_gc_done = PSParallelCompact::invoke_no_policy(clear_all_softrefs);
+
+#ifndef USDT2
+  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__end, *heap, heap->gc_cause());
+#endif /* !USDT2 */
+
     } else {
+
+#ifndef USDT2
+  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__begin, *heap, heap->gc_cause());
+#endif /* !USDT2 */
+
       full_gc_done = PSMarkSweep::invoke_no_policy(clear_all_softrefs);
+
+#ifndef USDT2
+  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__end, *heap, heap->gc_cause());
+#endif /* !USDT2 */
     }
   }
 

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-02 13:11 [RFC] Enhanced Garbage Collection Probe Points Lukas Berk
@ 2012-08-03 13:56 ` Mark Wielaard
  2012-08-03 14:23   ` Lukas Berk
  2012-08-08 20:37 ` Jon VanAlten
  2012-08-22 20:34 ` Lukas Berk
  2 siblings, 1 reply; 27+ messages in thread
From: Mark Wielaard @ 2012-08-03 13:56 UTC (permalink / raw)
  To: Lukas Berk; +Cc: distro-pkg-dev, systemtap

On Thu, 2012-08-02 at 09:10 -0400, Lukas Berk wrote:
> I've been working on adding improved probe point within the garbage
> collection system.  This will allow system administrators using various
> tools to better analyze which garbage collection algorithms are
> effective and java developers to better understand how (often) their
> objects are being collected.
> 
> Specific probe points that I've aimed to include are:
> 
> - G1, concurrent mark sweep, parallel mark sweep, and tenured
>   collections
> 
> - new generation definitions
> 
> - parallel scavenges
> 
> - parallel compaction
> 
> - object 'moves/resizes' between memory addresses
> 
> Please note that the attached patch should be appended to the
> patch/systemtap.patch file.  Any feedback or suggestions would be
> greatly appreciated.

They look interesting, but do you have some example usage for this? My
garbage collector knowledge is very rusty. Just some simple description
when which point would be hit and what interesting data can be
collected/analysed at that time would be nice to put this in context.

Did you happen to talk to the thermostat team? They might give some
feedback on what kind of information they need and whether these probe
points would cover their needs.

Thanks,

Mark

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-03 13:56 ` Mark Wielaard
@ 2012-08-03 14:23   ` Lukas Berk
  2012-08-07 11:50     ` Mark Wielaard
  0 siblings, 1 reply; 27+ messages in thread
From: Lukas Berk @ 2012-08-03 14:23 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: distro-pkg-dev, systemtap


[-- Attachment #1.1: Type: text/plain, Size: 1128 bytes --]

Hey Mark,

* Mark Wielaard <mark@klomp.org> [2012-08-03 09:56]:
> On Thu, 2012-08-02 at 09:10 -0400, Lukas Berk wrote:
[...]
> 
> They look interesting, but do you have some example usage for this? My
> garbage collector knowledge is very rusty. Just some simple description
> when which point would be hit and what interesting data can be
> collected/analysed at that time would be nice to put this in context.
I ran a $stap eventcount.stp hotspot.gc_* -o eventcount.txt style script
and have attached the output.  I'll also start to document the
script(tapset?) I've been using to interpret the probe points I've been
added here.
> 
> Did you happen to talk to the thermostat team? They might give some
> feedback on what kind of information they need and whether these probe
> points would cover their needs.

Yes I have, and I'm working towards what they'd like (idealy we'd like
to track objects from allocation, space to space, and eventually watch
them be collected), however I'd like to make sure this is the correct
starting point and work my way there, one step at a time :)

Cheers,

Lukas

[-- Attachment #1.2: eventcount.txt --]
[-- Type: text/plain, Size: 1672 bytes --]

Finished event counting at Fri Aug  3 10:09:35 2012 EDT.
Total time elapsed: 1021574 ms, 63 events total, 63 after filtering.
TID                       EVENT                          COUNT (RATE Hz)
---                       -----                          ---------------
java(4998)                hotspot.gc_collect_parallel    1 (0.00)
java(5003)                hotspot.gc_collect_PSScavenge_begin 10 (0.00)
java(5003)                hotspot.gc_collect_PSScavenge_end 10 (0.00)
java(5003)                hotspot.gc_collect_delete      2 (0.00)
java(5003)                hotspot.gc_collect_PSParallelCompact_end 2 (0.00)
java(5003)                hotspot.gc_collect_test        1 (0.00)
java(5003)                hotspot.gc_collect_move        3 (0.00)
java(5003)                hotspot.gc_collect_PSParallelCompact_begin 2 (0.00)
java(5077)                hotspot.gc_collect_PSScavenge_begin 5 (0.00)
java(5077)                hotspot.gc_collect_PSScavenge_end 5 (0.00)
java(5139)                hotspot.gc_collect_PSScavenge_end 2 (0.00)
java(5139)                hotspot.gc_collect_PSScavenge_begin 2 (0.00)
java(5330)                hotspot.gc_collect_PSScavenge_begin 4 (0.00)
java(5330)                hotspot.gc_collect_PSScavenge_end 4 (0.00)
java(5776)                hotspot.gc_collect_PSScavenge_end 1 (0.00)
java(5776)                hotspot.gc_collect_PSScavenge_begin 1 (0.00)
java(5827)                hotspot.gc_collect_PSScavenge_end 2 (0.00)
java(5827)                hotspot.gc_collect_PSScavenge_begin 2 (0.00)
java(5864)                hotspot.gc_collect_PSScavenge_end 2 (0.00)
java(5864)                hotspot.gc_collect_PSScavenge_begin 2 (0.00)

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-03 14:23   ` Lukas Berk
@ 2012-08-07 11:50     ` Mark Wielaard
  2012-08-08 14:01       ` Lukas Berk
  0 siblings, 1 reply; 27+ messages in thread
From: Mark Wielaard @ 2012-08-07 11:50 UTC (permalink / raw)
  To: Lukas Berk; +Cc: systemtap, distro-pkg-dev

On Fri, 2012-08-03 at 10:22 -0400, Lukas Berk wrote:
> * Mark Wielaard <mark@klomp.org> [2012-08-03 09:56]:
> > On Thu, 2012-08-02 at 09:10 -0400, Lukas Berk wrote:
> > They look interesting, but do you have some example usage for this? My
> > garbage collector knowledge is very rusty. Just some simple description
> > when which point would be hit and what interesting data can be
> > collected/analysed at that time would be nice to put this in context.
> I ran a $stap eventcount.stp hotspot.gc_* -o eventcount.txt style script
> and have attached the output.  I'll also start to document the
> script(tapset?) I've been using to interpret the probe points I've been
> added here.

If you could post eventcount.stp with some comments that would be really
helpful (even if it is just a work in progress) to better understand the
"meaning" of the new probe points for a Garbage Collector noob like me.

Thanks,

Mark

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-07 11:50     ` Mark Wielaard
@ 2012-08-08 14:01       ` Lukas Berk
  2012-08-08 14:34         ` Mario Torre
  0 siblings, 1 reply; 27+ messages in thread
From: Lukas Berk @ 2012-08-08 14:01 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: systemtap, distro-pkg-dev


[-- Attachment #1.1: Type: text/plain, Size: 3497 bytes --]

* Mark Wielaard <mjw@redhat.com> [2012-08-07 07:50]:
[...]
> If you could post eventcount.stp with some comments that would be really
> helpful (even if it is just a work in progress) to better understand the
> "meaning" of the new probe points for a Garbage Collector noob like me.

Sure! I've added in comments below to the output I attached in the last
email. I've also attached the tapset/script I've written and have been
using with documentation.  For those of you using sytemtap, to use the
probe points, apply my original patch to icedtea, build, and then when
using stap, $stap -I /path/to/gc_details.stp <script.stp>

Finished event counting at Fri Aug  3 10:09:35 2012 EDT.
Total time elapsed: 1021574 ms, 63 events total, 63 after filtering.
TID                       EVENT                          COUNT (RATE Hz)
---                       -----                          ---------------
java(4998)                hotspot.gc_collect_parallel    1 (0.00)
^ This is a _full_ parallel collection of all objects from the program,
typically done when called explicitly with a System.gc() or at the end
of the program.  All of my collect type of probes also have a 'cause'
parameter for what initiated the gc.

java(5003)                hotspot.gc_collect_PSScavenge_begin 10 (0.00)
java(5003)                hotspot.gc_collect_PSScavenge_end 10 (0.00)
^ This marks the beginning and end of a parallel scavenge, I've marked
the beginning and end points in case there are concurrent parallel
scavenges going on.  (scavenges are partial garbage collections, so they
should happen much more often throughout the runtime of the program)

java(5003)                hotspot.gc_collect_delete      2 (0.00)
^ This is a marker of an actual deletion of an object, I need to get
better coverage of these types of statements, however its a starting point

java(5003)                hotspot.gc_collect_PSParallelCompact_end 2
(0.00)
^ This parallel compaction (and the matching begin below) is where a
compaction of an object space occurs, the tapset/script I'm using
(attached with documentation) will also note the cause

java(5003)                hotspot.gc_collect_test        1 (0.00)
^ This probe point should read gc_collect_parallel, I need to adjust it
within my tapset/script.
java(5003)                hotspot.gc_collect_move        3 (0.00)
^ This move probe shows when an object and its addresses are moved (It
will show the top/bottom of the old address space it occupied and the
new top/bottom addresses) 

java(5003)                hotspot.gc_collect_PSParallelCompact_begin 2
(0.00)
java(5077)                hotspot.gc_collect_PSScavenge_begin 5 (0.00)
java(5077)                hotspot.gc_collect_PSScavenge_end 5 (0.00)
java(5139)                hotspot.gc_collect_PSScavenge_end 2 (0.00)
java(5139)                hotspot.gc_collect_PSScavenge_begin 2 (0.00)
java(5330)                hotspot.gc_collect_PSScavenge_begin 4 (0.00)
java(5330)                hotspot.gc_collect_PSScavenge_end 4 (0.00)
java(5776)                hotspot.gc_collect_PSScavenge_end 1 (0.00)
java(5776)                hotspot.gc_collect_PSScavenge_begin 1 (0.00)
java(5827)                hotspot.gc_collect_PSScavenge_end 2 (0.00)
java(5827)                hotspot.gc_collect_PSScavenge_begin 2 (0.00)
java(5864)                hotspot.gc_collect_PSScavenge_end 2 (0.00)
java(5864)                hotspot.gc_collect_PSScavenge_begin 2 (0.00)


[-- Attachment #1.2: gc_details.stp --]
[-- Type: text/plain, Size: 11244 bytes --]

/*
 * probe - gc_collect_contig
 * 
 * @name: gc_collect_contig
 * @is_full: If TRUE, attempt a full collection of the generation
 * @size: word size to be cleaned
 * @is_tlab: Is this a Thread Local Allocation Buffer?
 *
 * Description: This marks the collection of one contiguous space generation
 * 
 */

probe hotspot.gc_collect_contig = 
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__contig")
{

  name = "gc_collect_contig";
  is_full = $arg2;
  size = $arg3;
  is_tlab = $arg4;
  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);

}

/*
 * probe - gc_collect_parnew
 * 
 * @name: gc_collect_parnew
 * @is_full: If TRUE, attempt a full collection of the generation
 * @size: word size to be cleaned
 * @is_tlab: Is this a Thread Local Allocation Buffer?
 *
 * Description: This marks the collection of a new parallel new generation.
 * This is different than a gc_collect_parallel generation due to it being
 * specifically defined as a parNewGeneration
 * 
 */

probe hotspot.gc_collect_parnew = 
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__parnew")
{

  name = "gc_collect_parnew";
  is_full = $arg2;
  size = $arg3;
  is_tlab = $arg4;
  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);

}

/*
 * probe - gc_collect_defnew
 * 
 * @name: gc_collect_defnew
 * @is_full: If TRUE, attempt a full collection of the generation
 * @size: word size to be cleaned
 * @is_tlab: Is this a Thread Local Allocation Buffer?
 *
 * Description: A collection of a newly defined generation
 * 
 */

probe hotspot.gc_collect_defnew = 
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__defnew")
{

  name = "gc_collect_defnew";
  is_full = $arg2;
  size = $arg3;
  is_tlab = $arg4;
  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);

}

/*
 * probe - gc_collect_tenured
 * 
 * @name: gc_collect_tenured
 * @is_full: If TRUE, attempt a full collection of the generation
 * @size: word size to be cleaned
 * @is_tlab: Is this a Thread Local Allocation Buffer?
 *
 * Description: This is a collection of a tenured generation (a geneartion
 * that has survived multiple garbage collections and is now in a 'tenured'
 * object space.
 * 
 */

probe hotspot.gc_collect_tenured = 
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__tenured")
{

  name = "gc_collect_tenured";
  is_full = $arg2;
  size = $arg3;
  is_tlab = $arg4;
  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);

}

/*
 * probe - gc_collect_parallel
 * 
 * @name: gc_collect_parallel
 * @address: address of object being collected
 * @cause: cause of the collection
 * 
 * Description: This is a parallel collection, where the jvm process don't
 * have to halt while the gc is being completed
 */

probe hotspot.gc_collect_parallel =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__parscavenge")
{
  name = "gc_collect_parallel";
  address = sprintf("0x%x", $arg1);
  cause = $arg2;
  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
}

/*
 * probe - gc_collect_test
 * 
 * @name: gc_collect_parallel
 * @address: address of object being collected
 * @cause: cause of the collection
 *
 * Description: Another placement of a parallel collection
 * 
 */

probe hotspot.gc_collect_test =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__partest1")
{
  name = "gc_collect_parallel";
  address = sprintf("0x%x", $arg1);
  cause = $arg2;
  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
}

/*
 * probe - gc_collect_G1
 * 
 * @name: gc_collect_G1
 * @address: address of object being collected
 * @cause: cause of the collection
 *
 * Description: A G1 style garbage collection (halt the world garbage collection)
 * 
 */

probe hotspot.gc_collect_G1 =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__G1")
{
  name = "gc_collect_g1";
  address = sprintf("0x%x", $arg1);
  cause = $arg2;
  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
}

/*
 * probe - gc_collect_delete
 * 
 * @name: gc_collect_delete
 * @address: address of object being collected
 * @cause: cause of the collection
 *
 * Description: A delete statement of an obeject
 * 
 */

probe hotspot.gc_collect_delete =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__delete")
{
  name = "gc_collect_delete";
  address = sprintf("0x%x", $arg1);
  probestr = sprintf("%s(address='%s')", name, address);
}

/*
 * probe - gc_collect_PSScavenge_begin
 * 
 * @name: gc_collect_PSScavenge_begin
 * @address: address of scavenge
 * @cause: cause of the collection
 *
 * Description: A parallel scavenge begins.  A scavenge is a partial garbage
 * collection which should be much more common than a full garbage collection
 * throughout the course of the java program.
 * 
 */

probe hotspot.gc_collect_PSScavenge_begin =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__PSScavenge__begin")
{
  name = "gc_collect_PSScavenge_begin";
  address = sprintf("0x%x", $arg1);
  cause = $arg2;
  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
}

/*
 * probe - gc_collect_PSScavenge_end
 * 
 * @name: gc_collect_PSScavenge_end
 * @address: address of scavenge
 * @cause: cause of the collection
 *
 * Description: The end of the parallel scavenge.  The beginning and end of
 * the scavenge is noted due to the possbility of multiple scavenges occuring
 * at the same time
 * 
 */

probe hotspot.gc_collect_PSScavenge_end =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__PSScavenge__end")
{
  name = "gc_collect_PSScavenge_end";
  address = sprintf("0x%x", $arg1);
  cause = $arg2;
  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
}

/*
 * probe - gc_collect_PSParallelCompact_begin
 * 
 * @name: gc_collect_PSParallelCompact_begin
 * @address: address of compaction
 * @cause: cause of the collection
 *
 * Description: A parallel compaction of a memory space
 * 
 */

probe hotspot.gc_collect_PSParallelCompact_begin =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__PSParallelCompact__begin")
{
  name = "gc_collect_PSParallelCompact_begin";
  address = sprintf("0x%x", $arg1);
  cause = $arg2;
  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
}

/*
 * probe - gc_collect_PSParallelCompact_end
 * 
 * @name: gc_collect_PSParallelCompact_end
 * @address: address of compaction
 * @cause: cause of the collection
 *
 * Description: A parallel compaction of a memory space
 * 
 */

probe hotspot.gc_collect_PSParallelCompact_end =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__PSParallelCompact__end")
{
  name = "gc_collect_PSParallelCompact_end";
  address = sprintf("0x%x", $arg1);
  cause = $arg2;
  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
}

/*
 * probe - gc_collect_PSMarkSweep_begin
 * 
 * @name: gc_collect_PSMarkSweep_begin
 * @address: address of parallel mark sweep process
 * @cause: cause of the collection
 *
 * Description: A parallel mark sweep of objects needed for collection begins
 * 
 */

probe hotspot.gc_collect_PSMarkSweep_begin =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__PSMarkSweep__begin")
{
  name = "gc_collect_PSMarkSweep_begin";
  address = sprintf("0x%x", $arg1);
  cause = $arg2;
  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
}

/*
 * probe - gc_collect_PSMarkSweep_end
 * 
 * @name: gc_collect_PSMarkSweep_end
 * @address: address of parallel mark sweep process
 * @cause: cause of the collection
 *
 * Description: A parallel mark sweep of objects needed for collection ends
 * 
 */

probe hotspot.gc_collect_PSMarkSweep_end =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__PSMarkSweep__end")
{
  name = "gc_collect_PSMarkSweep_end";
  address = sprintf("0x%x", $arg1);
  cause = $arg2;
  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
}

/*
 * probe - gc_collect_move
 * 
 * @name: gc_collect_move
 * @from_bottom_address: the bottom address of the object being moved
 * @from_top_address: the top address of the object being moved
 * @to_bottom_address: the bottom address of where the object is being moved to
 * @to_top_address: the top address of where the object is being moved to
 * @cause: cause of the collection
 *
 * Description: During garbage collections there are times where objects or 
 * blocks of memory need to be moved.  This probe will detail from where 
 * the memory is moving and where to.
 * 
 */

probe hotspot.gc_collect_move =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__move")
{
  name = "gc_collect_move";
  from_bottom_address = sprintf("0x%x", $arg1);
  from_top_address = sprintf("0x%x", $arg2);
  to_bottom_address = sprintf("0x%x", $arg3);
  to_top_address = sprintf("0x%x", $arg4);
  probestr = sprintf("%s(from_bottom_address='%s', from_top_address='%s', to_bottom_address='%s', to_top_address='%s')", name, from_bottom_address, from_top_address, to_bottom_address, to_top_address);

}

/*
 * probe - gc_collect_clear
 * 
 * @name: gc_collect_clear
 * @address: address of object being collected
 * @cause: cause of the collection
 *
 * Description: This probe dictates the region of data that needs to be 
 * cleared in a compaction action
 * 
 */

probe hotspot.gc_collect_clear =
  process("/home/lberk/code/icedtea7/build/openjdk.build-debug/j2sdk-image/jre/lib/amd64/server/libjvm.so").mark("gc__collection__ParallelCompact__clear")
{
  name = "gc_collect_clear";
  region_data = sprintf("0x%x", $arg1);
  data_location = sprintf("0x%x", $arg2);
  probestr = sprintf("%s(region_data='%s', data_location='%s')", name, region_data, data_location);
  
}

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-08 14:01       ` Lukas Berk
@ 2012-08-08 14:34         ` Mario Torre
  0 siblings, 0 replies; 27+ messages in thread
From: Mario Torre @ 2012-08-08 14:34 UTC (permalink / raw)
  To: Lukas Berk; +Cc: Mark Wielaard, systemtap, distro-pkg-dev

Il giorno mer, 08/08/2012 alle 10.01 -0400, Lukas Berk ha scritto:
> * Mark Wielaard <mjw@redhat.com> [2012-08-07 07:50]:
> [...]
> > If you could post eventcount.stp with some comments that would be really
> > helpful (even if it is just a work in progress) to better understand the
> > "meaning" of the new probe points for a Garbage Collector noob like me.

To be honest, I'm no expert of this (yet! :), but the patch looks good
to me in principle, and definitely very useful for our own thermostat
use cases, so, yeah, I would like to see this in if there are no
objections.

Cheers,
Mario

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-02 13:11 [RFC] Enhanced Garbage Collection Probe Points Lukas Berk
  2012-08-03 13:56 ` Mark Wielaard
@ 2012-08-08 20:37 ` Jon VanAlten
  2012-08-08 21:11   ` Lukas Berk
  2012-08-22 20:34 ` Lukas Berk
  2 siblings, 1 reply; 27+ messages in thread
From: Jon VanAlten @ 2012-08-08 20:37 UTC (permalink / raw)
  To: Lukas Berk; +Cc: systemtap, distro-pkg-dev



----- Original Message -----
> From: "Lukas Berk" <lberk@redhat.com>
> To: distro-pkg-dev@openjdk.java.net
> Cc: systemtap@sourceware.org
> Sent: Thursday, August 2, 2012 9:10:40 AM
> Subject: [RFC] Enhanced Garbage Collection Probe Points
> 
> Hey,
> 
> I've been working on adding improved probe point within the garbage
> collection system.  This will allow system administrators using
> various
> tools to better analyze which garbage collection algorithms are
> effective and java developers to better understand how (often) their
> objects are being collected.
> 
> Specific probe points that I've aimed to include are:
> 
> - G1, concurrent mark sweep, parallel mark sweep, and tenured
>   collections
> 
> - new generation definitions
> 
> - parallel scavenges
> 
> - parallel compaction
> 
> - object 'moves/resizes' between memory addresses
> 
> Please note that the attached patch should be appended to the
> patch/systemtap.patch file.  Any feedback or suggestions would be
> greatly appreciated.
> 

Hi Lukas,

I've had a look at the patch, and the rest of the thread (especially the
tapset you posted, which made things a LOT more clear so thanks for that).
I hope that you'll continue to refine the tapset and contribute that as
well so that us java hackers who are brave enough to play with Systemtap
have the nice friendly probe names and variables to work with!

The patch itself seems fine, although I'll just have to trust you that the
probes are in the right place as I'm not really a hotspot hacker myself.
Really I would hope that someone who is more familiar with the GC code
base will comment from that perspective.

I assume that none of these probes require any special VM args to function?
A related question, and this might be hard to answer being rather open
ended, but are you aware of any VM args that would affect/interfere with
the functioning of these probes?

There is a begin and and end probe for some types of collection and even
phases within collection, so it seems odd to me that for G1 stop-the-world
collection there is not.  Am I missing something?

Other than that; great start, this definitely has stuff interesting from a
Thermostat perspective and the potential for more :D

cheers,
jon

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-08 20:37 ` Jon VanAlten
@ 2012-08-08 21:11   ` Lukas Berk
  2012-08-08 22:05     ` Jon VanAlten
  0 siblings, 1 reply; 27+ messages in thread
From: Lukas Berk @ 2012-08-08 21:11 UTC (permalink / raw)
  To: Jon VanAlten; +Cc: systemtap, distro-pkg-dev

[-- Attachment #1: Type: text/plain, Size: 2459 bytes --]

* Jon VanAlten <jvanalte@redhat.com> [2012-08-08 16:38]:
[...]
> 
> Hi Lukas,
> 
> I've had a look at the patch, and the rest of the thread (especially the
> tapset you posted, which made things a LOT more clear so thanks for that).
> I hope that you'll continue to refine the tapset and contribute that as
> well so that us java hackers who are brave enough to play with Systemtap
> have the nice friendly probe names and variables to work with!
Thanks for taking a look, I'll make sure to include it in future
revisions, ideally I'll have a gc_details.stp.in file that will have the
.so path change based on the system it's being compiled for. (similar to
the hotspot{,_jni}.stp.in and jstack.stp.in files already included)
> 
> The patch itself seems fine, although I'll just have to trust you that the
> probes are in the right place as I'm not really a hotspot hacker myself.
> Really I would hope that someone who is more familiar with the GC code
> base will comment from that perspective.
> 
> I assume that none of these probes require any special VM args to function?
> A related question, and this might be hard to answer being rather open
> ended, but are you aware of any VM args that would affect/interfere with
> the functioning of these probes?
The only arguments that I can think of that will immediately effect
these probes are:
-XX:+UseSerialGC
-XX:+UseParallelGC
-XX:+UseParallelOldGC
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGc
-XX:+UseG1GC
which will force the JVM to use the designated type of garbage
collection.  There may be more I'm missing (please let me know if there
are).
> 
> There is a begin and and end probe for some types of collection and even
> phases within collection, so it seems odd to me that for G1 stop-the-world
> collection there is not.  Am I missing something?

My thought in adding the begin/end probes was to be able to track
parallel operations and tie a specific pid to an collection/scavenge to
an object.  That wouldn't be needed in serial operation.  However, now
that I think about it, it could be useful to mark the beginning and end
of 'serial' collections from a timing perspective, and its trivial to
add (I'll include it in a revised patch).
> 
> Other than that; great start, this definitely has stuff interesting from a
> Thermostat perspective and the potential for more :D
> 

Thanks for the comments,

Lukas

[1] - http://dacapobench.org/

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-08 21:11   ` Lukas Berk
@ 2012-08-08 22:05     ` Jon VanAlten
  0 siblings, 0 replies; 27+ messages in thread
From: Jon VanAlten @ 2012-08-08 22:05 UTC (permalink / raw)
  To: Lukas Berk; +Cc: systemtap, distro-pkg-dev



----- Original Message -----
> From: "Lukas Berk" <lberk@redhat.com>
> To: "Jon VanAlten" <jvanalte@redhat.com>
> Cc: systemtap@sourceware.org, distro-pkg-dev@openjdk.java.net
> Sent: Wednesday, August 8, 2012 5:11:23 PM
> Subject: Re: [RFC] Enhanced Garbage Collection Probe Points
> 
> * Jon VanAlten <jvanalte@redhat.com> [2012-08-08 16:38]:
> [...]
> > 
> > Hi Lukas,
> > 
> > I've had a look at the patch, and the rest of the thread
> > (especially the
> > tapset you posted, which made things a LOT more clear so thanks for
> > that).
> > I hope that you'll continue to refine the tapset and contribute
> > that as
> > well so that us java hackers who are brave enough to play with
> > Systemtap
> > have the nice friendly probe names and variables to work with!
> Thanks for taking a look, I'll make sure to include it in future
> revisions, ideally I'll have a gc_details.stp.in file that will have
> the
> .so path change based on the system it's being compiled for. (similar
> to
> the hotspot{,_jni}.stp.in and jstack.stp.in files already included)

Yep, that would be the Right Way for it to be included!

> > 
> > The patch itself seems fine, although I'll just have to trust you
> > that the
> > probes are in the right place as I'm not really a hotspot hacker
> > myself.
> > Really I would hope that someone who is more familiar with the GC
> > code
> > base will comment from that perspective.
> > 
> > I assume that none of these probes require any special VM args to
> > function?
> > A related question, and this might be hard to answer being rather
> > open
> > ended, but are you aware of any VM args that would affect/interfere
> > with
> > the functioning of these probes?
> The only arguments that I can think of that will immediately effect
> these probes are:
> -XX:+UseSerialGC
> -XX:+UseParallelGC
> -XX:+UseParallelOldGC
> -XX:+UseParNewGC
> -XX:+UseConcMarkSweepGc
> -XX:+UseG1GC
> which will force the JVM to use the designated type of garbage
> collection.  There may be more I'm missing (please let me know if
> there
> are).

Right, good to know.  I'd recommend documenting the specifics in
the tapset itself, much like is done for probes in hotspot.stp
(for example, monitor_wait).  No others come to mind, but there
sure are some esoteric options and I wouldn't presume to know them
all nor be familiar with the subtleties of their effects!

> > 
> > There is a begin and and end probe for some types of collection and
> > even
> > phases within collection, so it seems odd to me that for G1
> > stop-the-world
> > collection there is not.  Am I missing something?
> 
> My thought in adding the begin/end probes was to be able to track
> parallel operations and tie a specific pid to an collection/scavenge
> to
> an object.  That wouldn't be needed in serial operation.  However,
> now
> that I think about it, it could be useful to mark the beginning and
> end
> of 'serial' collections from a timing perspective, and its trivial to
> add (I'll include it in a revised patch).

On the other hand, some of these may be redundant.  See also from
hotspot.stp the probes mem_pool_gc_begin and mem_pool_gc_end.

cheers,
jon

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-02 13:11 [RFC] Enhanced Garbage Collection Probe Points Lukas Berk
  2012-08-03 13:56 ` Mark Wielaard
  2012-08-08 20:37 ` Jon VanAlten
@ 2012-08-22 20:34 ` Lukas Berk
  2012-08-24 19:59   ` Jon VanAlten
  2 siblings, 1 reply; 27+ messages in thread
From: Lukas Berk @ 2012-08-22 20:34 UTC (permalink / raw)
  To: distro-pkg-dev; +Cc: systemtap


[-- Attachment #1.1: Type: text/plain, Size: 16595 bytes --]

Hey list,

I've updated and attached my patch to reflect the comments made in 
the thread above, primarily:

- split begin and end probe points where possible

- correct probe point names

- include and autoconf version of the tapset for immediate inclusion

I've also run the DaCapo benchmarking suite[1] and have attached the
results below.

In order to properly judge the performance effects (if any) my probe
points have had on hotspot, I ran three different sets of tests
(using the eclipse benchmark).  First, with icedtea configured using
--disable-systemtap, then configured with systemtap and no probes
run, and finally with the gc probes in use with a basic log(probestr)
systemtap script. (ie $stap -ve 'probe hotspot.gc_* {log(probestr)}'
-c "java -jar dacapo-9.12-bach.jar eclise -n 10". I ran each test 4
times to get a better sample size.

--disable-systemtap:
run 1: 44119 msec
run 2: 43255 msec
run 3: 44517 msec
run 4: 44017 msec
--------------------
avg: 43977 msec

--enable-systemtap but not used:
run 1: 44987 msec
run 2: 47154 msec
run 3: 48099 msec
run 4: 41069 msec
--------------------
avg: 45327 msec

--enable-systemtap and used:
run 1: 47538 msec
run 2: 43264 msec
run 3: 40396 msec
run 4: 44422 msec
--------------------
avg: 43905 msec

Considering that the probe points seem to have relatively little impact
on the benchmarking results and the interest in my patch, what else
needs to be done to get this patch applied to icedtea?

Cheers,

Lukas

[1] http://dacapobench.org


* Lukas Berk <lberk@redhat.com> [2012-08-02 09:11]:
> Hey,
> 
> I've been working on adding improved probe point within the garbage
> collection system.  This will allow system administrators using various
> tools to better analyze which garbage collection algorithms are
> effective and java developers to better understand how (often) their
> objects are being collected.
> 
> Specific probe points that I've aimed to include are:
> 
> - G1, concurrent mark sweep, parallel mark sweep, and tenured
>   collections
> 
> - new generation definitions
> 
> - parallel scavenges
> 
> - parallel compaction
> 
> - object 'moves/resizes' between memory addresses
> 
> Please note that the attached patch should be appended to the
> patch/systemtap.patch file.  Any feedback or suggestions would be
> greatly appreciated.
> 
> Cheers,
> 
> Lukas

> diff -Nru openjdk.orig/hotspot/src/share/vm/memory/generation.cpp openjdk/hotspot/src/share/vm/memory/generation.cpp
> --- openjdk.orig/hotspot/src/share/vm/memory/generation.cpp	2012-06-15 11:36:43.022837742 -0400
> +++ openjdk/hotspot/src/share/vm/memory/generation.cpp	2012-06-15 13:35:39.714838057 -0400
> @@ -40,6 +40,11 @@
>  #include "runtime/java.hpp"
>  #include "utilities/copy.hpp"
>  #include "utilities/events.hpp"
> +#include "utilities/dtrace.hpp"
> +
> +#ifndef USDT2
> +  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig, bool, bool, size_t, bool);
> +#endif /* !USDT2 */
>  
>  Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
>    _level(level),
> @@ -471,6 +476,9 @@
>    ReferenceProcessorSpanMutator
>      x(ref_processor(), GenCollectedHeap::heap()->reserved_region());
>    GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs);
> +#ifndef USDT2
> +  HS_DTRACE_PROBE4(hotspot, gc__collection__contig, full, clear_all_soft_refs, size, is_tlab);
> +#endif  /* !USDT2 */
>    SpecializationStats::print();
>  }
>  
> diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
> --- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-06-15 11:36:42.164837741 -0400
> +++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-06-15 13:35:45.224838227 -0400
> @@ -55,6 +55,11 @@
>  #include "runtime/vmThread.hpp"
>  #include "services/memoryService.hpp"
>  #include "services/runtimeService.hpp"
> +#include "utilities/dtrace.hpp"
> +
> +#ifndef USDT2
> +  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig, bool, bool, size_t, bool);
> +#endif /* !USDT2 */
>  
>  // statics
>  CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
> @@ -1655,6 +1660,10 @@
>                             size_t size,
>                             bool   tlab)
>  {
> +
> +#ifndef USDT2
> +  HS_DTRACE_PROBE4(hotspot, gc__collection__contig, full, clear_all_soft_refs, size, tlab);
> +#endif /* !USDT2 */
>    if (!UseCMSCollectionPassing && _collectorState > Idling) {
>      // For debugging purposes skip the collection if the state
>      // is not currently idle
> diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
> --- openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-06-15 11:36:41.816837741 -0400
> +++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-06-15 13:35:56.298821181 -0400
> @@ -49,6 +49,11 @@
>  #include "utilities/copy.hpp"
>  #include "utilities/globalDefinitions.hpp"
>  #include "utilities/workgroup.hpp"
> +#include "utilities/dtrace.hpp"
> +
> +#ifndef USDT2
> +  HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew, bool, bool, size_t, bool);
> +#endif /* !USDT2 */
>  
>  #ifdef _MSC_VER
>  #pragma warning( push )
> @@ -878,6 +883,9 @@
>                                 bool   clear_all_soft_refs,
>                                 size_t size,
>                                 bool   is_tlab) {
> +#ifndef USDT2
> +  HS_DTRACE_PROBE4(hotspot, gc__collection__parnew, full, clear_all_soft_refs, size, is_tlab);
> +#endif  /* !USDT2 */
>    assert(full || size > 0, "otherwise we don't want to collect");
>    GenCollectedHeap* gch = GenCollectedHeap::heap();
>    assert(gch->kind() == CollectedHeap::GenCollectedHeap,
> diff -Nru openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp
> --- openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-06-15 11:36:42.970837742 -0400
> +++ openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-06-15 13:36:05.328838805 -0400
> @@ -39,6 +39,11 @@
>  #include "runtime/java.hpp"
>  #include "utilities/copy.hpp"
>  #include "utilities/stack.inline.hpp"
> +#include "utilities/dtrace.hpp"
> +
> +#ifndef USDT2
> +  HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew, bool, bool, size_t, bool);
> +#endif /* !USDT2 */
>  #ifdef TARGET_OS_FAMILY_linux
>  # include "thread_linux.inline.hpp"
>  #endif
> @@ -528,6 +533,9 @@
>                                 bool   clear_all_soft_refs,
>                                 size_t size,
>                                 bool   is_tlab) {
> +#ifndef USDT2
> +  HS_DTRACE_PROBE4(hotspot, gc__collection__defnew, full, clear_all_soft_refs, size, is_tlab);
> +#endif  /* !USDT2 */
>    assert(full || size > 0, "otherwise we don't want to collect");
>    GenCollectedHeap* gch = GenCollectedHeap::heap();
>    _next_gen = gch->next_gen(this);
> diff -Nru openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp
> --- openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-06-15 11:36:43.016837742 -0400
> +++ openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-06-15 13:36:08.848839364 -0400
> @@ -33,6 +33,11 @@
>  #include "memory/tenuredGeneration.hpp"
>  #include "oops/oop.inline.hpp"
>  #include "runtime/java.hpp"
> +#include "utilities/dtrace.hpp"
> +
> +#ifndef USDT2
> +  HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured, bool, bool, size_t, bool);
> +#endif /* !USDT2 */
>  
>  TenuredGeneration::TenuredGeneration(ReservedSpace rs,
>                                       size_t initial_byte_size, int level,
> @@ -307,6 +312,9 @@
>                                  size_t size,
>                                  bool   is_tlab) {
>    retire_alloc_buffers_before_full_gc();
> +#ifndef USDT2
> +  HS_DTRACE_PROBE4(hotspot, gc__collection__tenured, full, clear_all_soft_refs, size, is_tlab);
> +#endif  /* !USDT2 */
>    OneContigSpaceCardGeneration::collect(full, clear_all_soft_refs,
>                                          size, is_tlab);
>  }
> diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp
> --- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp
> +++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp
> @@ -40,8 +40,13 @@
>  #include "runtime/handles.inline.hpp"
>  #include "runtime/java.hpp"
>  #include "runtime/vmThread.hpp"
> +#include "utilities/dtrace.hpp"
>  #include "utilities/vmError.hpp"
>  
> +#ifndef USDT2
> +  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parscavenge, *uintptr_t, *uintptr_t);
> +#endif /* !USDT2 */
> +
>  PSYoungGen*  ParallelScavengeHeap::_young_gen = NULL;
>  PSOldGen*    ParallelScavengeHeap::_old_gen = NULL;
>  PSPermGen*   ParallelScavengeHeap::_perm_gen = NULL;
> @@ -806,6 +811,9 @@
>    }
>  
>    VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
> +#ifndef USDT2
> +  HS_DTRACE_PROBE2(hotspot, gc__collection__parscavenge, &op, cause);
> +#endif /* !USDT2 */
>    VMThread::execute(&op);
>  }
> 
> diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
> --- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-06-26 09:24:22.472325287 -0400
> +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-07-05 10:43:08.273800575 -0400
> @@ -45,8 +45,13 @@
>  #include "runtime/thread.hpp"
>  #include "runtime/vmThread.hpp"
>  #include "utilities/copy.hpp"
> +#include "utilities/dtrace.hpp"
>  #include "utilities/events.hpp"
>  
> +#ifndef USDT2
> +  HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1, *uintptr_t, *uintptr_t);
> +#endif /* !USDT2 */
> +
>  class HeapRegion;
>  
>  void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp,
> @@ -83,7 +88,9 @@
>    // We should save the marks of the currently locked biased monitors.
>    // The marking doesn't preserve the marks of biased objects.
>    BiasedLocking::preserve_marks();
> -
> +#ifndef USDT2
> +  HS_DTRACE_PROBE2(hotspot, gc__collection__G1, &sh, sh->gc_cause());
> +#endif /* !USDT2 */
>    mark_sweep_phase1(marked_for_unloading, clear_all_softrefs);
>  
>    mark_sweep_phase2();
> diff -Nru openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp openjdk/hotspot/src/share/vm/compiler/oopMap.cpp
> --- openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp	2012-06-26 09:24:22.390325184 -0400
> +++ openjdk/hotspot/src/share/vm/compiler/oopMap.cpp	2012-07-06 10:12:44.981413003 -0400
> @@ -33,9 +33,13 @@
>  #include "memory/resourceArea.hpp"
>  #include "runtime/frame.inline.hpp"
>  #include "runtime/signature.hpp"
> +#include "utilities/dtrace.hpp"
>  #ifdef COMPILER1
>  #include "c1/c1_Defs.hpp"
>  #endif
> +#ifndef USDT2
> +  HS_DTRACE_PROBE_DECL1(provider, gc__collection__delete, *uintptr_t);
> +#endif /* !USDT2 */
>  
>  // OopMapStream
>  
> @@ -677,6 +681,9 @@
>                      " - Derived: " INTPTR_FORMAT "  Base: " INTPTR_FORMAT " (Offset: %d)",
>            derived_loc, (address)*derived_loc, (address)base, offset);
>      }
> +#ifndef USDT2
> +  HS_DTRACE_PROBE1(hotspot, gc__collection__delete, entry);
> +#endif /* !USDT2 */
>  
>      // Delete entry
>      delete entry;
> --- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-12 09:48:40.349999515 -0400
> +++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-19 18:38:07.560757426 -0400
> @@ -53,11 +53,18 @@
>  #include "runtime/vmThread.hpp"
>  #include "services/management.hpp"
>  #include "services/memoryService.hpp"
> +#include "utilities/dtrace.hpp"
>  #include "utilities/events.hpp"
>  #include "utilities/stack.inline.hpp"
>  
>  #include <math.h>
>  
> +#ifndef USDT2
> +  HS_DTRACE_PROBE_DECL2(provider, gc__collection__ParallelCompact__clear, *uintptr_t, *uintptr_t);
> +  HS_DTRACE_PROBE_DECL2(provider, gc__collection__partest1, *uintptr_t, *uintptr_t);
> +  HS_DTRACE_PROBE_DECL4(provider, gc__collection__move, *uintptr_t, *uintptr_t, *uintptr_t, *uintptr_t);
> +#endif /* !USDT2 */
> +
>  // All sizes are in HeapWords.
>  const size_t ParallelCompactData::Log2RegionSize  = 9; // 512 words
>  const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
> @@ -433,6 +439,9 @@
>  
>  void ParallelCompactData::clear()
>  {
> +#ifndef USDT2
> +  HS_DTRACE_PROBE2(hotspot, gc__collection__ParallelCompact__clear, &_region_data, _region_data->data_location());
> +#endif /* !USDT2 */
>    memset(_region_data, 0, _region_vspace->committed_size());
>  }
>  
> @@ -1970,6 +1979,9 @@
>           "should be in vm thread");
>  
>    ParallelScavengeHeap* heap = gc_heap();
> +#ifndef USDT2
> +  HS_DTRACE_PROBE2(hotspot, gc__collection__partest1, heap, heap->gc_cause());
> +#endif /* !USDT2 */
>    GCCause::Cause gc_cause = heap->gc_cause();
>    assert(!heap->is_gc_active(), "not reentrant");
>  
> @@ -3376,6 +3388,9 @@
>    // past the end of the partial object entering the region (if any).
>    HeapWord* const dest_addr = sd.partial_obj_end(dp_region);
>    HeapWord* const new_top = _space_info[space_id].new_top();
> +#ifndef USDT2
> +  HS_DTRACE_PROBE4(hotspot, gc__collection__move, &beg_addr, &end_addr, &dest_addr, &new_top);
> +#endif /* !USDT2 */
>    assert(new_top >= dest_addr, "bad new_top value");
>    const size_t words = pointer_delta(new_top, dest_addr);
>  
> --- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-07-12 09:48:40.401000822 -0400
> +++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-07-19 18:36:43.787767399 -0400
> @@ -51,8 +51,12 @@
>  #include "runtime/vmThread.hpp"
>  #include "runtime/vm_operations.hpp"
>  #include "services/memoryService.hpp"
> +#include "utilities/dtrace.hpp"
>  #include "utilities/stack.inline.hpp"
>  
> +#ifndef USDT2
> +  HS_DTRACE_PROBE_DECL2(provider, name, *uintptr_t, *uintptr_t);
> +#endif /* !USDT2 */
>  
>  HeapWord*                  PSScavenge::_to_space_top_before_gc = NULL;
>  int                        PSScavenge::_consecutive_skipped_scavenges = 0;
> @@ -226,7 +230,13 @@
>    PSAdaptiveSizePolicy* policy = heap->size_policy();
>    IsGCActiveMark mark;
>  
> +#ifndef USDT2
> +  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__begin, *heap, heap->gc_cause());
> +#endif /* !USDT2 */
>    const bool scavenge_done = PSScavenge::invoke_no_policy();
> +#ifndef USDT2
> +  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__end, *heap, heap->gc_cause());
> +#endif /* !USDT2 */
>    const bool need_full_gc = !scavenge_done ||
>      policy->should_full_GC(heap->old_gen()->free_in_bytes());
>    bool full_gc_done = false;
> @@ -243,9 +253,27 @@
>      const bool clear_all_softrefs = cp->should_clear_all_soft_refs();
>  
>      if (UseParallelOldGC) {
> +#ifndef USDT2
> +  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__begin, *heap, heap->gc_cause()); 
> +#endif /* !USDT2 */
> +
>        full_gc_done = PSParallelCompact::invoke_no_policy(clear_all_softrefs);
> +
> +#ifndef USDT2
> +  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__end, *heap, heap->gc_cause());
> +#endif /* !USDT2 */
> +
>      } else {
> +
> +#ifndef USDT2
> +  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__begin, *heap, heap->gc_cause());
> +#endif /* !USDT2 */
> +
>        full_gc_done = PSMarkSweep::invoke_no_policy(clear_all_softrefs);
> +
> +#ifndef USDT2
> +  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__end, *heap, heap->gc_cause());
> +#endif /* !USDT2 */
>      }
>    }
>  




[-- Attachment #1.2: icedtea.patch --]
[-- Type: text/plain, Size: 35557 bytes --]

diff -r 60bd733bd20c Makefile.am
--- a/Makefile.am	Thu Aug 16 01:07:29 2012 +0100
+++ b/Makefile.am	Wed Aug 22 16:32:18 2012 -0400
@@ -747,6 +747,7 @@
 	tapset/hotspot.stp.in \
 	tapset/hotspot_jni.stp.in \
 	tapset/jstack.stp.in \
+	tapset/gc_details.stp.in \
 	scripts/jni_create_stap.c \
 	scripts/jni_desc \
 	rewriter/agpl-3.0.txt \
@@ -1713,11 +1714,16 @@
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  sed -e '/\/client\/libjvm.so/d' \
+	    < $(abs_top_builddir)/tapset/gc_details.stp \
+	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/gc_details.stp; \
 	else \
 	  cp $(abs_top_builddir)/tapset/hotspot.stp \
 	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
 	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  cp $(abs_top_builddir)/tapset/gc_details.stp \
+	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/gc_details.stp; \
 	fi; \
 	cp $(abs_top_builddir)/tapset/jstack.stp \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
@@ -1779,11 +1785,16 @@
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    > $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  sed -e '/\/client\/libjvm.so/d' \
+	    < $(abs_top_builddir)/tapset/gc_details.stp \
+	    > $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/gc_details.stp; \
 	else \
 	  cp $(abs_top_builddir)/tapset/hotspot.stp \
 	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
 	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  cp $(abs_top_builddir)/tapset/gc_details.stp \
+	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/gc_details.stp; \
 	fi; \
 	cp $(abs_top_builddir)/tapset/jstack.stp \
 	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
diff -r 60bd733bd20c configure.ac
--- a/configure.ac	Thu Aug 16 01:07:29 2012 +0100
+++ b/configure.ac	Wed Aug 22 16:32:18 2012 -0400
@@ -313,6 +313,7 @@
   AC_CONFIG_FILES([tapset/hotspot.stp])
   AC_CONFIG_FILES([tapset/hotspot_jni.stp])
   AC_CONFIG_FILES([tapset/jstack.stp])
+  AC_CONFIG_FILES([tapset/gc_details.stp])
 fi
 
 dnl Check for libXtst headers and libraries.
diff -r 60bd733bd20c patches/systemtap.patch
--- a/patches/systemtap.patch	Thu Aug 16 01:07:29 2012 +0100
+++ b/patches/systemtap.patch	Wed Aug 22 16:32:18 2012 -0400
@@ -138,3 +138,375 @@
  
  #endif /* !USDT2 */
  
+diff -Nru openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp openjdk/hotspot/src/share/vm/compiler/oopMap.cpp
+--- openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp	2012-06-26 09:24:22.390325184 -0400
++++ openjdk/hotspot/src/share/vm/compiler/oopMap.cpp	2012-07-06 10:12:44.981413003 -0400
+@@ -33,9 +33,13 @@
+ #include "memory/resourceArea.hpp"
+ #include "runtime/frame.inline.hpp"
+ #include "runtime/signature.hpp"
++#include "utilities/dtrace.hpp"
+ #ifdef COMPILER1
+ #include "c1/c1_Defs.hpp"
+ #endif
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL1(provider, gc__collection__delete, *uintptr_t);
++#endif /* !USDT2 */
+ 
+ // OopMapStream
+ 
+@@ -677,6 +681,9 @@
+                     " - Derived: " INTPTR_FORMAT "  Base: " INTPTR_FORMAT " (Offset: %d)",
+           derived_loc, (address)*derived_loc, (address)base, offset);
+     }
++#ifndef USDT2
++  HS_DTRACE_PROBE1(hotspot, gc__collection__delete, entry);
++#endif /* !USDT2 */
+ 
+     // Delete entry
+     delete entry;
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-12 09:48:40.349999515 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-19 18:38:07.560757426 -0400
+@@ -53,11 +53,18 @@
+ #include "runtime/vmThread.hpp"
+ #include "services/management.hpp"
+ #include "services/memoryService.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ #include "utilities/stack.inline.hpp"
+ 
+ #include <math.h>
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__ParallelCompact__clear, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parallel__collect, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__move, *uintptr_t, *uintptr_t, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
++
+ // All sizes are in HeapWords.
+ const size_t ParallelCompactData::Log2RegionSize  = 9; // 512 words
+ const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
+@@ -433,6 +439,9 @@
+ 
+ void ParallelCompactData::clear()
+ {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__ParallelCompact__clear, &_region_data, _region_data->data_location());
++#endif /* !USDT2 */
+   memset(_region_data, 0, _region_vspace->committed_size());
+ }
+ 
+@@ -1970,6 +1979,9 @@
+          "should be in vm thread");
+ 
+   ParallelScavengeHeap* heap = gc_heap();
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__parallel__collect, heap, heap->gc_cause());
++#endif /* !USDT2 */
+   GCCause::Cause gc_cause = heap->gc_cause();
+   assert(!heap->is_gc_active(), "not reentrant");
+ 
+@@ -3376,6 +3388,9 @@
+   // past the end of the partial object entering the region (if any).
+   HeapWord* const dest_addr = sd.partial_obj_end(dp_region);
+   HeapWord* const new_top = _space_info[space_id].new_top();
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__move, &beg_addr, &end_addr, &dest_addr, &new_top);
++#endif /* !USDT2 */
+   assert(new_top >= dest_addr, "bad new_top value");
+   const size_t words = pointer_delta(new_top, dest_addr);
+ 
+diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-08-15 12:04:43.837439833 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-08-15 12:01:47.897745719 -0400
+@@ -45,8 +45,13 @@
+ #include "runtime/thread.hpp"
+ #include "runtime/vmThread.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1__end, *uintptr_t, *uintptr_t);
++ #endif /* !USDT2 */ 
+ class HeapRegion;
+ 
+ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp,
+@@ -84,6 +89,9 @@
+   // The marking doesn't preserve the marks of biased objects.
+   BiasedLocking::preserve_marks();
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__G1__begin, &sh, sh->gc_cause());
++#endif /* !USDT2 */
+   mark_sweep_phase1(marked_for_unloading, clear_all_softrefs);
+ 
+   mark_sweep_phase2();
+@@ -103,6 +111,9 @@
+   GenRemSet* rs = sh->rem_set();
+   rs->invalidate(sh->perm_gen()->used_region(), true /*whole_heap*/);
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__G1__end, &sh, sh->gc_cause());
++#endif /* !USDT2 */
+   // "free at last gc" is calculated from these.
+   // CHF: cheating for now!!!
+   //  Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity());
+diff -Nru openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp 
+--- openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-08-15 12:03:43.009543167 -0400
++++ openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-08-15 12:14:25.414381449 -0400
+@@ -33,6 +33,12 @@
+ #include "memory/tenuredGeneration.hpp"
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ TenuredGeneration::TenuredGeneration(ReservedSpace rs,
+                                      size_t initial_byte_size, int level,
+@@ -307,8 +313,14 @@
+                                 size_t size,
+                                 bool   is_tlab) {
+   retire_alloc_buffers_before_full_gc();
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__tenured__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   OneContigSpaceCardGeneration::collect(full, clear_all_soft_refs,
+                                         size, is_tlab);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__tenured__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+ }
+ 
+ void TenuredGeneration::update_gc_stats(int current_level,
+diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-08-15 12:03:43.039543116 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-08-15 12:18:57.181932342 -0400
+@@ -49,6 +49,12 @@
+ #include "utilities/copy.hpp"
+ #include "utilities/globalDefinitions.hpp"
+ #include "utilities/workgroup.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ #ifdef _MSC_VER
+ #pragma warning( push )
+@@ -878,6 +884,9 @@
+                                bool   clear_all_soft_refs,
+                                size_t size,
+                                bool   is_tlab) {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__parnew__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   assert(full || size > 0, "otherwise we don't want to collect");
+   GenCollectedHeap* gch = GenCollectedHeap::heap();
+   assert(gch->kind() == CollectedHeap::GenCollectedHeap,
+@@ -1032,6 +1041,10 @@
+     gch->print_heap_change(gch_prev_used);
+   }
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__parnew__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
++
+   if (PrintGCDetails && ParallelGCVerbose) {
+     TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats());
+     TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats());
+diff -Nru openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp
+--- openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-08-15 12:03:43.010543164 -0400
++++ openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-08-15 12:21:41.076673646 -0400
+@@ -38,6 +38,7 @@
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/stack.inline.hpp"
+ #ifdef TARGET_OS_FAMILY_linux
+ # include "thread_linux.inline.hpp"
+@@ -51,7 +52,10 @@
+ #ifdef TARGET_OS_FAMILY_bsd
+ # include "thread_bsd.inline.hpp"
+ #endif
+-
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ //
+ // DefNewGeneration functions.
+ 
+@@ -528,6 +532,9 @@
+                                bool   clear_all_soft_refs,
+                                size_t size,
+                                bool   is_tlab) {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__defnew__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   assert(full || size > 0, "otherwise we don't want to collect");
+   GenCollectedHeap* gch = GenCollectedHeap::heap();
+   _next_gen = gch->next_gen(this);
+@@ -661,6 +668,10 @@
+   // does not guarantee monotonicity.
+   jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
+   update_time_of_last_gc(now);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__defnew__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
++
+ }
+ 
+ class RemoveForwardPointerClosure: public ObjectClosure {
+diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-08-15 12:03:43.044543106 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-08-15 12:25:26.632316692 -0400
+@@ -55,6 +55,12 @@
+ #include "runtime/vmThread.hpp"
+ #include "services/memoryService.hpp"
+ #include "services/runtimeService.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ // statics
+ CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
+@@ -1647,7 +1653,13 @@
+                                             size_t size,
+                                             bool   tlab)
+ {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__begin, full, clear_all_soft_refs, size, tlab);
++#endif /* !USDT2 */
+   collector()->collect(full, clear_all_soft_refs, size, tlab);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__end, full, clear_all_soft_refs, size, tlab);
++#endif /* !USDT2 */
+ }
+ 
+ void CMSCollector::collect(bool   full,
+diff -Nru openjdk.orig/hotspot/src/share/vm/memory/generation.cpp openjdk/hotspot/src/share/vm/memory/generation.cpp
+--- openjdk.orig/hotspot/src/share/vm/memory/generation.cpp	2012-08-15 12:03:43.009543167 -0400
++++ openjdk/hotspot/src/share/vm/memory/generation.cpp	2012-08-15 12:27:46.378095083 -0400
+@@ -39,8 +39,14 @@
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
++
+ Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
+   _level(level),
+   _ref_processor(NULL) {
+@@ -470,7 +476,13 @@
+   // refs discovery is over the entire heap, not just this generation
+   ReferenceProcessorSpanMutator
+     x(ref_processor(), GenCollectedHeap::heap()->reserved_region());
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   SpecializationStats::print();
+ }
+ 
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	2012-08-15 12:03:43.046543102 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	2012-08-15 12:53:47.762647059 -0400
+@@ -40,8 +40,13 @@
+ #include "runtime/handles.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "runtime/vmThread.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/vmError.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parscavenge, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
++
+ PSYoungGen*  ParallelScavengeHeap::_young_gen = NULL;
+ PSOldGen*    ParallelScavengeHeap::_old_gen = NULL;
+ PSPermGen*   ParallelScavengeHeap::_perm_gen = NULL;
+@@ -806,6 +811,9 @@
+   }
+ 
+   VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__parscavenge, &op, cause);
++#endif /* !USDT2 */
+   VMThread::execute(&op);
+ }
+ 
+diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-07-25 13:24:07.000000000 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-08-17 10:26:44.181117802 -0400
+@@ -51,8 +51,17 @@
+ #include "runtime/vmThread.hpp"
+ #include "runtime/vm_operations.hpp"
+ #include "services/memoryService.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/stack.inline.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSScavenge__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSScavenge__end, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSParallelCompact__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSParallelCompact__end, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSMarkSweep__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSMarkSweep__end, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
+ 
+ HeapWord*                  PSScavenge::_to_space_top_before_gc = NULL;
+ int                        PSScavenge::_consecutive_skipped_scavenges = 0;
+@@ -226,7 +235,13 @@
+   PSAdaptiveSizePolicy* policy = heap->size_policy();
+   IsGCActiveMark mark;
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__begin, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+   const bool scavenge_done = PSScavenge::invoke_no_policy();
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__end, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+   const bool need_full_gc = !scavenge_done ||
+     policy->should_full_GC(heap->old_gen()->free_in_bytes());
+   bool full_gc_done = false;
+@@ -243,9 +258,21 @@
+     const bool clear_all_softrefs = cp->should_clear_all_soft_refs();
+ 
+     if (UseParallelOldGC) {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__begin, *heap, heap->gc_cause()); 
++#endif /* !USDT2 */
+       full_gc_done = PSParallelCompact::invoke_no_policy(clear_all_softrefs);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__end, *heap, heap->gc_cause()); 
++#endif /* !USDT2 */
+     } else {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__begin, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+       full_gc_done = PSMarkSweep::invoke_no_policy(clear_all_softrefs);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__end, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+     }
+   }
+ 
diff -r 60bd733bd20c tapset/gc_details.stp.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tapset/gc_details.stp.in	Wed Aug 22 16:32:18 2012 -0400
@@ -0,0 +1,495 @@
+/*
+ * probe - gc_collect_contig_begin
+ * 
+ * @name: gc_collect_contig_begin
+ * @is_full: If TRUE, attempt a full collection of the generation
+ * @size: word size to be cleaned
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the start of a contiguous space generation collection
+ * 
+ */
+
+probe hotspot.gc_collect_contig_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__contig__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__contig__begin")
+{
+
+  name = "gc_collect_contig_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_contig_end
+ * 
+ * @name: gc_collect_contig_end_
+ * @is_full: If TRUE, attempt a full collection of the generation
+ * @size: word size to be cleaned
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a contiguous space generation collection
+ * 
+ */
+
+probe hotspot.gc_collect_contig_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__contig__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__contig__end")
+{
+
+  name = "gc_collect_contig_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parnew_begin
+ * 
+ * @name: gc_collect_parnew_begin
+ * @is_full: If TRUE, attempt a full collection of the generation
+ * @size: word size to be cleaned
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the beginning of a parallel collection of a new 
+ * generation.
+ * This is different than a gc_collect_parallel generation due to it being
+ * specifically defined as a parNewGeneration
+ * 
+ */
+
+probe hotspot.gc_collect_parnew = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parnew__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parnew__begin")
+{
+
+  name = "gc_collect_parnew_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parnew_end
+ * 
+ * @name: gc_collect_parnew_end
+ * @is_full: If TRUE, attempt a full collection of the generation
+ * @size: word size to be cleaned
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a parallel collection of a new 
+ * generation.
+ * This is different than a gc_collect_parallel generation due to it being
+ * specifically defined as a parNewGeneration
+ * 
+ */
+
+probe hotspot.gc_collect_parnew_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parnew__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parnew__end")
+{
+
+  name = "gc_collect_parnew_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_defnew_begin
+ * 
+ * @name: gc_collect_defnew_begin
+ * @is_full: If TRUE, attempt a full collection of the generation
+ * @size: word size to be cleaned
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: The start of a newly defined generation collection
+ * 
+ */
+
+probe hotspot.gc_collect_defnew_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__defnew__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__defnew__begin")
+{
+
+  name = "gc_collect_defnew_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_defnew_end
+ * 
+ * @name: gc_collect_defnew_end
+ * @is_full: If TRUE, attempt a full collection of the generation
+ * @size: word size to be cleaned
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: The end of a newly defined generation collection
+ * 
+ */
+
+probe hotspot.gc_collect_defnew_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__defnew__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__defnew__end")
+{
+
+  name = "gc_collect_defnew_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_tenured_begin
+ * 
+ * @name: gc_collect_tenured_begin
+ * @is_full: If TRUE, attempt a full collection of the generation
+ * @size: word size to be cleaned
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This is the start of a collection of a tenured generation
+ * (a geneartion that has survived multiple garbage collections and is 
+ * now in a 'tenured' object space.
+ * 
+ */
+
+probe hotspot.gc_collect_tenured_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__tenured__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__tenured__begin")
+{
+
+  name = "gc_collect_tenured_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_tenured_end
+ * 
+ * @name: gc_collect_tenured_end
+ * @is_full: If TRUE, attempt a full collection of the generation
+ * @size: word size to be cleaned
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This is the end of a collection of a tenured generation
+ * (a geneartion that has survived multiple garbage collections and is 
+ * now in a 'tenured' object space.
+ * 
+ */
+
+probe hotspot.gc_collect_tenured_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__tenured__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__tenured__end")
+{
+
+  name = "gc_collect_tenured_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parallel_scavenge
+ * 
+ * @name: gc_collect_parallel_scavenge
+ * @address: address of object being collected
+ * @cause: cause of the collection
+ * 
+ * Description: This is a parallel collection, where the jvm process don't
+ * have to halt while the gc is being completed
+ */
+
+probe hotspot.gc_collect_parallel_scavenge =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parscavenge"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parscavenge")
+{
+  name = "gc_collect_parallel_scavenge";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_parallel_collect
+ * 
+ * @name: gc_collect_parallel_collect
+ * @address: address of object being collected
+ * @cause: cause of the collection
+ *
+ * Description: Another placement of a parallel collection
+ * 
+ */
+
+probe hotspot.gc_collect_parallel_collect =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parallel__collect"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parallel__collect")
+{
+  name = "gc_collect_parallel_collect";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_g1_begin
+ * 
+ * @name: gc_collect_g1_begin
+ * @address: address of object being collected
+ * @cause: cause of the collection
+ *
+ * Description: A G1 style garbage collection (halt the world garbage collection)
+ * 
+ */
+
+probe hotspot.gc_collect_g1_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__G1__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__G1__begin")
+{
+  name = "gc_collect_g1_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_g1_end
+ * 
+ * @name: gc_collect_g1_end
+ * @address: address of object being collected
+ * @cause: cause of the collection
+ *
+ * Description: A G1 style garbage collection (halt the world garbage collection)
+ * 
+ */
+
+probe hotspot.gc_collect_g1_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__G1__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__G1__end")
+{
+  name = "gc_collect_g1_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_delete
+ * 
+ * @name: gc_collect_delete
+ * @address: address of object being collected
+ * @cause: cause of the collection
+ *
+ * Description: A delete statement of an obeject
+ * 
+ */
+
+probe hotspot.gc_collect_delete =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__delete"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__delete")
+{
+  name = "gc_collect_delete";
+  address = sprintf("0x%x", $arg1);
+  probestr = sprintf("%s(address='%s')", name, address);
+}
+
+/*
+ * probe - gc_collect_PSScavenge_begin
+ * 
+ * @name: gc_collect_PSScavenge_begin
+ * @address: address of scavenge
+ * @cause: cause of the collection
+ *
+ * Description: A parallel scavenge begins.  A scavenge is a partial garbage
+ * collection which should be much more common than a full garbage collection
+ * throughout the course of the java program.
+ * 
+ */
+
+probe hotspot.gc_collect_PSScavenge_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSScavenge__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSScavenge__begin")
+{
+  name = "gc_collect_PSScavenge_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSScavenge_end
+ * 
+ * @name: gc_collect_PSScavenge_end
+ * @address: address of scavenge
+ * @cause: cause of the collection
+ *
+ * Description: The end of the parallel scavenge.  The beginning and end of
+ * the scavenge is noted due to the possbility of multiple scavenges occuring
+ * at the same time
+ * 
+ */
+
+probe hotspot.gc_collect_PSScavenge_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSScavenge__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSScavenge__end")
+{
+  name = "gc_collect_PSScavenge_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSParallelCompact_begin
+ * 
+ * @name: gc_collect_PSParallelCompact_begin
+ * @address: address of compaction
+ * @cause: cause of the collection
+ *
+ * Description: A parallel compaction of a memory space
+ * 
+ */
+
+probe hotspot.gc_collect_PSParallelCompact_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__begin")
+{
+  name = "gc_collect_PSParallelCompact_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSParallelCompact_end
+ * 
+ * @name: gc_collect_PSParallelCompact_end
+ * @address: address of compaction
+ * @cause: cause of the collection
+ *
+ * Description: A parallel compaction of a memory space
+ * 
+ */
+
+probe hotspot.gc_collect_PSParallelCompact_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__end")
+{
+  name = "gc_collect_PSParallelCompact_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSMarkSweep_begin
+ * 
+ * @name: gc_collect_PSMarkSweep_begin
+ * @address: address of parallel mark sweep process
+ * @cause: cause of the collection
+ *
+ * Description: A parallel mark sweep of objects needed for collection begins
+ * 
+ */
+
+probe hotspot.gc_collect_PSMarkSweep_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__begin")
+{
+  name = "gc_collect_PSMarkSweep_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSMarkSweep_end
+ * 
+ * @name: gc_collect_PSMarkSweep_end
+ * @address: address of parallel mark sweep process
+ * @cause: cause of the collection
+ *
+ * Description: A parallel mark sweep of objects needed for collection ends
+ * 
+ */
+
+probe hotspot.gc_collect_PSMarkSweep_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__end")
+{
+  name = "gc_collect_PSMarkSweep_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_move
+ * 
+ * @name: gc_collect_move
+ * @from_bottom_address: the bottom address of the object being moved
+ * @from_top_address: the top address of the object being moved
+ * @to_bottom_address: the bottom address of where the object is being moved to
+ * @to_top_address: the top address of where the object is being moved to
+ * @cause: cause of the collection
+ *
+ * Description: During garbage collections there are times where objects or 
+ * blocks of memory need to be moved.  This probe will detail from where 
+ * the memory is moving and where to.
+ * 
+ */
+
+probe hotspot.gc_collect_move =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__move"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__move")
+{
+  name = "gc_collect_move";
+  from_bottom_address = sprintf("0x%x", $arg1);
+  from_top_address = sprintf("0x%x", $arg2);
+  to_bottom_address = sprintf("0x%x", $arg3);
+  to_top_address = sprintf("0x%x", $arg4);
+  probestr = sprintf("%s(from_bottom_address='%s', from_top_address='%s', to_bottom_address='%s', to_top_address='%s')", name, from_bottom_address, from_top_address, to_bottom_address, to_top_address);
+
+}
+
+/*
+ * probe - gc_collect_clear
+ * 
+ * @name: gc_collect_clear
+ * @address: address of object being collected
+ * @cause: cause of the collection
+ *
+ * Description: This probe dictates the region of data that needs to be 
+ * cleared in a compaction action
+ * 
+ */
+
+probe hotspot.gc_collect_clear =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__ParallelCompact__clear"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__ParallelCompact__clear")
+{
+  name = "gc_collect_clear";
+  region_data = sprintf("0x%x", $arg1);
+  data_location = sprintf("0x%x", $arg2);
+  probestr = sprintf("%s(region_data='%s', data_location='%s')", name, region_data, data_location);
+  
+}

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-22 20:34 ` Lukas Berk
@ 2012-08-24 19:59   ` Jon VanAlten
  2012-08-28 21:23     ` Lukas Berk
  0 siblings, 1 reply; 27+ messages in thread
From: Jon VanAlten @ 2012-08-24 19:59 UTC (permalink / raw)
  To: Lukas Berk; +Cc: systemtap, distro-pkg-dev, Mark Wielaard



----- Original Message -----
> From: "Lukas Berk" <lberk@redhat.com>
> To: distro-pkg-dev@openjdk.java.net
> Cc: systemtap@sourceware.org
> Sent: Wednesday, August 22, 2012 4:33:09 PM
> Subject: Re: [RFC] Enhanced Garbage Collection Probe Points
> 
> Hey list,
> 
> I've updated and attached my patch to reflect the comments made in
> the thread above, primarily:
> 
> - split begin and end probe points where possible
> 
> - correct probe point names
> 
> - include and autoconf version of the tapset for immediate inclusion
> 

Definite improvements!

There's some nit's I'd like to see addressed.  Mostly consistency and
clarity in comments/documentation.  Details:

We have a hotspot.stp, a hotspot_jni.stp; maybe this one should be
hotspot_gc.stp?

Adding this fluff to the existing systemtap.patch, may not be the
best way.  As I understand it, Mark is trying to get the existing
stuff upstream.  Combining this into same IcedTea patch may make
it more difficult if/when this upstreaming is eventually successful
and needs to be removed from IcedTea.  I'd suggest introducing a
separate patch to the icedtea sources.

+ * @size: word size to be cleaned

(in several places)
This wording (pun not intended) is not entirely clear.  Playing the
ignorant reader, I am not sure if this means the wordsize that the
jvm uses, or the total space, in words, that will be collected on
this gc run.  Can this be clarified?

+ * @is_full: If TRUE, attempt a full collection of the generation

And if not TRUE?  (again playing the ignorant reader).

+ * Description: This marks the end of a parallel collection of a new 
+ * generation.
+ * This is different than a gc_collect_parallel generation due to it being
+ * specifically defined as a parNewGeneration

The 'clarification' sentence reads to me like "Y is not X because it
is Y".  I'd consider leaving it off, or providing a better explanation.

+ * Description: The start of a newly defined generation collection

The previous probes' documentation says "This marks the...", I'd love
to see consistency in the wording.

+ * Description: This is the start of a collection of a tenured generation
+ * (a geneartion that has survived multiple garbage collections and is 

Here too, also typo "generation"

+ * probe - gc_collect_parallel_scavenge
+ * 
+ * @name: gc_collect_parallel_scavenge
+ * @address: address of object being collected
+ * @cause: cause of the collection
+ * 
+ * Description: This is a parallel collection, where the jvm process don't
+ * have to halt while the gc is being completed

I want to make sure I understand this.  If I read this correctly, this
probe fires many times between a begin and end of parallel gc run, for
each object that is scavenged?  If I do understand this, then saying
"this is a parallel collection" I think is the wrong wording.  This
is not a collection, but an event that is part of a collection run.  If
I misunderstand, please clarify :)

+ * Description: A delete statement of an obeject

Typo "obeject"

Otherwise, I don't really have any concerns with this.  I hope though
that Mark (who introduced the systemtap support for the existing
probes) could also take a look for sanity.  I've added him to CC
directly, even though he probably also gets this through the list.

> I've also run the DaCapo benchmarking suite[1] and have attached the
> results below.
> 
> In order to properly judge the performance effects (if any) my probe
> points have had on hotspot, I ran three different sets of tests
> (using the eclipse benchmark).  First, with icedtea configured using
> --disable-systemtap, then configured with systemtap and no probes
> run, and finally with the gc probes in use with a basic log(probestr)
> systemtap script. (ie $stap -ve 'probe hotspot.gc_* {log(probestr)}'
> -c "java -jar dacapo-9.12-bach.jar eclise -n 10". I ran each test 4
> times to get a better sample size.
> 
> --disable-systemtap:
> run 1: 44119 msec
> run 2: 43255 msec
> run 3: 44517 msec
> run 4: 44017 msec
> --------------------
> avg: 43977 msec
> 
> --enable-systemtap but not used:
> run 1: 44987 msec
> run 2: 47154 msec
> run 3: 48099 msec
> run 4: 41069 msec
> --------------------
> avg: 45327 msec
> 
> --enable-systemtap and used:
> run 1: 47538 msec
> run 2: 43264 msec
> run 3: 40396 msec
> run 4: 44422 msec
> --------------------
> avg: 43905 msec
> 
> Considering that the probe points seem to have relatively little
> impact
> on the benchmarking results and the interest in my patch, 

I think there's more to look at in terms of performance.  However,
despite what the numbers here show, from my understanding (Mark,
please chime in here!) the existence of these probes in the source
should in theory not affect runtime performance.  Otherwise, I might
be asking to see data for --enable-systemtap w/o this patch as well
to compare really what this patch adds.  Anyhow, unless I am quite
wrong about this, I don't think there is any performance concern
for adding these probes, only for when they are used.  So, consider
my next paragraph not for this patch, but more generally to discuss
performance impact of using these probes.

These numbers do seem to raise some questions, though.  Why do we
see such variation between the runs?  I'd encourage you to explore
this further.  Another aspect to consider: looking at run time of
benchmark will show the impact aggregated over entire java process,
but it would be interesting to see the impact relative to time
actually spent in gc.  I'd be concerned if simply printing this
probestr at beginning and end of gc made the gc run last 10% longer,
even if it looks relatively minor aggregated over full java process
run time.  I'm not sure how you'd go about trying to measure this,
however.

> what else
> needs to be done to get this patch applied to icedtea?
> 

Well, I am basically OK with this aside from the things mentioned
above.  I guess remaining still is the question of testing these.  I
wouldn't block this based on lacking tests (the previous probes went
untested for ages before I added tests), but I also don't want this
to go in without a plan to eventually add tests; when we did add
tests for the other probes, we actually found regressions and even
things that had never properly worked iirc.

Have you given any thought to how you might add tests for these
probes to the existing set of probe tests?

cheers,
jon

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-24 19:59   ` Jon VanAlten
@ 2012-08-28 21:23     ` Lukas Berk
  2012-08-29 11:52       ` Mark Wielaard
  2012-08-30  1:19       ` Jon VanAlten
  0 siblings, 2 replies; 27+ messages in thread
From: Lukas Berk @ 2012-08-28 21:23 UTC (permalink / raw)
  To: Jon VanAlten; +Cc: systemtap, distro-pkg-dev, Mark Wielaard


[-- Attachment #1.1: Type: text/plain, Size: 7061 bytes --]

Hey Jon,

Thanks for the comments, I've resolved them or explained them inline.
* Jon VanAlten <jvanalte@redhat.com> [2012-08-24 15:59]:
> 
[...]
> We have a hotspot.stp, a hotspot_jni.stp; maybe this one should be
> hotspot_gc.stp?
Done, its now included as hotspot_gc.stp.in
> 
> Adding this fluff to the existing systemtap.patch, may not be the
> best way.  As I understand it, Mark is trying to get the existing
> stuff upstream.  Combining this into same IcedTea patch may make
> it more difficult if/when this upstreaming is eventually successful
> and needs to be removed from IcedTea.  I'd suggest introducing a
> separate patch to the icedtea sources.
Makes sense to me, I've adjusted the autoconf files accordingly to
include and apply patches/systemtap_gc.patch if icedtea is configure
with --enable-systemtap.
> 
> + * @size: word size to be cleaned
> 
> (in several places)
> This wording (pun not intended) is not entirely clear.  Playing the
> ignorant reader, I am not sure if this means the wordsize that the
> jvm uses, or the total space, in words, that will be collected on
> this gc run.  Can this be clarified?
I've changed this to: "Word size of the object to be collected."
> 
> + * @is_full: If TRUE, attempt a full collection of the generation
> 
> And if not TRUE?  (again playing the ignorant reader).
if its false then perform a scavenge, I've adjusted the docs accordingly
> 
> + * Description: This marks the end of a parallel collection of a new 
> + * generation.
> + * This is different than a gc_collect_parallel generation due to it being
> + * specifically defined as a parNewGeneration
> 
> The 'clarification' sentence reads to me like "Y is not X because it
> is Y".  I'd consider leaving it off, or providing a better explanation.
I see what you're saying.  I've removed it.
> 
> + * Description: The start of a newly defined generation collection
> 
> The previous probes' documentation says "This marks the...", I'd love
> to see consistency in the wording.
I've changed this to be consistent throughout. Also, I've made sure that
all capitalization and punctuation is correct/consistent.
> 
> + * Description: This is the start of a collection of a tenured generation
> + * (a geneartion that has survived multiple garbage collections and is 
> 
> Here too, also typo "generation"
Fixed.
> 
> + * probe - gc_collect_parallel_scavenge
> + * 
> + * @name: gc_collect_parallel_scavenge
> + * @address: address of object being collected
> + * @cause: cause of the collection
> + * 
> + * Description: This is a parallel collection, where the jvm process don't
> + * have to halt while the gc is being completed
> 
> I want to make sure I understand this.  If I read this correctly, this
> probe fires many times between a begin and end of parallel gc run, for
> each object that is scavenged?  If I do understand this, then saying
> "this is a parallel collection" I think is the wrong wording.  This
> is not a collection, but an event that is part of a collection run.  If
> I misunderstand, please clarify :)
No, a scavenge is just a miniature collection, not a process within a
collection.  The mechanics are the same, just not on the entire object
space/heap.  That being said I've s/This is a parallel collection/This
is a parallel scavenge/ to be specific.
> 
> + * Description: A delete statement of an obeject
> 
> Typo "obeject"
Fixed.
> 
> Otherwise, I don't really have any concerns with this.  I hope though
> that Mark (who introduced the systemtap support for the existing
> probes) could also take a look for sanity.  I've added him to CC
> directly, even though he probably also gets this through the list.
Keeping him on the CC
> 
> on the benchmarking results and the interest in my patch, 
[...]
> 
> I think there's more to look at in terms of performance.  However,
> despite what the numbers here show, from my understanding (Mark,
> please chime in here!) the existence of these probes in the source
> should in theory not affect runtime performance.  Otherwise, I might
You are correct, from a performance perspective, adding probe points is
essentially within the realm of noise.  I just wanted to show that
actually using them won't cause significant performance hits if anybody
had any reservations.
> be asking to see data for --enable-systemtap w/o this patch as well
> to compare really what this patch adds.  Anyhow, unless I am quite
> wrong about this, I don't think there is any performance concern
> for adding these probes, only for when they are used.  So, consider
> my next paragraph not for this patch, but more generally to discuss
> performance impact of using these probes.
> 
> These numbers do seem to raise some questions, though.  Why do we
> see such variation between the runs?  I'd encourage you to explore
> this further.  Another aspect to consider: looking at run time of
The variations can most likely be attributed to the fact I was
running this on a vm on my laptop and had other (non trivial)
processes running on the host.
> benchmark will show the impact aggregated over entire java process,
> but it would be interesting to see the impact relative to time
> actually spent in gc.  I'd be concerned if simply printing this
> probestr at beginning and end of gc made the gc run last 10% longer,
> even if it looks relatively minor aggregated over full java process
> run time.  I'm not sure how you'd go about trying to measure this,
> however.
I can look into running scripts that would simply increment a variable
(ie gc_hit++) every time a probe is hit instead of logging the probestr,
also I could run the same tests and start a timer when hotspot.gc_begin
is hit and ends when a hotspot.gc_end is hit. (those probes are already
there).
> 
> > what else
> > needs to be done to get this patch applied to icedtea?
> > 
> 
> Well, I am basically OK with this aside from the things mentioned
> above.  I guess remaining still is the question of testing these.  I
> wouldn't block this based on lacking tests (the previous probes went
> untested for ages before I added tests), but I also don't want this
> to go in without a plan to eventually add tests; when we did add
> tests for the other probes, we actually found regressions and even
> things that had never properly worked iirc.
> 
> Have you given any thought to how you might add tests for these
> probes to the existing set of probe tests?
Ideally I'd have some java test programs that would be able to allocate
enough objects to trigger collections.  As mentioned earlier, different
gc algorithms can be specified with jvm options, but what would be
tricky is controlling the gc invocation via jvm options in a reliable
enough manner that we can reasonably expect scavenges to occur.  I would
have to experiment with that to see if its possible, if anybody else
knows how to easily do that please let me know.

Is this ok to commit?

Cheers,

Lukas

[-- Attachment #1.2: icedtea.patch --]
[-- Type: text/plain, Size: 34905 bytes --]

diff -r 727519ab8096 Makefile.am
--- a/Makefile.am	Fri Aug 24 01:53:20 2012 +0100
+++ b/Makefile.am	Tue Aug 28 15:26:58 2012 -0400
@@ -291,7 +291,9 @@
 endif
 
 if ENABLE_SYSTEMTAP
-ICEDTEA_PATCHES += patches/systemtap.patch
+ICEDTEA_PATCHES += \
+	patches/systemtap.patch \
+	patches/systemtap_gc.patch
 endif
 
 if ENABLE_NSS
@@ -764,6 +766,7 @@
 	tapset/hotspot.stp.in \
 	tapset/hotspot_jni.stp.in \
 	tapset/jstack.stp.in \
+	tapset/hotspot_gc.stp.in \
 	scripts/jni_create_stap.c \
 	scripts/jni_desc \
 	rewriter/agpl-3.0.txt \
@@ -1730,11 +1733,16 @@
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  sed -e '/\/client\/libjvm.so/d' \
+	    < $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	else \
 	  cp $(abs_top_builddir)/tapset/hotspot.stp \
 	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
 	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  cp $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	fi; \
 	cp $(abs_top_builddir)/tapset/jstack.stp \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
@@ -1796,11 +1804,16 @@
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    > $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  sed -e '/\/client\/libjvm.so/d' \
+	    < $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    > $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	else \
 	  cp $(abs_top_builddir)/tapset/hotspot.stp \
 	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
 	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  cp $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	fi; \
 	cp $(abs_top_builddir)/tapset/jstack.stp \
 	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
diff -r 727519ab8096 configure.ac
--- a/configure.ac	Fri Aug 24 01:53:20 2012 +0100
+++ b/configure.ac	Tue Aug 28 15:26:58 2012 -0400
@@ -315,6 +315,7 @@
   AC_CONFIG_FILES([tapset/hotspot.stp])
   AC_CONFIG_FILES([tapset/hotspot_jni.stp])
   AC_CONFIG_FILES([tapset/jstack.stp])
+  AC_CONFIG_FILES([tapset/hotspot_gc.stp])
 fi
 
 dnl Check for libXtst headers and libraries.
diff -r 727519ab8096 patches/systemtap_gc.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/systemtap_gc.patch	Tue Aug 28 15:26:58 2012 -0400
@@ -0,0 +1,364 @@
+--- openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp	2012-06-26 09:24:22.390325184 -0400
++++ openjdk/hotspot/src/share/vm/compiler/oopMap.cpp	2012-07-06 10:12:44.981413003 -0400
+@@ -33,9 +33,13 @@
+ #include "memory/resourceArea.hpp"
+ #include "runtime/frame.inline.hpp"
+ #include "runtime/signature.hpp"
++#include "utilities/dtrace.hpp"
+ #ifdef COMPILER1
+ #include "c1/c1_Defs.hpp"
+ #endif
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL1(provider, gc__collection__delete, *uintptr_t);
++#endif /* !USDT2 */
+ 
+ // OopMapStream
+ 
+@@ -677,6 +681,9 @@
+                     " - Derived: " INTPTR_FORMAT "  Base: " INTPTR_FORMAT " (Offset: %d)",
+           derived_loc, (address)*derived_loc, (address)base, offset);
+     }
++#ifndef USDT2
++  HS_DTRACE_PROBE1(hotspot, gc__collection__delete, entry);
++#endif /* !USDT2 */
+ 
+     // Delete entry
+     delete entry;
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-12 09:48:40.349999515 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-19 18:38:07.560757426 -0400
+@@ -53,11 +53,18 @@
+ #include "runtime/vmThread.hpp"
+ #include "services/management.hpp"
+ #include "services/memoryService.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ #include "utilities/stack.inline.hpp"
+ 
+ #include <math.h>
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__ParallelCompact__clear, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parallel__collect, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__move, *uintptr_t, *uintptr_t, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
++
+ // All sizes are in HeapWords.
+ const size_t ParallelCompactData::Log2RegionSize  = 9; // 512 words
+ const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
+@@ -433,6 +439,9 @@
+ 
+ void ParallelCompactData::clear()
+ {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__ParallelCompact__clear, &_region_data, _region_data->data_location());
++#endif /* !USDT2 */
+   memset(_region_data, 0, _region_vspace->committed_size());
+ }
+ 
+@@ -1970,6 +1979,9 @@
+          "should be in vm thread");
+ 
+   ParallelScavengeHeap* heap = gc_heap();
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__parallel__collect, heap, heap->gc_cause());
++#endif /* !USDT2 */
+   GCCause::Cause gc_cause = heap->gc_cause();
+   assert(!heap->is_gc_active(), "not reentrant");
+ 
+@@ -3376,6 +3388,9 @@
+   // past the end of the partial object entering the region (if any).
+   HeapWord* const dest_addr = sd.partial_obj_end(dp_region);
+   HeapWord* const new_top = _space_info[space_id].new_top();
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__move, &beg_addr, &end_addr, &dest_addr, &new_top);
++#endif /* !USDT2 */
+   assert(new_top >= dest_addr, "bad new_top value");
+   const size_t words = pointer_delta(new_top, dest_addr);
+ 
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-08-15 12:04:43.837439833 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-08-15 12:01:47.897745719 -0400
+@@ -45,8 +45,13 @@
+ #include "runtime/thread.hpp"
+ #include "runtime/vmThread.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1__end, *uintptr_t, *uintptr_t);
++ #endif /* !USDT2 */ 
+ class HeapRegion;
+ 
+ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp,
+@@ -84,6 +89,9 @@
+   // The marking doesn't preserve the marks of biased objects.
+   BiasedLocking::preserve_marks();
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__G1__begin, &sh, sh->gc_cause());
++#endif /* !USDT2 */
+   mark_sweep_phase1(marked_for_unloading, clear_all_softrefs);
+ 
+   mark_sweep_phase2();
+@@ -103,6 +111,9 @@
+   GenRemSet* rs = sh->rem_set();
+   rs->invalidate(sh->perm_gen()->used_region(), true /*whole_heap*/);
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__G1__end, &sh, sh->gc_cause());
++#endif /* !USDT2 */
+   // "free at last gc" is calculated from these.
+   // CHF: cheating for now!!!
+   //  Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity());
+--- openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-08-15 12:03:43.009543167 -0400
++++ openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-08-15 12:14:25.414381449 -0400
+@@ -33,6 +33,12 @@
+ #include "memory/tenuredGeneration.hpp"
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ TenuredGeneration::TenuredGeneration(ReservedSpace rs,
+                                      size_t initial_byte_size, int level,
+@@ -307,8 +313,14 @@
+                                 size_t size,
+                                 bool   is_tlab) {
+   retire_alloc_buffers_before_full_gc();
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__tenured__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   OneContigSpaceCardGeneration::collect(full, clear_all_soft_refs,
+                                         size, is_tlab);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__tenured__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+ }
+ 
+ void TenuredGeneration::update_gc_stats(int current_level,
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-08-15 12:03:43.039543116 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-08-15 12:18:57.181932342 -0400
+@@ -49,6 +49,12 @@
+ #include "utilities/copy.hpp"
+ #include "utilities/globalDefinitions.hpp"
+ #include "utilities/workgroup.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ #ifdef _MSC_VER
+ #pragma warning( push )
+@@ -878,6 +884,9 @@
+                                bool   clear_all_soft_refs,
+                                size_t size,
+                                bool   is_tlab) {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__parnew__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   assert(full || size > 0, "otherwise we don't want to collect");
+   GenCollectedHeap* gch = GenCollectedHeap::heap();
+   assert(gch->kind() == CollectedHeap::GenCollectedHeap,
+@@ -1032,6 +1041,10 @@
+     gch->print_heap_change(gch_prev_used);
+   }
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__parnew__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
++
+   if (PrintGCDetails && ParallelGCVerbose) {
+     TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats());
+     TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats());
+--- openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-08-15 12:03:43.010543164 -0400
++++ openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-08-15 12:21:41.076673646 -0400
+@@ -38,6 +38,7 @@
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/stack.inline.hpp"
+ #ifdef TARGET_OS_FAMILY_linux
+ # include "thread_linux.inline.hpp"
+@@ -51,7 +52,10 @@
+ #ifdef TARGET_OS_FAMILY_bsd
+ # include "thread_bsd.inline.hpp"
+ #endif
+-
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ //
+ // DefNewGeneration functions.
+ 
+@@ -528,6 +532,9 @@
+                                bool   clear_all_soft_refs,
+                                size_t size,
+                                bool   is_tlab) {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__defnew__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   assert(full || size > 0, "otherwise we don't want to collect");
+   GenCollectedHeap* gch = GenCollectedHeap::heap();
+   _next_gen = gch->next_gen(this);
+@@ -661,6 +668,10 @@
+   // does not guarantee monotonicity.
+   jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
+   update_time_of_last_gc(now);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__defnew__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
++
+ }
+ 
+ class RemoveForwardPointerClosure: public ObjectClosure {
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-08-15 12:03:43.044543106 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-08-15 12:25:26.632316692 -0400
+@@ -55,6 +55,12 @@
+ #include "runtime/vmThread.hpp"
+ #include "services/memoryService.hpp"
+ #include "services/runtimeService.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ // statics
+ CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
+@@ -1647,7 +1653,13 @@
+                                             size_t size,
+                                             bool   tlab)
+ {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__begin, full, clear_all_soft_refs, size, tlab);
++#endif /* !USDT2 */
+   collector()->collect(full, clear_all_soft_refs, size, tlab);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__end, full, clear_all_soft_refs, size, tlab);
++#endif /* !USDT2 */
+ }
+ 
+ void CMSCollector::collect(bool   full,
+--- openjdk.orig/hotspot/src/share/vm/memory/generation.cpp	2012-08-15 12:03:43.009543167 -0400
++++ openjdk/hotspot/src/share/vm/memory/generation.cpp	2012-08-15 12:27:46.378095083 -0400
+@@ -39,8 +39,14 @@
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
++
+ Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
+   _level(level),
+   _ref_processor(NULL) {
+@@ -470,7 +476,13 @@
+   // refs discovery is over the entire heap, not just this generation
+   ReferenceProcessorSpanMutator
+     x(ref_processor(), GenCollectedHeap::heap()->reserved_region());
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   SpecializationStats::print();
+ }
+ 
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	2012-08-15 12:03:43.046543102 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	2012-08-15 12:53:47.762647059 -0400
+@@ -40,8 +40,13 @@
+ #include "runtime/handles.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "runtime/vmThread.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/vmError.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parscavenge, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
++
+ PSYoungGen*  ParallelScavengeHeap::_young_gen = NULL;
+ PSOldGen*    ParallelScavengeHeap::_old_gen = NULL;
+ PSPermGen*   ParallelScavengeHeap::_perm_gen = NULL;
+@@ -806,6 +811,9 @@
+   }
+ 
+   VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__parscavenge, &op, cause);
++#endif /* !USDT2 */
+   VMThread::execute(&op);
+ }
+ 
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-07-25 13:24:07.000000000 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-08-17 10:26:44.181117802 -0400
+@@ -51,8 +51,17 @@
+ #include "runtime/vmThread.hpp"
+ #include "runtime/vm_operations.hpp"
+ #include "services/memoryService.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/stack.inline.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSScavenge__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSScavenge__end, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSParallelCompact__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSParallelCompact__end, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSMarkSweep__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSMarkSweep__end, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
+ 
+ HeapWord*                  PSScavenge::_to_space_top_before_gc = NULL;
+ int                        PSScavenge::_consecutive_skipped_scavenges = 0;
+@@ -226,7 +235,13 @@
+   PSAdaptiveSizePolicy* policy = heap->size_policy();
+   IsGCActiveMark mark;
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__begin, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+   const bool scavenge_done = PSScavenge::invoke_no_policy();
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__end, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+   const bool need_full_gc = !scavenge_done ||
+     policy->should_full_GC(heap->old_gen()->free_in_bytes());
+   bool full_gc_done = false;
+@@ -243,9 +258,21 @@
+     const bool clear_all_softrefs = cp->should_clear_all_soft_refs();
+ 
+     if (UseParallelOldGC) {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__begin, *heap, heap->gc_cause()); 
++#endif /* !USDT2 */
+       full_gc_done = PSParallelCompact::invoke_no_policy(clear_all_softrefs);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__end, *heap, heap->gc_cause()); 
++#endif /* !USDT2 */
+     } else {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__begin, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+       full_gc_done = PSMarkSweep::invoke_no_policy(clear_all_softrefs);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__end, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+     }
+   }
+ 
diff -r 727519ab8096 tapset/hotspot_gc.stp.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tapset/hotspot_gc.stp.in	Tue Aug 28 15:26:58 2012 -0400
@@ -0,0 +1,505 @@
+/*
+ * probe - gc_collect_contig_begin
+ * 
+ * @name: gc_collect_contig_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: Word size of the object to be collected.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the start of a contiguous space generation collection.
+ * 
+ */
+
+probe hotspot.gc_collect_contig_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__contig__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__contig__begin")
+{
+
+  name = "gc_collect_contig_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_contig_end
+ * 
+ * @name: gc_collect_contig_end_
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge.
+ * @size: Word size of the object to be collected.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a contiguous space generation collection.
+ * 
+ */
+
+probe hotspot.gc_collect_contig_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__contig__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__contig__end")
+{
+
+  name = "gc_collect_contig_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parnew_begin
+ * 
+ * @name: gc_collect_parnew_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: Word size of the object to be collected.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the beginning of a parallel collection of a new 
+ * generation.
+ * 
+ */
+
+probe hotspot.gc_collect_parnew = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parnew__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parnew__begin")
+{
+
+  name = "gc_collect_parnew_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parnew_end
+ * 
+ * @name: gc_collect_parnew_end
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: Word size of the object to be collected.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a parallel collection of a new 
+ * generation.
+ * 
+ */
+
+probe hotspot.gc_collect_parnew_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parnew__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parnew__end")
+{
+
+  name = "gc_collect_parnew_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_defnew_begin
+ * 
+ * @name: gc_collect_defnew_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: Word size of the object to be collected.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the start of a newly defined generation
+ * collection
+ * 
+ */
+
+probe hotspot.gc_collect_defnew_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__defnew__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__defnew__begin")
+{
+
+  name = "gc_collect_defnew_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_defnew_end
+ * 
+ * @name: gc_collect_defnew_end
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: Word size of the object to be collected.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a newly defined generation
+ * collection
+ * 
+ */
+
+probe hotspot.gc_collect_defnew_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__defnew__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__defnew__end")
+{
+
+  name = "gc_collect_defnew_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_tenured_begin
+ * 
+ * @name: gc_collect_tenured_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: Word size of the object to be collected.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This is the start of a collection of a tenured generation
+ * (a generation that has survived multiple garbage collections and is 
+ * now in a 'tenured' object space.
+ * 
+ */
+
+probe hotspot.gc_collect_tenured_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__tenured__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__tenured__begin")
+{
+
+  name = "gc_collect_tenured_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_tenured_end
+ * 
+ * @name: gc_collect_tenured_end
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: Word size of the object to be collected.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This is the end of a collection of a tenured generation
+ * (a generation that has survived multiple garbage collections and is 
+ * now in a 'tenured' object space.
+ * 
+ */
+
+probe hotspot.gc_collect_tenured_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__tenured__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__tenured__end")
+{
+
+  name = "gc_collect_tenured_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parallel_scavenge
+ * 
+ * @name: gc_collect_parallel_scavenge
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ * 
+ * Description: This is a parallel scavenge, where the jvm process doesn't
+ * have to halt while the gc is being completed.
+ */
+
+probe hotspot.gc_collect_parallel_scavenge =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parscavenge"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parscavenge")
+{
+  name = "gc_collect_parallel_scavenge";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_parallel_collect
+ * 
+ * @name: gc_collect_parallel_collect
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks a parallel collection.
+ * 
+ */
+
+probe hotspot.gc_collect_parallel_collect =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parallel__collect"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parallel__collect")
+{
+  name = "gc_collect_parallel_collect";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_g1_begin
+ * 
+ * @name: gc_collect_g1_begin
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a G1 style garbage collection
+ * (Garbage-First Garbage Collector).
+ * 
+ */
+
+probe hotspot.gc_collect_g1_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__G1__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__G1__begin")
+{
+  name = "gc_collect_g1_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_g1_end
+ * 
+ * @name: gc_collect_g1_end
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks then end of a  G1 style garbage collection
+ * (Garbage-First Garbage Collector).
+ * 
+ */
+
+probe hotspot.gc_collect_g1_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__G1__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__G1__end")
+{
+  name = "gc_collect_g1_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_delete
+ * 
+ * @name: gc_collect_delete
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: A delete statement of an object.
+ * 
+ */
+
+probe hotspot.gc_collect_delete =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__delete"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__delete")
+{
+  name = "gc_collect_delete";
+  address = sprintf("0x%x", $arg1);
+  probestr = sprintf("%s(address='%s')", name, address);
+}
+
+/*
+ * probe - gc_collect_PSScavenge_begin
+ * 
+ * @name: gc_collect_PSScavenge_begin
+ * @address: Address of scavenge
+ * @cause: Cause of the collection.
+ *
+ * Description: A parallel scavenge begins.  A scavenge is a partial garbage
+ * collection which should be much more common than a full garbage collection
+ * throughout the course of the java program.
+ * 
+ */
+
+probe hotspot.gc_collect_PSScavenge_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSScavenge__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSScavenge__begin")
+{
+  name = "gc_collect_PSScavenge_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSScavenge_end
+ * 
+ * @name: gc_collect_PSScavenge_end
+ * @address: Address of scavenge.
+ * @cause: Cause of the collection.
+ *
+ * Description: The end of the parallel scavenge.  The beginning and end of
+ * the scavenge is noted due to the possbility of multiple scavenges occuring
+ * at the same time.
+ * 
+ */
+
+probe hotspot.gc_collect_PSScavenge_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSScavenge__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSScavenge__end")
+{
+  name = "gc_collect_PSScavenge_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSParallelCompact_begin
+ * 
+ * @name: gc_collect_PSParallelCompact_begin
+ * @address: Address of compaction.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a parallel compaction.
+ * 
+ */
+
+probe hotspot.gc_collect_PSParallelCompact_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__begin")
+{
+  name = "gc_collect_PSParallelCompact_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSParallelCompact_end
+ * 
+ * @name: gc_collect_PSParallelCompact_end
+ * @address: Address of compaction.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the end of a  parallel compaction.
+ * 
+ */
+
+probe hotspot.gc_collect_PSParallelCompact_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__end")
+{
+  name = "gc_collect_PSParallelCompact_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSMarkSweep_begin
+ * 
+ * @name: gc_collect_PSMarkSweep_begin
+ * @address: Address of parallel mark sweep process.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a parallel mark sweep for
+ * objects that require collection.
+ * 
+ */
+
+probe hotspot.gc_collect_PSMarkSweep_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__begin")
+{
+  name = "gc_collect_PSMarkSweep_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSMarkSweep_end
+ * 
+ * @name: gc_collect_PSMarkSweep_end
+ * @address: Address of parallel mark sweep process.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a parallel mark sweep for
+ * objects that require collection.
+ * 
+ */
+
+probe hotspot.gc_collect_PSMarkSweep_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__end")
+{
+  name = "gc_collect_PSMarkSweep_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_move
+ * 
+ * @name: gc_collect_move
+ * @from_bottom_address: The bottom address of the object being moved.
+ * @from_top_address: The top address of the object being moved.
+ * @to_bottom_address: The bottom address of where the object is being moved to.
+ * @to_top_address: The top address of where the object is being moved to.
+ * @cause: Cause of the collection.
+ *
+ * Description: During garbage collections there are times where objects or 
+ * blocks of memory need to be moved.  This probe will detail from where 
+ * the memory is moving and where to.
+ * 
+ */
+
+probe hotspot.gc_collect_move =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__move"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__move")
+{
+  name = "gc_collect_move";
+  from_bottom_address = sprintf("0x%x", $arg1);
+  from_top_address = sprintf("0x%x", $arg2);
+  to_bottom_address = sprintf("0x%x", $arg3);
+  to_top_address = sprintf("0x%x", $arg4);
+  probestr = sprintf("%s(from_bottom_address='%s', from_top_address='%s', to_bottom_address='%s', to_top_address='%s')", name, from_bottom_address, from_top_address, to_bottom_address, to_top_address);
+
+}
+
+/*
+ * probe - gc_collect_clear
+ * 
+ * @name: gc_collect_clear
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This probe dictates the region of data that needs to be 
+ * cleared in a compaction action.
+ * 
+ */
+
+probe hotspot.gc_collect_clear =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__ParallelCompact__clear"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__ParallelCompact__clear")
+{
+  name = "gc_collect_clear";
+  region_data = sprintf("0x%x", $arg1);
+  data_location = sprintf("0x%x", $arg2);
+  probestr = sprintf("%s(region_data='%s', data_location='%s')", name, region_data, data_location);
+  
+}

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-28 21:23     ` Lukas Berk
@ 2012-08-29 11:52       ` Mark Wielaard
  2012-08-30  1:19       ` Jon VanAlten
  1 sibling, 0 replies; 27+ messages in thread
From: Mark Wielaard @ 2012-08-29 11:52 UTC (permalink / raw)
  To: Lukas Berk; +Cc: Jon VanAlten, systemtap, distro-pkg-dev

Hi Lukas,

On Tue, 2012-08-28 at 17:22 -0400, Lukas Berk wrote:
> > We have a hotspot.stp, a hotspot_jni.stp; maybe this one should be
> > hotspot_gc.stp?
> Done, its now included as hotspot_gc.stp.in

I like it this way. Thanks.

> > Adding this fluff to the existing systemtap.patch, may not be the
> > best way.  As I understand it, Mark is trying to get the existing
> > stuff upstream.  Combining this into same IcedTea patch may make
> > it more difficult if/when this upstreaming is eventually successful
> > and needs to be removed from IcedTea.  I'd suggest introducing a
> > separate patch to the icedtea sources.
> Makes sense to me, I've adjusted the autoconf files accordingly to
> include and apply patches/systemtap_gc.patch if icedtea is configure
> with --enable-systemtap.

That also looks good. For 6 I split up the original systemtap.patch into
separate patches too. See
http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-August/019851.html
Eventually all those patches should go directly into the forest (or
Andrew Hughes will kill me for polluting the tree with even more
patches) but lets do all those in one step later. For now the separate
patch is great.

Please do post and ping systemtap_gc.patch to
hotspot-gc-dev@openjdk.java.net one last time. It would be really good
if some hotspot gc hacker could comment. We can always try.

> > Well, I am basically OK with this aside from the things mentioned
> > above.  I guess remaining still is the question of testing these.  I
> > wouldn't block this based on lacking tests (the previous probes went
> > untested for ages before I added tests), but I also don't want this
> > to go in without a plan to eventually add tests; when we did add
> > tests for the other probes, we actually found regressions and even
> > things that had never properly worked iirc.
> > 
> > Have you given any thought to how you might add tests for these
> > probes to the existing set of probe tests?
> Ideally I'd have some java test programs that would be able to allocate
> enough objects to trigger collections.  As mentioned earlier, different
> gc algorithms can be specified with jvm options, but what would be
> tricky is controlling the gc invocation via jvm options in a reliable
> enough manner that we can reasonably expect scavenges to occur.  I would
> have to experiment with that to see if its possible, if anybody else
> knows how to easily do that please let me know.

Take a look at test/tapset/jstaptest.pl, make check-tapset-probes and
make check-tapset-jstack. You can probably do something similar. Please
ask if the test code looks too hairy (it probably is...).

Cheers,

Mark

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-28 21:23     ` Lukas Berk
  2012-08-29 11:52       ` Mark Wielaard
@ 2012-08-30  1:19       ` Jon VanAlten
  2012-08-31 20:07         ` Lukas Berk
  1 sibling, 1 reply; 27+ messages in thread
From: Jon VanAlten @ 2012-08-30  1:19 UTC (permalink / raw)
  To: Lukas Berk; +Cc: systemtap, distro-pkg-dev

Hey Lukas,

Nice improvement.  I've snipped the stuff that looks all-good now.

> > 
> > + * @size: word size to be cleaned
> > 
> > (in several places)
> > This wording (pun not intended) is not entirely clear.  Playing the
> > ignorant reader, I am not sure if this means the wordsize that the
> > jvm uses, or the total space, in words, that will be collected on
> > this gc run.  Can this be clarified?
> I've changed this to: "Word size of the object to be collected."

So, this maybe is not a great improvement.  Does this mean that in the
gc run there will be a single object collected?  Is that single object
@size words big?  I think I know better that this is not what you
mean here, but it reads unclear.  Let me ask my question another way,
is @size a target for this collection run?  Or is it the size of the
region to be collected?

This also introduces a terminology collision for java-centric folks.
I think you maybe mean 'region' or 'generation' rather than 'object',
which has a specific meaning in Java-land.  This is also an issue
below...

If the meaning of this value is what I think it is, can I suggest:

"The number of words of memory that this collection will try to reclaim"

> > 
> > + * probe - gc_collect_parallel_scavenge
> > + *
> > + * @name: gc_collect_parallel_scavenge
> > + * @address: address of object being collected
> > + * @cause: cause of the collection
> > + *
> > + * Description: This is a parallel collection, where the jvm
> > process don't
> > + * have to halt while the gc is being completed
> > 
> > I want to make sure I understand this.  If I read this correctly,
> > this
> > probe fires many times between a begin and end of parallel gc run,
> > for
> > each object that is scavenged?  If I do understand this, then
> > saying
> > "this is a parallel collection" I think is the wrong wording.  This
> > is not a collection, but an event that is part of a collection run.
> >  If
> > I misunderstand, please clarify :)
> No, a scavenge is just a miniature collection, not a process within a
> collection.  The mechanics are the same, just not on the entire
> object
> space/heap.  That being said I've s/This is a parallel
> collection/This
> is a parallel scavenge/ to be specific.

I think this is another place where the use of 'object' causes confusion.
Maybe in this case you mean 'region' or 'generation'?

Another question I have about this; what relationship does this probe
have to the corresponding _begin and _end probes?  Does this probe
fire near the beginning or near the end or before the beginning or
after the end?  Why do we need this probe, if we already can say
when this process begins and ends?

Anyways, this is mainly me being picky about documentation.  On the
technical level, this is fine, so while I think it would be nice to get
the docs perfect on the first try I don't demand it.  If my understanding
above about semantics of these variables is correct and you'd like to
accept my suggestions, please do commit this with those tiny updates.  If
my understanding is incorrect, let's not hold this commit back; just put
it in the way it is, but then I would like to better understand what the
values those particular probes are telling me (both for if I try to use
them, and for documenting them for other users!).

That's all I have to say about the patch :)

> > 
> > These numbers do seem to raise some questions, though.  Why do we
> > see such variation between the runs?  I'd encourage you to explore
> > this further.  Another aspect to consider: looking at run time of
> The variations can most likely be attributed to the fact I was
> running this on a vm on my laptop and had other (non trivial)
> processes running on the host.

Ah, so these numbers really don't tell us anything at all then!

Maybe we can collaborate on some better methodology...

> > benchmark will show the impact aggregated over entire java process,
> > but it would be interesting to see the impact relative to time
> > actually spent in gc.  I'd be concerned if simply printing this
> > probestr at beginning and end of gc made the gc run last 10%
> > longer,
> > even if it looks relatively minor aggregated over full java process
> > run time.  I'm not sure how you'd go about trying to measure this,
> > however.
> I can look into running scripts that would simply increment a
> variable
> (ie gc_hit++) every time a probe is hit instead of logging the
> probestr,
> also I could run the same tests and start a timer when
> hotspot.gc_begin
> is hit and ends when a hotspot.gc_end is hit. (those probes are
> already
> there).

That sounds like a good place to start.

> > 
> > Have you given any thought to how you might add tests for these
> > probes to the existing set of probe tests?
> Ideally I'd have some java test programs that would be able to
> allocate
> enough objects to trigger collections.  As mentioned earlier,
> different
> gc algorithms can be specified with jvm options, but what would be
> tricky is controlling the gc invocation via jvm options in a reliable
> enough manner that we can reasonably expect scavenges to occur.  I
> would
> have to experiment with that to see if its possible, if anybody else
> knows how to easily do that please let me know.
> 

So, this is in some ways analogous to what I struggled with in testing
some of the existing probes.  For example, the probes that fire when
a method is JIT compiled.  This happens (depending on tuning options
of course) after a certain number invocations of a particular method,
so in order to test that the probe fires when expected, I wrote a
java program that did call a certain method the correct number of times,
and checked that the output indicated the probe firing showing that
particular method being JIT compiled.

For your problem, instead of controlling the number of times a method
is called, you need to cause certain amounts of space to be allocated
for Java objects.  You probably to start from some baseline (an empty
main()), learn about the tuning options that affect the GC behaviour,
and so forth.  I think this is rather non-trivial, another reason why
not to block the patch for testing.  And then, as Mark pointed out in
his reply, there is also the matter of integrating with the existing
tests.  My apologies in advance about the wrapper script, and please
consider me available to help when you get to that point.

> Is this ok to commit?
> 

With caveats noted above, I say yes :)

cheers,
jon

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-30  1:19       ` Jon VanAlten
@ 2012-08-31 20:07         ` Lukas Berk
  2012-09-24 18:17           ` Jon VanAlten
  0 siblings, 1 reply; 27+ messages in thread
From: Lukas Berk @ 2012-08-31 20:07 UTC (permalink / raw)
  To: Jon VanAlten; +Cc: systemtap, distro-pkg-dev


[-- Attachment #1.1: Type: text/plain, Size: 6589 bytes --]

Hey,

[...]
> > > this gc run.  Can this be clarified?
> > I've changed this to: "Word size of the object to be collected."
> 
> So, this maybe is not a great improvement.  Does this mean that in the
> gc run there will be a single object collected?  Is that single object
> @size words big?  I think I know better that this is not what you
> mean here, but it reads unclear.  Let me ask my question another way,
> is @size a target for this collection run?  Or is it the size of the
> region to be collected?
> 
> This also introduces a terminology collision for java-centric folks.
> I think you maybe mean 'region' or 'generation' rather than 'object',
> which has a specific meaning in Java-land.  This is also an issue
> below...
> 
> If the meaning of this value is what I think it is, can I suggest:
> 
> "The number of words of memory that this collection will try to reclaim"

As per our discussion on irc, I've changed this to "The collection
should achieve a minimum region of available memory to allow for an
allocation of 'size'." This should satisfy all possible situations where
where @size is used.

> 
> > > 
> > > + * probe - gc_collect_parallel_scavenge
> > > + *
> > > + * @name: gc_collect_parallel_scavenge
> > > + * @address: address of object being collected
> > > + * @cause: cause of the collection
> > > + *
> > > + * Description: This is a parallel collection, where the jvm
> > > process don't
> > > + * have to halt while the gc is being completed
> > > 
> > > I want to make sure I understand this.  If I read this correctly,
> > > this
> > > probe fires many times between a begin and end of parallel gc run,
> > > for
> > > each object that is scavenged?  If I do understand this, then
> > > saying
> > > "this is a parallel collection" I think is the wrong wording.  This
> > > is not a collection, but an event that is part of a collection run.
> > >  If
> > > I misunderstand, please clarify :)
> > No, a scavenge is just a miniature collection, not a process within a
> > collection.  The mechanics are the same, just not on the entire
> > object
> > space/heap.  That being said I've s/This is a parallel
> > collection/This
> > is a parallel scavenge/ to be specific.
> 
> I think this is another place where the use of 'object' causes confusion.
> Maybe in this case you mean 'region' or 'generation'?

I've changed it to 'region' to avoid the confusion :)

> 
> Another question I have about this; what relationship does this probe
> have to the corresponding _begin and _end probes?  Does this probe
> fire near the beginning or near the end or before the beginning or
> after the end?  Why do we need this probe, if we already can say
> when this process begins and ends?

This is simply another occurrence (in a different area of the hotspot
code) that corresponds to a scavenge.  In order to remain more
consistent, I've split the probe into begin/end probes and renamed it to
reflect the portion of code its located in
(gc_collect_parscavenge_heap_{begin,end}.  I've also tweaked the docs to
remain consistent with the 'This marks a ...' style description.

> 
> Anyways, this is mainly me being picky about documentation.  On the
> technical level, this is fine, so while I think it would be nice to get
> the docs perfect on the first try I don't demand it.  If my understanding
> above about semantics of these variables is correct and you'd like to
> accept my suggestions, please do commit this with those tiny updates.  If
> my understanding is incorrect, let's not hold this commit back; just put
> it in the way it is, but then I would like to better understand what the
> values those particular probes are telling me (both for if I try to use
> them, and for documenting them for other users!).
> 
> That's all I have to say about the patch :)
> 
> > > 
> > > These numbers do seem to raise some questions, though.  Why do we
> > > see such variation between the runs?  I'd encourage you to explore
> > > this further.  Another aspect to consider: looking at run time of
> > The variations can most likely be attributed to the fact I was
> > running this on a vm on my laptop and had other (non trivial)
> > processes running on the host.
> 
> Ah, so these numbers really don't tell us anything at all then!
> 
> Maybe we can collaborate on some better methodology...

Sure, I'll contact you off list regarding this.

[...]

> > > probes to the existing set of probe tests?
> > Ideally I'd have some java test programs that would be able to
> > allocate
> > enough objects to trigger collections.  As mentioned earlier,
> > different
> > gc algorithms can be specified with jvm options, but what would be
> > tricky is controlling the gc invocation via jvm options in a reliable
> > enough manner that we can reasonably expect scavenges to occur.  I
> > would
> > have to experiment with that to see if its possible, if anybody else
> > knows how to easily do that please let me know.
> > 
> 
> So, this is in some ways analogous to what I struggled with in testing
> some of the existing probes.  For example, the probes that fire when
> a method is JIT compiled.  This happens (depending on tuning options
> of course) after a certain number invocations of a particular method,
> so in order to test that the probe fires when expected, I wrote a
> java program that did call a certain method the correct number of times,
> and checked that the output indicated the probe firing showing that
> particular method being JIT compiled.
> 
> For your problem, instead of controlling the number of times a method
> is called, you need to cause certain amounts of space to be allocated
> for Java objects.  You probably to start from some baseline (an empty
> main()), learn about the tuning options that affect the GC behaviour,
> and so forth.  I think this is rather non-trivial, another reason why
> not to block the patch for testing.  And then, as Mark pointed out in
> his reply, there is also the matter of integrating with the existing
> tests.  My apologies in advance about the wrapper script, and please
> consider me available to help when you get to that point.
> 

Thanks for the offer, I've already taken a look and once again I'll
contact you off list with any specifics :)

> > Is this ok to commit?
> > 
> 
> With caveats noted above, I say yes :)
> 

Thanks! Please let me know if there is anything else you'd like to know,
updated patch is attached.

Cheers,

Lukas

[-- Attachment #1.2: icedtea1.patch --]
[-- Type: text/plain, Size: 36667 bytes --]

diff -r 727519ab8096 Makefile.am
--- a/Makefile.am	Fri Aug 24 01:53:20 2012 +0100
+++ b/Makefile.am	Fri Aug 31 15:47:32 2012 -0400
@@ -291,7 +291,9 @@
 endif
 
 if ENABLE_SYSTEMTAP
-ICEDTEA_PATCHES += patches/systemtap.patch
+ICEDTEA_PATCHES += \
+	patches/systemtap.patch \
+	patches/systemtap_gc.patch
 endif
 
 if ENABLE_NSS
@@ -764,6 +766,7 @@
 	tapset/hotspot.stp.in \
 	tapset/hotspot_jni.stp.in \
 	tapset/jstack.stp.in \
+	tapset/hotspot_gc.stp.in \
 	scripts/jni_create_stap.c \
 	scripts/jni_desc \
 	rewriter/agpl-3.0.txt \
@@ -1730,11 +1733,16 @@
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  sed -e '/\/client\/libjvm.so/d' \
+	    < $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	else \
 	  cp $(abs_top_builddir)/tapset/hotspot.stp \
 	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
 	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  cp $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	fi; \
 	cp $(abs_top_builddir)/tapset/jstack.stp \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
@@ -1796,11 +1804,16 @@
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    > $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  sed -e '/\/client\/libjvm.so/d' \
+	    < $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    > $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	else \
 	  cp $(abs_top_builddir)/tapset/hotspot.stp \
 	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
 	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  cp $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	fi; \
 	cp $(abs_top_builddir)/tapset/jstack.stp \
 	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
diff -r 727519ab8096 configure.ac
--- a/configure.ac	Fri Aug 24 01:53:20 2012 +0100
+++ b/configure.ac	Fri Aug 31 15:47:32 2012 -0400
@@ -315,6 +315,7 @@
   AC_CONFIG_FILES([tapset/hotspot.stp])
   AC_CONFIG_FILES([tapset/hotspot_jni.stp])
   AC_CONFIG_FILES([tapset/jstack.stp])
+  AC_CONFIG_FILES([tapset/hotspot_gc.stp])
 fi
 
 dnl Check for libXtst headers and libraries.
diff -r 727519ab8096 patches/systemtap_gc.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/systemtap_gc.patch	Fri Aug 31 15:47:32 2012 -0400
@@ -0,0 +1,369 @@
+--- openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp	2012-06-26 09:24:22.390325184 -0400
++++ openjdk/hotspot/src/share/vm/compiler/oopMap.cpp	2012-07-06 10:12:44.981413003 -0400
+@@ -33,9 +33,13 @@
+ #include "memory/resourceArea.hpp"
+ #include "runtime/frame.inline.hpp"
+ #include "runtime/signature.hpp"
++#include "utilities/dtrace.hpp"
+ #ifdef COMPILER1
+ #include "c1/c1_Defs.hpp"
+ #endif
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL1(provider, gc__collection__delete, *uintptr_t);
++#endif /* !USDT2 */
+ 
+ // OopMapStream
+ 
+@@ -677,6 +681,9 @@
+                     " - Derived: " INTPTR_FORMAT "  Base: " INTPTR_FORMAT " (Offset: %d)",
+           derived_loc, (address)*derived_loc, (address)base, offset);
+     }
++#ifndef USDT2
++  HS_DTRACE_PROBE1(hotspot, gc__collection__delete, entry);
++#endif /* !USDT2 */
+ 
+     // Delete entry
+     delete entry;
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-12 09:48:40.349999515 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-19 18:38:07.560757426 -0400
+@@ -53,11 +53,18 @@
+ #include "runtime/vmThread.hpp"
+ #include "services/management.hpp"
+ #include "services/memoryService.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ #include "utilities/stack.inline.hpp"
+ 
+ #include <math.h>
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__ParallelCompact__clear, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parallel__collect, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__move, *uintptr_t, *uintptr_t, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
++
+ // All sizes are in HeapWords.
+ const size_t ParallelCompactData::Log2RegionSize  = 9; // 512 words
+ const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
+@@ -433,6 +439,9 @@
+ 
+ void ParallelCompactData::clear()
+ {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__ParallelCompact__clear, &_region_data, _region_data->data_location());
++#endif /* !USDT2 */
+   memset(_region_data, 0, _region_vspace->committed_size());
+ }
+ 
+@@ -1970,6 +1979,9 @@
+          "should be in vm thread");
+ 
+   ParallelScavengeHeap* heap = gc_heap();
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__parallel__collect, heap, heap->gc_cause());
++#endif /* !USDT2 */
+   GCCause::Cause gc_cause = heap->gc_cause();
+   assert(!heap->is_gc_active(), "not reentrant");
+ 
+@@ -3376,6 +3388,9 @@
+   // past the end of the partial object entering the region (if any).
+   HeapWord* const dest_addr = sd.partial_obj_end(dp_region);
+   HeapWord* const new_top = _space_info[space_id].new_top();
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__move, &beg_addr, &end_addr, &dest_addr, &new_top);
++#endif /* !USDT2 */
+   assert(new_top >= dest_addr, "bad new_top value");
+   const size_t words = pointer_delta(new_top, dest_addr);
+ 
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-08-15 12:04:43.837439833 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-08-15 12:01:47.897745719 -0400
+@@ -45,8 +45,13 @@
+ #include "runtime/thread.hpp"
+ #include "runtime/vmThread.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1__end, *uintptr_t, *uintptr_t);
++ #endif /* !USDT2 */ 
+ class HeapRegion;
+ 
+ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp,
+@@ -84,6 +89,9 @@
+   // The marking doesn't preserve the marks of biased objects.
+   BiasedLocking::preserve_marks();
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__G1__begin, &sh, sh->gc_cause());
++#endif /* !USDT2 */
+   mark_sweep_phase1(marked_for_unloading, clear_all_softrefs);
+ 
+   mark_sweep_phase2();
+@@ -103,6 +111,9 @@
+   GenRemSet* rs = sh->rem_set();
+   rs->invalidate(sh->perm_gen()->used_region(), true /*whole_heap*/);
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__G1__end, &sh, sh->gc_cause());
++#endif /* !USDT2 */
+   // "free at last gc" is calculated from these.
+   // CHF: cheating for now!!!
+   //  Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity());
+--- openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-08-15 12:03:43.009543167 -0400
++++ openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-08-15 12:14:25.414381449 -0400
+@@ -33,6 +33,12 @@
+ #include "memory/tenuredGeneration.hpp"
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ TenuredGeneration::TenuredGeneration(ReservedSpace rs,
+                                      size_t initial_byte_size, int level,
+@@ -307,8 +313,14 @@
+                                 size_t size,
+                                 bool   is_tlab) {
+   retire_alloc_buffers_before_full_gc();
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__tenured__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   OneContigSpaceCardGeneration::collect(full, clear_all_soft_refs,
+                                         size, is_tlab);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__tenured__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+ }
+ 
+ void TenuredGeneration::update_gc_stats(int current_level,
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-08-15 12:03:43.039543116 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-08-15 12:18:57.181932342 -0400
+@@ -49,6 +49,12 @@
+ #include "utilities/copy.hpp"
+ #include "utilities/globalDefinitions.hpp"
+ #include "utilities/workgroup.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ #ifdef _MSC_VER
+ #pragma warning( push )
+@@ -878,6 +884,9 @@
+                                bool   clear_all_soft_refs,
+                                size_t size,
+                                bool   is_tlab) {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__parnew__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   assert(full || size > 0, "otherwise we don't want to collect");
+   GenCollectedHeap* gch = GenCollectedHeap::heap();
+   assert(gch->kind() == CollectedHeap::GenCollectedHeap,
+@@ -1032,6 +1041,10 @@
+     gch->print_heap_change(gch_prev_used);
+   }
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__parnew__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
++
+   if (PrintGCDetails && ParallelGCVerbose) {
+     TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats());
+     TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats());
+--- openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-08-15 12:03:43.010543164 -0400
++++ openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-08-15 12:21:41.076673646 -0400
+@@ -38,6 +38,7 @@
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/stack.inline.hpp"
+ #ifdef TARGET_OS_FAMILY_linux
+ # include "thread_linux.inline.hpp"
+@@ -51,7 +52,10 @@
+ #ifdef TARGET_OS_FAMILY_bsd
+ # include "thread_bsd.inline.hpp"
+ #endif
+-
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ //
+ // DefNewGeneration functions.
+ 
+@@ -528,6 +532,9 @@
+                                bool   clear_all_soft_refs,
+                                size_t size,
+                                bool   is_tlab) {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__defnew__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   assert(full || size > 0, "otherwise we don't want to collect");
+   GenCollectedHeap* gch = GenCollectedHeap::heap();
+   _next_gen = gch->next_gen(this);
+@@ -661,6 +668,10 @@
+   // does not guarantee monotonicity.
+   jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
+   update_time_of_last_gc(now);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__defnew__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
++
+ }
+ 
+ class RemoveForwardPointerClosure: public ObjectClosure {
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-08-15 12:03:43.044543106 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-08-15 12:25:26.632316692 -0400
+@@ -55,6 +55,12 @@
+ #include "runtime/vmThread.hpp"
+ #include "services/memoryService.hpp"
+ #include "services/runtimeService.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ // statics
+ CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
+@@ -1647,7 +1653,13 @@
+                                             size_t size,
+                                             bool   tlab)
+ {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__begin, full, clear_all_soft_refs, size, tlab);
++#endif /* !USDT2 */
+   collector()->collect(full, clear_all_soft_refs, size, tlab);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__end, full, clear_all_soft_refs, size, tlab);
++#endif /* !USDT2 */
+ }
+ 
+ void CMSCollector::collect(bool   full,
+--- openjdk.orig/hotspot/src/share/vm/memory/generation.cpp	2012-08-15 12:03:43.009543167 -0400
++++ openjdk/hotspot/src/share/vm/memory/generation.cpp	2012-08-15 12:27:46.378095083 -0400
+@@ -39,8 +39,14 @@
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
++
+ Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
+   _level(level),
+   _ref_processor(NULL) {
+@@ -470,7 +476,13 @@
+   // refs discovery is over the entire heap, not just this generation
+   ReferenceProcessorSpanMutator
+     x(ref_processor(), GenCollectedHeap::heap()->reserved_region());
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   SpecializationStats::print();
+ }
+ 
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-07-25 13:24:07.000000000 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-08-17 10:26:44.181117802 -0400
+@@ -51,8 +51,17 @@
+ #include "runtime/vmThread.hpp"
+ #include "runtime/vm_operations.hpp"
+ #include "services/memoryService.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/stack.inline.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSScavenge__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSScavenge__end, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSParallelCompact__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSParallelCompact__end, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSMarkSweep__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSMarkSweep__end, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
+ 
+ HeapWord*                  PSScavenge::_to_space_top_before_gc = NULL;
+ int                        PSScavenge::_consecutive_skipped_scavenges = 0;
+@@ -226,7 +235,13 @@
+   PSAdaptiveSizePolicy* policy = heap->size_policy();
+   IsGCActiveMark mark;
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__begin, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+   const bool scavenge_done = PSScavenge::invoke_no_policy();
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__end, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+   const bool need_full_gc = !scavenge_done ||
+     policy->should_full_GC(heap->old_gen()->free_in_bytes());
+   bool full_gc_done = false;
+@@ -243,9 +258,21 @@
+     const bool clear_all_softrefs = cp->should_clear_all_soft_refs();
+ 
+     if (UseParallelOldGC) {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__begin, *heap, heap->gc_cause()); 
++#endif /* !USDT2 */
+       full_gc_done = PSParallelCompact::invoke_no_policy(clear_all_softrefs);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__end, *heap, heap->gc_cause()); 
++#endif /* !USDT2 */
+     } else {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__begin, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+       full_gc_done = PSMarkSweep::invoke_no_policy(clear_all_softrefs);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__end, *heap, heap->gc_cause());
++#endif /* !USDT2 */
+     }
+   }
+ 
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	2012-07-25 13:24:07.000000000 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	2012-08-31 15:14:23.936576341 -0400
+@@ -40,8 +40,14 @@
+ #include "runtime/handles.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "runtime/vmThread.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/vmError.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parscavenge__heap__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parscavenge__heap__end, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
++
+ PSYoungGen*  ParallelScavengeHeap::_young_gen = NULL;
+ PSOldGen*    ParallelScavengeHeap::_old_gen = NULL;
+ PSPermGen*   ParallelScavengeHeap::_perm_gen = NULL;
+@@ -806,7 +812,13 @@
+   }
+ 
+   VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__parscavenge__heap__begin, &op, cause);
++#endif /* !USDT2 */
+   VMThread::execute(&op);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__parscavenge__heap__end, &op, cause);
++#endif /* !USDT2 */
+ }
+ 
+ // This interface assumes that it's being called by the
diff -r 727519ab8096 tapset/hotspot_gc.stp.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tapset/hotspot_gc.stp.in	Fri Aug 31 15:47:32 2012 -0400
@@ -0,0 +1,534 @@
+/*
+ * probe - gc_collect_contig_begin
+ * 
+ * @name: gc_collect_contig_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the start of a contiguous space generation collection.
+ * 
+ */
+
+probe hotspot.gc_collect_contig_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__contig__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__contig__begin")
+{
+
+  name = "gc_collect_contig_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_contig_end
+ * 
+ * @name: gc_collect_contig_end_
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge.
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a contiguous space generation collection.
+ * 
+ */
+
+probe hotspot.gc_collect_contig_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__contig__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__contig__end")
+{
+
+  name = "gc_collect_contig_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parnew_begin
+ * 
+ * @name: gc_collect_parnew_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the beginning of a parallel collection of a new 
+ * generation.
+ * 
+ */
+
+probe hotspot.gc_collect_parnew = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parnew__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parnew__begin")
+{
+
+  name = "gc_collect_parnew_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parnew_end
+ * 
+ * @name: gc_collect_parnew_end
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a parallel collection of a new 
+ * generation.
+ * 
+ */
+
+probe hotspot.gc_collect_parnew_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parnew__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parnew__end")
+{
+
+  name = "gc_collect_parnew_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_defnew_begin
+ * 
+ * @name: gc_collect_defnew_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the start of a newly defined generation
+ * collection
+ * 
+ */
+
+probe hotspot.gc_collect_defnew_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__defnew__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__defnew__begin")
+{
+
+  name = "gc_collect_defnew_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_defnew_end
+ * 
+ * @name: gc_collect_defnew_end
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a newly defined generation
+ * collection
+ * 
+ */
+
+probe hotspot.gc_collect_defnew_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__defnew__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__defnew__end")
+{
+
+  name = "gc_collect_defnew_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_tenured_begin
+ * 
+ * @name: gc_collect_tenured_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This is the start of a collection of a tenured generation
+ * (a generation that has survived multiple garbage collections and is 
+ * now in a 'tenured' object space.
+ * 
+ */
+
+probe hotspot.gc_collect_tenured_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__tenured__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__tenured__begin")
+{
+
+  name = "gc_collect_tenured_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_tenured_end
+ * 
+ * @name: gc_collect_tenured_end
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This is the end of a collection of a tenured generation
+ * (a generation that has survived multiple garbage collections and is 
+ * now in a 'tenured' object space.
+ * 
+ */
+
+probe hotspot.gc_collect_tenured_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__tenured__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__tenured__end")
+{
+
+  name = "gc_collect_tenured_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parallel_scavenge_heap_begin
+ * 
+ * @name: gc_collect_parallel_scavenge_heap_begin
+ * @address: Address of region being collected.
+ * @cause: Cause of the collection.
+ * 
+ * Description: This is a parallel heap scavenge beginning, the jvm process doesn't
+ * have to halt while the gc is being completed.
+ */
+
+probe hotspot.gc_collect_parallel_scavenge =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parscavenge__heap__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parscavenge__heap__begin")
+{
+  name = "gc_collect_parallel_scavenge_heap_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_parallel_scavenge_heap_end
+ * 
+ * @name: gc_collect_parallel_scavenge_heap_end
+ * @address: Address of region being collected.
+ * @cause: Cause of the collection.
+ * 
+ * Description: This is a parallel heap scavenge ending, the jvm process doesn't
+ * have to halt while the gc is being completed.
+ */
+
+probe hotspot.gc_collect_parallel_scavenge_heap_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parscavenge__heap__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parscavenge__heap__end")
+{
+  name = "gc_collect_parallel_scavenge_heap_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_parallel_collect
+ * 
+ * @name: gc_collect_parallel_collect
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks a parallel collection.
+ * 
+ */
+
+probe hotspot.gc_collect_parallel_collect =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parallel__collect"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parallel__collect")
+{
+  name = "gc_collect_parallel_collect";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_g1_begin
+ * 
+ * @name: gc_collect_g1_begin
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a G1 style garbage collection
+ * (Garbage-First Garbage Collector).
+ * 
+ */
+
+probe hotspot.gc_collect_g1_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__G1__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__G1__begin")
+{
+  name = "gc_collect_g1_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_g1_end
+ * 
+ * @name: gc_collect_g1_end
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks then end of a  G1 style garbage collection
+ * (Garbage-First Garbage Collector).
+ * 
+ */
+
+probe hotspot.gc_collect_g1_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__G1__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__G1__end")
+{
+  name = "gc_collect_g1_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_delete
+ * 
+ * @name: gc_collect_delete
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: A delete statement of an object.
+ * 
+ */
+
+probe hotspot.gc_collect_delete =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__delete"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__delete")
+{
+  name = "gc_collect_delete";
+  address = sprintf("0x%x", $arg1);
+  probestr = sprintf("%s(address='%s')", name, address);
+}
+
+/*
+ * probe - gc_collect_PSScavenge_begin
+ * 
+ * @name: gc_collect_PSScavenge_begin
+ * @address: Address of scavenge
+ * @cause: Cause of the collection.
+ *
+ * Description: A parallel scavenge begins.  A scavenge is a partial garbage
+ * collection which should be much more common than a full garbage collection
+ * throughout the course of the java program.
+ * 
+ */
+
+probe hotspot.gc_collect_PSScavenge_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSScavenge__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSScavenge__begin")
+{
+  name = "gc_collect_PSScavenge_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSScavenge_end
+ * 
+ * @name: gc_collect_PSScavenge_end
+ * @address: Address of scavenge.
+ * @cause: Cause of the collection.
+ *
+ * Description: The end of the parallel scavenge.  The beginning and end of
+ * the scavenge is noted due to the possbility of multiple scavenges occuring
+ * at the same time.
+ * 
+ */
+
+probe hotspot.gc_collect_PSScavenge_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSScavenge__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSScavenge__end")
+{
+  name = "gc_collect_PSScavenge_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSParallelCompact_begin
+ * 
+ * @name: gc_collect_PSParallelCompact_begin
+ * @address: Address of compaction.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a parallel compaction.
+ * 
+ */
+
+probe hotspot.gc_collect_PSParallelCompact_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__begin")
+{
+  name = "gc_collect_PSParallelCompact_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSParallelCompact_end
+ * 
+ * @name: gc_collect_PSParallelCompact_end
+ * @address: Address of compaction.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the end of a  parallel compaction.
+ * 
+ */
+
+probe hotspot.gc_collect_PSParallelCompact_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__end")
+{
+  name = "gc_collect_PSParallelCompact_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSMarkSweep_begin
+ * 
+ * @name: gc_collect_PSMarkSweep_begin
+ * @address: Address of parallel mark sweep process.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a parallel mark sweep for
+ * objects that require collection.
+ * 
+ */
+
+probe hotspot.gc_collect_PSMarkSweep_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__begin")
+{
+  name = "gc_collect_PSMarkSweep_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSMarkSweep_end
+ * 
+ * @name: gc_collect_PSMarkSweep_end
+ * @address: Address of parallel mark sweep process.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a parallel mark sweep for
+ * objects that require collection.
+ * 
+ */
+
+probe hotspot.gc_collect_PSMarkSweep_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__end")
+{
+  name = "gc_collect_PSMarkSweep_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_move
+ * 
+ * @name: gc_collect_move
+ * @from_bottom_address: The bottom address of the object being moved.
+ * @from_top_address: The top address of the object being moved.
+ * @to_bottom_address: The bottom address of where the object is being moved to.
+ * @to_top_address: The top address of where the object is being moved to.
+ * @cause: Cause of the collection.
+ *
+ * Description: During garbage collections there are times where objects or 
+ * blocks of memory need to be moved.  This probe will detail from where 
+ * the memory is moving and where to.
+ * 
+ */
+
+probe hotspot.gc_collect_move =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__move"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__move")
+{
+  name = "gc_collect_move";
+  from_bottom_address = sprintf("0x%x", $arg1);
+  from_top_address = sprintf("0x%x", $arg2);
+  to_bottom_address = sprintf("0x%x", $arg3);
+  to_top_address = sprintf("0x%x", $arg4);
+  probestr = sprintf("%s(from_bottom_address='%s', from_top_address='%s', to_bottom_address='%s', to_top_address='%s')", name, from_bottom_address, from_top_address, to_bottom_address, to_top_address);
+
+}
+
+/*
+ * probe - gc_collect_clear
+ * 
+ * @name: gc_collect_clear
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This probe dictates the region of data that needs to be 
+ * cleared in a compaction action.
+ * 
+ */
+
+probe hotspot.gc_collect_clear =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__ParallelCompact__clear"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__ParallelCompact__clear")
+{
+  name = "gc_collect_clear";
+  region_data = sprintf("0x%x", $arg1);
+  data_location = sprintf("0x%x", $arg2);
+  probestr = sprintf("%s(region_data='%s', data_location='%s')", name, region_data, data_location);
+  
+}

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-08-31 20:07         ` Lukas Berk
@ 2012-09-24 18:17           ` Jon VanAlten
  2012-10-23 16:53             ` Lukas Berk
  0 siblings, 1 reply; 27+ messages in thread
From: Jon VanAlten @ 2012-09-24 18:17 UTC (permalink / raw)
  To: Lukas Berk; +Cc: systemtap, distro-pkg-dev


> 
> > > Is this ok to commit?
> > > 
> > 
> > With caveats noted above, I say yes :)
> > 
> 
> Thanks! Please let me know if there is anything else you'd like to
> know,
> updated patch is attached.
> 

Hi,

This has been in my TODO for some time, so I am very sorry not to
have responded earlier.  From looking at the patch, it seems okay
now.  I intend to push this to HEAD on your behalf, unless someone
else has some reason why not.  (Now is your chance to speak up
about that, if you have such a reason!).  But, I do feel responsible
to build with it myself and verify that things seem to be working as
intended.  Various other things have been jumping my work queue, but
I may have time this week to give this a sanity check and finally
get it into hg.  Thanks for persisting!

cheers,
jon

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-09-24 18:17           ` Jon VanAlten
@ 2012-10-23 16:53             ` Lukas Berk
  2012-10-25  5:02               ` Jon VanAlten
  0 siblings, 1 reply; 27+ messages in thread
From: Lukas Berk @ 2012-10-23 16:53 UTC (permalink / raw)
  To: Jon VanAlten; +Cc: systemtap, distro-pkg-dev


[-- Attachment #1.1: Type: text/plain, Size: 1161 bytes --]

Hey,

* Jon VanAlten <jvanalte@redhat.com> [2012-09-24 14:16]:
> 
> > 
> > > > Is this ok to commit?
> > > > 
> > > 
> > > With caveats noted above, I say yes :)
> > > 
> > 
> > Thanks! Please let me know if there is anything else you'd like to
> > know,
> > updated patch is attached.
> > 
> 
> Hi,
> 
> This has been in my TODO for some time, so I am very sorry not to
> have responded earlier.  From looking at the patch, it seems okay
> now.  I intend to push this to HEAD on your behalf, unless someone
> else has some reason why not.  (Now is your chance to speak up
> about that, if you have such a reason!).  But, I do feel responsible
> to build with it myself and verify that things seem to be working as
> intended.  Various other things have been jumping my work queue, but
> I may have time this week to give this a sanity check and finally
> get it into hg.  Thanks for persisting!
> 
> cheers,
> Jon

I've updated the patch slightly to reflect a correction in
psScavenge.cpp that was causing a build error when icedtea-debug wasn't
specified.  The rest of the patch is unchanged from before.

Cheers,

Lukas

[-- Attachment #1.2: icedtea.patch --]
[-- Type: text/plain, Size: 36665 bytes --]

diff -r 727519ab8096 Makefile.am
--- a/Makefile.am	Fri Aug 24 01:53:20 2012 +0100
+++ b/Makefile.am	Fri Aug 31 15:47:32 2012 -0400
@@ -291,7 +291,9 @@
 endif
 
 if ENABLE_SYSTEMTAP
-ICEDTEA_PATCHES += patches/systemtap.patch
+ICEDTEA_PATCHES += \
+	patches/systemtap.patch \
+	patches/systemtap_gc.patch
 endif
 
 if ENABLE_NSS
@@ -764,6 +766,7 @@
 	tapset/hotspot.stp.in \
 	tapset/hotspot_jni.stp.in \
 	tapset/jstack.stp.in \
+	tapset/hotspot_gc.stp.in \
 	scripts/jni_create_stap.c \
 	scripts/jni_desc \
 	rewriter/agpl-3.0.txt \
@@ -1730,11 +1733,16 @@
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  sed -e '/\/client\/libjvm.so/d' \
+	    < $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	else \
 	  cp $(abs_top_builddir)/tapset/hotspot.stp \
 	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
 	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  cp $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	fi; \
 	cp $(abs_top_builddir)/tapset/jstack.stp \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
@@ -1796,11 +1804,16 @@
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    > $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  sed -e '/\/client\/libjvm.so/d' \
+	    < $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    > $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	else \
 	  cp $(abs_top_builddir)/tapset/hotspot.stp \
 	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
 	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
 	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	  cp $(abs_top_builddir)/tapset/hotspot_gc.stp \
+	    $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \
 	fi; \
 	cp $(abs_top_builddir)/tapset/jstack.stp \
 	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
diff -r 727519ab8096 configure.ac
--- a/configure.ac	Fri Aug 24 01:53:20 2012 +0100
+++ b/configure.ac	Fri Aug 31 15:47:32 2012 -0400
@@ -315,6 +315,7 @@
   AC_CONFIG_FILES([tapset/hotspot.stp])
   AC_CONFIG_FILES([tapset/hotspot_jni.stp])
   AC_CONFIG_FILES([tapset/jstack.stp])
+  AC_CONFIG_FILES([tapset/hotspot_gc.stp])
 fi
 
 dnl Check for libXtst headers and libraries.
diff -r 727519ab8096 patches/systemtap_gc.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/systemtap_gc.patch	Fri Aug 31 15:47:32 2012 -0400
@@ -0,0 +1,369 @@
+--- openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp	2012-06-26 09:24:22.390325184 -0400
++++ openjdk/hotspot/src/share/vm/compiler/oopMap.cpp	2012-07-06 10:12:44.981413003 -0400
+@@ -33,9 +33,13 @@
+ #include "memory/resourceArea.hpp"
+ #include "runtime/frame.inline.hpp"
+ #include "runtime/signature.hpp"
++#include "utilities/dtrace.hpp"
+ #ifdef COMPILER1
+ #include "c1/c1_Defs.hpp"
+ #endif
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL1(provider, gc__collection__delete, *uintptr_t);
++#endif /* !USDT2 */
+ 
+ // OopMapStream
+ 
+@@ -677,6 +681,9 @@
+                     " - Derived: " INTPTR_FORMAT "  Base: " INTPTR_FORMAT " (Offset: %d)",
+           derived_loc, (address)*derived_loc, (address)base, offset);
+     }
++#ifndef USDT2
++  HS_DTRACE_PROBE1(hotspot, gc__collection__delete, entry);
++#endif /* !USDT2 */
+ 
+     // Delete entry
+     delete entry;
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-12 09:48:40.349999515 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2012-07-19 18:38:07.560757426 -0400
+@@ -53,11 +53,18 @@
+ #include "runtime/vmThread.hpp"
+ #include "services/management.hpp"
+ #include "services/memoryService.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ #include "utilities/stack.inline.hpp"
+ 
+ #include <math.h>
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__ParallelCompact__clear, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parallel__collect, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__move, *uintptr_t, *uintptr_t, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
++
+ // All sizes are in HeapWords.
+ const size_t ParallelCompactData::Log2RegionSize  = 9; // 512 words
+ const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
+@@ -433,6 +439,9 @@
+ 
+ void ParallelCompactData::clear()
+ {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__ParallelCompact__clear, &_region_data, _region_data->data_location());
++#endif /* !USDT2 */
+   memset(_region_data, 0, _region_vspace->committed_size());
+ }
+ 
+@@ -1970,6 +1979,9 @@
+          "should be in vm thread");
+ 
+   ParallelScavengeHeap* heap = gc_heap();
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__parallel__collect, heap, heap->gc_cause());
++#endif /* !USDT2 */
+   GCCause::Cause gc_cause = heap->gc_cause();
+   assert(!heap->is_gc_active(), "not reentrant");
+ 
+@@ -3376,6 +3388,9 @@
+   // past the end of the partial object entering the region (if any).
+   HeapWord* const dest_addr = sd.partial_obj_end(dp_region);
+   HeapWord* const new_top = _space_info[space_id].new_top();
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__move, &beg_addr, &end_addr, &dest_addr, &new_top);
++#endif /* !USDT2 */
+   assert(new_top >= dest_addr, "bad new_top value");
+   const size_t words = pointer_delta(new_top, dest_addr);
+ 
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-08-15 12:04:43.837439833 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	2012-08-15 12:01:47.897745719 -0400
+@@ -45,8 +45,13 @@
+ #include "runtime/thread.hpp"
+ #include "runtime/vmThread.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1__end, *uintptr_t, *uintptr_t);
++ #endif /* !USDT2 */ 
+ class HeapRegion;
+ 
+ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp,
+@@ -84,6 +89,9 @@
+   // The marking doesn't preserve the marks of biased objects.
+   BiasedLocking::preserve_marks();
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__G1__begin, &sh, sh->gc_cause());
++#endif /* !USDT2 */
+   mark_sweep_phase1(marked_for_unloading, clear_all_softrefs);
+ 
+   mark_sweep_phase2();
+@@ -103,6 +111,9 @@
+   GenRemSet* rs = sh->rem_set();
+   rs->invalidate(sh->perm_gen()->used_region(), true /*whole_heap*/);
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__G1__end, &sh, sh->gc_cause());
++#endif /* !USDT2 */
+   // "free at last gc" is calculated from these.
+   // CHF: cheating for now!!!
+   //  Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity());
+--- openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-08-15 12:03:43.009543167 -0400
++++ openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp	2012-08-15 12:14:25.414381449 -0400
+@@ -33,6 +33,12 @@
+ #include "memory/tenuredGeneration.hpp"
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ TenuredGeneration::TenuredGeneration(ReservedSpace rs,
+                                      size_t initial_byte_size, int level,
+@@ -307,8 +313,14 @@
+                                 size_t size,
+                                 bool   is_tlab) {
+   retire_alloc_buffers_before_full_gc();
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__tenured__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   OneContigSpaceCardGeneration::collect(full, clear_all_soft_refs,
+                                         size, is_tlab);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__tenured__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+ }
+ 
+ void TenuredGeneration::update_gc_stats(int current_level,
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-08-15 12:03:43.039543116 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-08-15 12:18:57.181932342 -0400
+@@ -49,6 +49,12 @@
+ #include "utilities/copy.hpp"
+ #include "utilities/globalDefinitions.hpp"
+ #include "utilities/workgroup.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ #ifdef _MSC_VER
+ #pragma warning( push )
+@@ -878,6 +884,9 @@
+                                bool   clear_all_soft_refs,
+                                size_t size,
+                                bool   is_tlab) {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__parnew__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   assert(full || size > 0, "otherwise we don't want to collect");
+   GenCollectedHeap* gch = GenCollectedHeap::heap();
+   assert(gch->kind() == CollectedHeap::GenCollectedHeap,
+@@ -1032,6 +1041,10 @@
+     gch->print_heap_change(gch_prev_used);
+   }
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__parnew__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
++
+   if (PrintGCDetails && ParallelGCVerbose) {
+     TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats());
+     TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats());
+--- openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-08-15 12:03:43.010543164 -0400
++++ openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp	2012-08-15 12:21:41.076673646 -0400
+@@ -38,6 +38,7 @@
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/stack.inline.hpp"
+ #ifdef TARGET_OS_FAMILY_linux
+ # include "thread_linux.inline.hpp"
+@@ -51,7 +52,10 @@
+ #ifdef TARGET_OS_FAMILY_bsd
+ # include "thread_bsd.inline.hpp"
+ #endif
+-
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ //
+ // DefNewGeneration functions.
+ 
+@@ -528,6 +532,9 @@
+                                bool   clear_all_soft_refs,
+                                size_t size,
+                                bool   is_tlab) {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__defnew__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   assert(full || size > 0, "otherwise we don't want to collect");
+   GenCollectedHeap* gch = GenCollectedHeap::heap();
+   _next_gen = gch->next_gen(this);
+@@ -661,6 +668,10 @@
+   // does not guarantee monotonicity.
+   jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
+   update_time_of_last_gc(now);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__defnew__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
++
+ }
+ 
+ class RemoveForwardPointerClosure: public ObjectClosure {
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-08-15 12:03:43.044543106 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2012-08-15 12:25:26.632316692 -0400
+@@ -55,6 +55,12 @@
+ #include "runtime/vmThread.hpp"
+ #include "services/memoryService.hpp"
+ #include "services/runtimeService.hpp"
++#include "utilities/dtrace.hpp"
++
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
+ 
+ // statics
+ CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
+@@ -1647,7 +1653,13 @@
+                                             size_t size,
+                                             bool   tlab)
+ {
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__begin, full, clear_all_soft_refs, size, tlab);
++#endif /* !USDT2 */
+   collector()->collect(full, clear_all_soft_refs, size, tlab);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__end, full, clear_all_soft_refs, size, tlab);
++#endif /* !USDT2 */
+ }
+ 
+ void CMSCollector::collect(bool   full,
+--- openjdk.orig/hotspot/src/share/vm/memory/generation.cpp	2012-08-15 12:03:43.009543167 -0400
++++ openjdk/hotspot/src/share/vm/memory/generation.cpp	2012-08-15 12:27:46.378095083 -0400
+@@ -39,8 +39,14 @@
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "utilities/copy.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/events.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__begin, bool, bool, size_t, bool);
++  HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__end, bool, bool, size_t, bool);
++#endif /* !USDT2 */
++
+ Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
+   _level(level),
+   _ref_processor(NULL) {
+@@ -470,7 +476,13 @@
+   // refs discovery is over the entire heap, not just this generation
+   ReferenceProcessorSpanMutator
+     x(ref_processor(), GenCollectedHeap::heap()->reserved_region());
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__begin, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs);
++#ifndef USDT2
++  HS_DTRACE_PROBE4(hotspot, gc__collection__contig__end, full, clear_all_soft_refs, size, is_tlab);
++#endif  /* !USDT2 */
+   SpecializationStats::print();
+ }
+ 
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-07-25 13:24:07.000000000 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	2012-08-17 10:26:44.181117802 -0400
+@@ -51,8 +51,17 @@
+ #include "runtime/vmThread.hpp"
+ #include "runtime/vm_operations.hpp"
+ #include "services/memoryService.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/stack.inline.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSScavenge__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSScavenge__end, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSParallelCompact__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSParallelCompact__end, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSMarkSweep__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSMarkSweep__end, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
+ 
+ HeapWord*                  PSScavenge::_to_space_top_before_gc = NULL;
+ int                        PSScavenge::_consecutive_skipped_scavenges = 0;
+@@ -226,7 +235,13 @@
+   PSAdaptiveSizePolicy* policy = heap->size_policy();
+   IsGCActiveMark mark;
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__begin, &heap, heap->gc_cause());
++#endif /* !USDT2 */
+   const bool scavenge_done = PSScavenge::invoke_no_policy();
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__end, &heap, heap->gc_cause());
++#endif /* !USDT2 */
+   const bool need_full_gc = !scavenge_done ||
+     policy->should_full_GC(heap->old_gen()->free_in_bytes());
+   bool full_gc_done = false;
+@@ -243,9 +258,21 @@
+     const bool clear_all_softrefs = cp->should_clear_all_soft_refs();
+ 
+     if (UseParallelOldGC) {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__begin, &heap, heap->gc_cause());
++#endif /* !USDT2 */
+       full_gc_done = PSParallelCompact::invoke_no_policy(clear_all_softrefs);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__end, &heap, heap->gc_cause());
++#endif /* !USDT2 */
+     } else {
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__begin, &heap, heap->gc_cause());
++#endif /* !USDT2 */
+       full_gc_done = PSMarkSweep::invoke_no_policy(clear_all_softrefs);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__end, &heap, heap->gc_cause());
++#endif /* !USDT2 */
+     }
+   }
+ 
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	2012-07-25 13:24:07.000000000 -0400
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	2012-08-31 15:14:23.936576341 -0400
+@@ -40,8 +40,14 @@
+ #include "runtime/handles.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "runtime/vmThread.hpp"
++#include "utilities/dtrace.hpp"
+ #include "utilities/vmError.hpp"
+ 
++#ifndef USDT2
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parscavenge__heap__begin, *uintptr_t, *uintptr_t);
++  HS_DTRACE_PROBE_DECL2(provider, gc__collection__parscavenge__heap__end, *uintptr_t, *uintptr_t);
++#endif /* !USDT2 */
++
+ PSYoungGen*  ParallelScavengeHeap::_young_gen = NULL;
+ PSOldGen*    ParallelScavengeHeap::_old_gen = NULL;
+ PSPermGen*   ParallelScavengeHeap::_perm_gen = NULL;
+@@ -806,7 +812,13 @@
+   }
+ 
+   VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__parscavenge__heap__begin, &op, cause);
++#endif /* !USDT2 */
+   VMThread::execute(&op);
++#ifndef USDT2
++  HS_DTRACE_PROBE2(hotspot, gc__collection__parscavenge__heap__end, &op, cause);
++#endif /* !USDT2 */
+ }
+ 
+ // This interface assumes that it's being called by the
diff -r 727519ab8096 tapset/hotspot_gc.stp.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tapset/hotspot_gc.stp.in	Fri Aug 31 15:47:32 2012 -0400
@@ -0,0 +1,534 @@
+/*
+ * probe - gc_collect_contig_begin
+ * 
+ * @name: gc_collect_contig_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the start of a contiguous space generation collection.
+ * 
+ */
+
+probe hotspot.gc_collect_contig_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__contig__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__contig__begin")
+{
+
+  name = "gc_collect_contig_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_contig_end
+ * 
+ * @name: gc_collect_contig_end_
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge.
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a contiguous space generation collection.
+ * 
+ */
+
+probe hotspot.gc_collect_contig_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__contig__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__contig__end")
+{
+
+  name = "gc_collect_contig_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parnew_begin
+ * 
+ * @name: gc_collect_parnew_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the beginning of a parallel collection of a new 
+ * generation.
+ * 
+ */
+
+probe hotspot.gc_collect_parnew = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parnew__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parnew__begin")
+{
+
+  name = "gc_collect_parnew_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parnew_end
+ * 
+ * @name: gc_collect_parnew_end
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a parallel collection of a new 
+ * generation.
+ * 
+ */
+
+probe hotspot.gc_collect_parnew_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parnew__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parnew__end")
+{
+
+  name = "gc_collect_parnew_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_defnew_begin
+ * 
+ * @name: gc_collect_defnew_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the start of a newly defined generation
+ * collection
+ * 
+ */
+
+probe hotspot.gc_collect_defnew_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__defnew__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__defnew__begin")
+{
+
+  name = "gc_collect_defnew_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_defnew_end
+ * 
+ * @name: gc_collect_defnew_end
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This marks the end of a newly defined generation
+ * collection
+ * 
+ */
+
+probe hotspot.gc_collect_defnew_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__defnew__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__defnew__end")
+{
+
+  name = "gc_collect_defnew_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_tenured_begin
+ * 
+ * @name: gc_collect_tenured_begin
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This is the start of a collection of a tenured generation
+ * (a generation that has survived multiple garbage collections and is 
+ * now in a 'tenured' object space.
+ * 
+ */
+
+probe hotspot.gc_collect_tenured_begin = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__tenured__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__tenured__begin")
+{
+
+  name = "gc_collect_tenured_begin";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_tenured_end
+ * 
+ * @name: gc_collect_tenured_end
+ * @is_full: If TRUE, attempt a full collection of the generation.
+ *           Else; perform a scavenge
+ * @size: The collection should achieve a minimum region of available
+ *        memory to allow for an allocation of 'size'.
+ * @is_tlab: Is this a Thread Local Allocation Buffer?
+ *
+ * Description: This is the end of a collection of a tenured generation
+ * (a generation that has survived multiple garbage collections and is 
+ * now in a 'tenured' object space.
+ * 
+ */
+
+probe hotspot.gc_collect_tenured_end = 
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__tenured__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__tenured__end")
+{
+
+  name = "gc_collect_tenured_end";
+  is_full = $arg2;
+  size = $arg3;
+  is_tlab = $arg4;
+  probestr = sprintf("%s(is_full='%d', size='%d', is_tlab='%d')", name, is_full, size, is_tlab);
+
+}
+
+/*
+ * probe - gc_collect_parallel_scavenge_heap_begin
+ * 
+ * @name: gc_collect_parallel_scavenge_heap_begin
+ * @address: Address of region being collected.
+ * @cause: Cause of the collection.
+ * 
+ * Description: This is a parallel heap scavenge beginning, the jvm process doesn't
+ * have to halt while the gc is being completed.
+ */
+
+probe hotspot.gc_collect_parallel_scavenge =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parscavenge__heap__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parscavenge__heap__begin")
+{
+  name = "gc_collect_parallel_scavenge_heap_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_parallel_scavenge_heap_end
+ * 
+ * @name: gc_collect_parallel_scavenge_heap_end
+ * @address: Address of region being collected.
+ * @cause: Cause of the collection.
+ * 
+ * Description: This is a parallel heap scavenge ending, the jvm process doesn't
+ * have to halt while the gc is being completed.
+ */
+
+probe hotspot.gc_collect_parallel_scavenge_heap_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parscavenge__heap__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parscavenge__heap__end")
+{
+  name = "gc_collect_parallel_scavenge_heap_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_parallel_collect
+ * 
+ * @name: gc_collect_parallel_collect
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks a parallel collection.
+ * 
+ */
+
+probe hotspot.gc_collect_parallel_collect =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__parallel__collect"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__parallel__collect")
+{
+  name = "gc_collect_parallel_collect";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_g1_begin
+ * 
+ * @name: gc_collect_g1_begin
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a G1 style garbage collection
+ * (Garbage-First Garbage Collector).
+ * 
+ */
+
+probe hotspot.gc_collect_g1_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__G1__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__G1__begin")
+{
+  name = "gc_collect_g1_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_g1_end
+ * 
+ * @name: gc_collect_g1_end
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks then end of a  G1 style garbage collection
+ * (Garbage-First Garbage Collector).
+ * 
+ */
+
+probe hotspot.gc_collect_g1_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__G1__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__G1__end")
+{
+  name = "gc_collect_g1_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_delete
+ * 
+ * @name: gc_collect_delete
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: A delete statement of an object.
+ * 
+ */
+
+probe hotspot.gc_collect_delete =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__delete"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__delete")
+{
+  name = "gc_collect_delete";
+  address = sprintf("0x%x", $arg1);
+  probestr = sprintf("%s(address='%s')", name, address);
+}
+
+/*
+ * probe - gc_collect_PSScavenge_begin
+ * 
+ * @name: gc_collect_PSScavenge_begin
+ * @address: Address of scavenge
+ * @cause: Cause of the collection.
+ *
+ * Description: A parallel scavenge begins.  A scavenge is a partial garbage
+ * collection which should be much more common than a full garbage collection
+ * throughout the course of the java program.
+ * 
+ */
+
+probe hotspot.gc_collect_PSScavenge_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSScavenge__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSScavenge__begin")
+{
+  name = "gc_collect_PSScavenge_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSScavenge_end
+ * 
+ * @name: gc_collect_PSScavenge_end
+ * @address: Address of scavenge.
+ * @cause: Cause of the collection.
+ *
+ * Description: The end of the parallel scavenge.  The beginning and end of
+ * the scavenge is noted due to the possbility of multiple scavenges occuring
+ * at the same time.
+ * 
+ */
+
+probe hotspot.gc_collect_PSScavenge_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSScavenge__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSScavenge__end")
+{
+  name = "gc_collect_PSScavenge_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSParallelCompact_begin
+ * 
+ * @name: gc_collect_PSParallelCompact_begin
+ * @address: Address of compaction.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a parallel compaction.
+ * 
+ */
+
+probe hotspot.gc_collect_PSParallelCompact_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__begin")
+{
+  name = "gc_collect_PSParallelCompact_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSParallelCompact_end
+ * 
+ * @name: gc_collect_PSParallelCompact_end
+ * @address: Address of compaction.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the end of a  parallel compaction.
+ * 
+ */
+
+probe hotspot.gc_collect_PSParallelCompact_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSParallelCompact__end")
+{
+  name = "gc_collect_PSParallelCompact_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSMarkSweep_begin
+ * 
+ * @name: gc_collect_PSMarkSweep_begin
+ * @address: Address of parallel mark sweep process.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a parallel mark sweep for
+ * objects that require collection.
+ * 
+ */
+
+probe hotspot.gc_collect_PSMarkSweep_begin =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__begin"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__begin")
+{
+  name = "gc_collect_PSMarkSweep_begin";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_PSMarkSweep_end
+ * 
+ * @name: gc_collect_PSMarkSweep_end
+ * @address: Address of parallel mark sweep process.
+ * @cause: Cause of the collection.
+ *
+ * Description: This marks the start of a parallel mark sweep for
+ * objects that require collection.
+ * 
+ */
+
+probe hotspot.gc_collect_PSMarkSweep_end =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__end"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__PSMarkSweep__end")
+{
+  name = "gc_collect_PSMarkSweep_end";
+  address = sprintf("0x%x", $arg1);
+  cause = $arg2;
+  probestr = sprintf("%s(address='%s', cause='%d')", name, address, cause);
+}
+
+/*
+ * probe - gc_collect_move
+ * 
+ * @name: gc_collect_move
+ * @from_bottom_address: The bottom address of the object being moved.
+ * @from_top_address: The top address of the object being moved.
+ * @to_bottom_address: The bottom address of where the object is being moved to.
+ * @to_top_address: The top address of where the object is being moved to.
+ * @cause: Cause of the collection.
+ *
+ * Description: During garbage collections there are times where objects or 
+ * blocks of memory need to be moved.  This probe will detail from where 
+ * the memory is moving and where to.
+ * 
+ */
+
+probe hotspot.gc_collect_move =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__move"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__move")
+{
+  name = "gc_collect_move";
+  from_bottom_address = sprintf("0x%x", $arg1);
+  from_top_address = sprintf("0x%x", $arg2);
+  to_bottom_address = sprintf("0x%x", $arg3);
+  to_top_address = sprintf("0x%x", $arg4);
+  probestr = sprintf("%s(from_bottom_address='%s', from_top_address='%s', to_bottom_address='%s', to_top_address='%s')", name, from_bottom_address, from_top_address, to_bottom_address, to_top_address);
+
+}
+
+/*
+ * probe - gc_collect_clear
+ * 
+ * @name: gc_collect_clear
+ * @address: Address of object being collected.
+ * @cause: Cause of the collection.
+ *
+ * Description: This probe dictates the region of data that needs to be 
+ * cleared in a compaction action.
+ * 
+ */
+
+probe hotspot.gc_collect_clear =
+  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__collection__ParallelCompact__clear"),
+  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__collection__ParallelCompact__clear")
+{
+  name = "gc_collect_clear";
+  region_data = sprintf("0x%x", $arg1);
+  data_location = sprintf("0x%x", $arg2);
+  probestr = sprintf("%s(region_data='%s', data_location='%s')", name, region_data, data_location);
+  
+}

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-10-23 16:53             ` Lukas Berk
@ 2012-10-25  5:02               ` Jon VanAlten
  2012-10-25 13:09                 ` Andrew Hughes
  0 siblings, 1 reply; 27+ messages in thread
From: Jon VanAlten @ 2012-10-25  5:02 UTC (permalink / raw)
  To: Lukas Berk; +Cc: systemtap, distro-pkg-dev



----- Original Message -----
> From: "Lukas Berk" <lberk@redhat.com>
> To: "Jon VanAlten" <jvanalte@redhat.com>
> Cc: systemtap@sourceware.org, distro-pkg-dev@openjdk.java.net
> Sent: Tuesday, October 23, 2012 12:53:30 PM
> Subject: Re: [RFC] Enhanced Garbage Collection Probe Points
> 
> Hey,
> 
> * Jon VanAlten <jvanalte@redhat.com> [2012-09-24 14:16]:
> > 
> > > 
> > > > > Is this ok to commit?
> > > > > 
> > > > 
> > > > With caveats noted above, I say yes :)
> > > > 
> > > 
> > > Thanks! Please let me know if there is anything else you'd like
> > > to
> > > know,
> > > updated patch is attached.
> > > 
> > 
> > Hi,
> > 
> > This has been in my TODO for some time, so I am very sorry not to
> > have responded earlier.  From looking at the patch, it seems okay
> > now.  I intend to push this to HEAD on your behalf, unless someone
> > else has some reason why not.  (Now is your chance to speak up
> > about that, if you have such a reason!).  But, I do feel
> > responsible
> > to build with it myself and verify that things seem to be working
> > as
> > intended.  Various other things have been jumping my work queue,
> > but
> > I may have time this week to give this a sanity check and finally
> > get it into hg.  Thanks for persisting!
> > 
> > cheers,
> > Jon
> 
> I've updated the patch slightly to reflect a correction in
> psScavenge.cpp that was causing a build error when icedtea-debug
> wasn't
> specified.  The rest of the patch is unchanged from before.
> 

And I've now pushed this.  I know it's preferred that new work
goes to forest in general, but this was discussed earlier when
patch was originally posted, and afaict the feeling was it
would be better to move all systemtap related patches there in
one step some time later[1].

Thanks Lukas for this contribution!

cheers,
jon

[1] http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-August/020066.html

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-10-25  5:02               ` Jon VanAlten
@ 2012-10-25 13:09                 ` Andrew Hughes
  2012-10-30  1:49                   ` Jon VanAlten
  0 siblings, 1 reply; 27+ messages in thread
From: Andrew Hughes @ 2012-10-25 13:09 UTC (permalink / raw)
  To: Jon VanAlten; +Cc: systemtap, distro-pkg-dev, Lukas Berk



----- Original Message -----
> 
> 
> ----- Original Message -----
> > From: "Lukas Berk" <lberk@redhat.com>
> > To: "Jon VanAlten" <jvanalte@redhat.com>
> > Cc: systemtap@sourceware.org, distro-pkg-dev@openjdk.java.net
> > Sent: Tuesday, October 23, 2012 12:53:30 PM
> > Subject: Re: [RFC] Enhanced Garbage Collection Probe Points
> > 
> > Hey,
> > 
> > * Jon VanAlten <jvanalte@redhat.com> [2012-09-24 14:16]:
> > > 
> > > > 
> > > > > > Is this ok to commit?
> > > > > > 
> > > > > 
> > > > > With caveats noted above, I say yes :)
> > > > > 
> > > > 
> > > > Thanks! Please let me know if there is anything else you'd like
> > > > to
> > > > know,
> > > > updated patch is attached.
> > > > 
> > > 
> > > Hi,
> > > 
> > > This has been in my TODO for some time, so I am very sorry not to
> > > have responded earlier.  From looking at the patch, it seems okay
> > > now.  I intend to push this to HEAD on your behalf, unless
> > > someone
> > > else has some reason why not.  (Now is your chance to speak up
> > > about that, if you have such a reason!).  But, I do feel
> > > responsible
> > > to build with it myself and verify that things seem to be working
> > > as
> > > intended.  Various other things have been jumping my work queue,
> > > but
> > > I may have time this week to give this a sanity check and finally
> > > get it into hg.  Thanks for persisting!
> > > 
> > > cheers,
> > > Jon
> > 
> > I've updated the patch slightly to reflect a correction in
> > psScavenge.cpp that was causing a build error when icedtea-debug
> > wasn't
> > specified.  The rest of the patch is unchanged from before.
> > 
> 
> And I've now pushed this.  I know it's preferred that new work
> goes to forest in general, but this was discussed earlier when
> patch was originally posted, and afaict the feeling was it
> would be better to move all systemtap related patches there in
> one step some time later[1].
> 
> Thanks Lukas for this contribution!
> 

Why has this been pushed?  We don't want more patches adding to IcedTea7.
Please revert.

> cheers,
> jon
> 
> [1]
> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-August/020066.html
> 

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-10-25 13:09                 ` Andrew Hughes
@ 2012-10-30  1:49                   ` Jon VanAlten
  2012-10-30  8:03                     ` Mark Wielaard
  2012-10-30 12:37                     ` Andrew Hughes
  0 siblings, 2 replies; 27+ messages in thread
From: Jon VanAlten @ 2012-10-30  1:49 UTC (permalink / raw)
  To: Andrew Hughes; +Cc: systemtap, distro-pkg-dev, Lukas Berk, Mark Wielaard


> > > 
> > > I've updated the patch slightly to reflect a correction in
> > > psScavenge.cpp that was causing a build error when icedtea-debug
> > > wasn't
> > > specified.  The rest of the patch is unchanged from before.
> > > 
> > 
> > And I've now pushed this.  I know it's preferred that new work
> > goes to forest in general, but this was discussed earlier when
> > patch was originally posted, and afaict the feeling was it
> > would be better to move all systemtap related patches there in
> > one step some time later[1].
> > 
> > Thanks Lukas for this contribution!
> > 
> 
> Why has this been pushed?  We don't want more patches adding to
> IcedTea7.
> Please revert.
> 

I'm sorry for the mix-up.  Andrew and I discussed this further
offline (sorry, this did not happen in public, but neither was it
intentionally private).

We reached the conclusion (I believe) that it would be best to
wait and hear from Mark about plans referred to in email archive
link below.  Mark, do you have any comment here?  Would it be
for the best to revert here and apply instead to 7 forest?

Also, I've backported this changeset to icedtea6, and it should
also probably go somehow to 8.  Can someone refresh me, as a
rather seldom-contributor here, what the correct repos are for
these?

Thanks!
jon
 
> > [1]
> > http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-August/020066.html
> > 
> 
> --
> Andrew :)
> 
> Free Java Software Engineer
> Red Hat, Inc. (http://www.redhat.com)
> 
> PGP Key: 248BDC07 (https://keys.indymedia.org/)
> Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07
> 
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-10-30  1:49                   ` Jon VanAlten
@ 2012-10-30  8:03                     ` Mark Wielaard
  2012-10-30 12:37                     ` Andrew Hughes
  1 sibling, 0 replies; 27+ messages in thread
From: Mark Wielaard @ 2012-10-30  8:03 UTC (permalink / raw)
  To: Jon VanAlten; +Cc: Andrew Hughes, systemtap, distro-pkg-dev, Lukas Berk

On Mon, Oct 29, 2012 at 09:49:17PM -0400, Jon VanAlten wrote:
> We reached the conclusion (I believe) that it would be best to
> wait and hear from Mark about plans referred to in email archive
> link below.  Mark, do you have any comment here?  Would it be
> for the best to revert here and apply instead to 7 forest?

Adding patches directly to the tree is fine with me.
My only hesitation was my own confusion since the default
configure/make setup doesn't pick up a patched forest.
You don't have that issue with patches, which are directly
applied. If we are going for a complete forest setup it
might make sense to also add the tapsets and testsuite
directly there.

I'll try and figure it all out again and also port the existing
patches to the forest. Hints and tips appreciated.

Cheers,

Mark

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-10-30  1:49                   ` Jon VanAlten
  2012-10-30  8:03                     ` Mark Wielaard
@ 2012-10-30 12:37                     ` Andrew Hughes
  2012-11-01 18:33                       ` Jon VanAlten
  1 sibling, 1 reply; 27+ messages in thread
From: Andrew Hughes @ 2012-10-30 12:37 UTC (permalink / raw)
  To: Jon VanAlten
  Cc: systemtap, distro-pkg-dev, Lukas Berk, Mark Wielaard, Andrew Hughes



----- Original Message -----
> 
> > > > 
> > > > I've updated the patch slightly to reflect a correction in
> > > > psScavenge.cpp that was causing a build error when
> > > > icedtea-debug
> > > > wasn't
> > > > specified.  The rest of the patch is unchanged from before.
> > > > 
> > > 
> > > And I've now pushed this.  I know it's preferred that new work
> > > goes to forest in general, but this was discussed earlier when
> > > patch was originally posted, and afaict the feeling was it
> > > would be better to move all systemtap related patches there in
> > > one step some time later[1].
> > > 
> > > Thanks Lukas for this contribution!
> > > 
> > 
> > Why has this been pushed?  We don't want more patches adding to
> > IcedTea7.
> > Please revert.
> > 
> 
> I'm sorry for the mix-up.  Andrew and I discussed this further
> offline (sorry, this did not happen in public, but neither was it
> intentionally private).
> 
> We reached the conclusion (I believe) that it would be best to
> wait and hear from Mark about plans referred to in email archive
> link below.  Mark, do you have any comment here?  Would it be
> for the best to revert here and apply instead to 7 forest?
> 
> Also, I've backported this changeset to icedtea6, and it should
> also probably go somehow to 8.  Can someone refresh me, as a
> rather seldom-contributor here, what the correct repos are for
> these?
> 

Patch needs to be applied to:

http://icedtea.classpath.org/hg/icedtea6/
http://icedtea.classpath.org/hg/icedtea7-forest/jdk/
http://icedtea.classpath.org/hg/icedtea8-forest/jdk/

and reverted from:

http://icedtea.classpath.org/hg/icedtea7/

as all patches for 7 & 8 go to the forest.

> Thanks!
> jon
>  
> > > [1]
> > > http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-August/020066.html
> > > 
> > 
> > --
> > Andrew :)
> > 
> > Free Java Software Engineer
> > Red Hat, Inc. (http://www.redhat.com)
> > 
> > PGP Key: 248BDC07 (https://keys.indymedia.org/)
> > Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07
> > 
> > 
> 

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-10-30 12:37                     ` Andrew Hughes
@ 2012-11-01 18:33                       ` Jon VanAlten
  2012-11-01 19:06                         ` Mark Wielaard
  0 siblings, 1 reply; 27+ messages in thread
From: Jon VanAlten @ 2012-11-01 18:33 UTC (permalink / raw)
  To: Andrew Hughes; +Cc: systemtap, distro-pkg-dev, Lukas Berk, Mark Wielaard



----- Original Message -----
> From: "Andrew Hughes" <gnu.andrew@redhat.com>

<SNIP>

> > > 
> > > Why has this been pushed?  We don't want more patches adding to
> > > IcedTea7.
> > > Please revert.
> > > 
> > 
> > I'm sorry for the mix-up.  Andrew and I discussed this further
> > offline (sorry, this did not happen in public, but neither was it
> > intentionally private).
> > 
> > We reached the conclusion (I believe) that it would be best to
> > wait and hear from Mark about plans referred to in email archive
> > link below.  Mark, do you have any comment here?  Would it be
> > for the best to revert here and apply instead to 7 forest?
> > 
> > Also, I've backported this changeset to icedtea6, and it should
> > also probably go somehow to 8.  Can someone refresh me, as a
> > rather seldom-contributor here, what the correct repos are for
> > these?
> > 
> 
> Patch needs to be applied to:
> 
> http://icedtea.classpath.org/hg/icedtea6/
> http://icedtea.classpath.org/hg/icedtea7-forest/jdk/
> http://icedtea.classpath.org/hg/icedtea8-forest/jdk/
> 
> and reverted from:
> 
> http://icedtea.classpath.org/hg/icedtea7/
> 
> as all patches for 7 & 8 go to the forest.
> 

I would also prefer the 7 stuff to go to the forest, but...

> From: "Mark Wielaard" <mark@klomp.org>

<SNIP>

> 
> Adding patches directly to the tree is fine with me.
> My only hesitation was my own confusion since the default
> configure/make setup doesn't pick up a patched forest.
> You don't have that issue with patches, which are directly
> applied. If we are going for a complete forest setup it
> might make sense to also add the tapsets and testsuite
> directly there.
> 
> I'll try and figure it all out again and also port the existing
> patches to the forest. Hints and tips appreciated.

So about this patch and 7, I'm getting mixed messages here.

Some other things to consider here:

The new work from Lukas can be conceptually divided into two
parts: the new probes added to hotspot code, and the tapset
referring to those probes.  The thing is, the probes are not
afaik usable from linux (my dev/testing platform) without some
parts of Mark's patches.  For this reason, I'm hesitant to port
and push Lukas' work to forest, ahead of Mark's (it becomes
essentially dead code except on Solaris).  So, would it be
acceptable to keep in tree for now, porting to 7/8 forests
later once the prerequisite bits have been ported?

(in the meantime, I *have* ported to 6 tree and pushed that,
since there is no controversy there...)

cheers,
jon

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-11-01 18:33                       ` Jon VanAlten
@ 2012-11-01 19:06                         ` Mark Wielaard
  2012-11-01 22:12                           ` Jon VanAlten
  2012-11-02 14:54                           ` Andrew Hughes
  0 siblings, 2 replies; 27+ messages in thread
From: Mark Wielaard @ 2012-11-01 19:06 UTC (permalink / raw)
  To: Jon VanAlten; +Cc: Andrew Hughes, systemtap, distro-pkg-dev, Lukas Berk

On Thu, 2012-11-01 at 14:32 -0400, Jon VanAlten wrote:
> I would also prefer the 7 stuff to go to the forest, but...
> 
> > From: "Mark Wielaard" <mark@klomp.org>
> 
> <SNIP>
> > 
> > Adding patches directly to the tree is fine with me.
> > My only hesitation was my own confusion since the default
> > configure/make setup doesn't pick up a patched forest.
> > You don't have that issue with patches, which are directly
> > applied. If we are going for a complete forest setup it
> > might make sense to also add the tapsets and testsuite
> > directly there.
> > 
> > I'll try and figure it all out again and also port the existing
> > patches to the forest. Hints and tips appreciated.
> 
> So about this patch and 7, I'm getting mixed messages here.

What is the mixed message? I am fine with adding patches directly to the
forest and even adding the other stuff like the tapsets and the
staptests there. I just don't know the workflow when I would work
against the forest directly and not just have patches in the tree. And I
just haven't found the time to create a new workflow. I am sure it is
just a different ./configure flag, just haven't figured out which one.
So, how do people work against the forest directly? What configure flags
do they use? What does your edit/build/test/commit/pull cycle look like?

Basically the only step I seem to miss is how to make sure the tree is
in sync with what I push to the forest. Somehow I am missing how when I
commit to the forest the icedtea tree is updated so people who update
their tree get the new patch. Knowing how that works would also help
with making sure the buildbot rebuilds the tree each time the forest is
changed and not only when a patch is added to the tree.

Cheers,

Mark

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-11-01 19:06                         ` Mark Wielaard
@ 2012-11-01 22:12                           ` Jon VanAlten
  2012-11-02 14:54                           ` Andrew Hughes
  1 sibling, 0 replies; 27+ messages in thread
From: Jon VanAlten @ 2012-11-01 22:12 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: Andrew Hughes, systemtap, distro-pkg-dev, Lukas Berk



----- Original Message -----
> From: "Mark Wielaard" <mark@klomp.org>
> To: "Jon VanAlten" <jvanalte@redhat.com>
> Cc: "Andrew Hughes" <gnu.andrew@redhat.com>, systemtap@sourceware.org, distro-pkg-dev@openjdk.java.net, "Lukas Berk"
> <lberk@redhat.com>
> Sent: Thursday, November 1, 2012 3:05:45 PM
> Subject: Re: [RFC] Enhanced Garbage Collection Probe Points
> 
> On Thu, 2012-11-01 at 14:32 -0400, Jon VanAlten wrote:
> > I would also prefer the 7 stuff to go to the forest, but...
> > 
> > > From: "Mark Wielaard" <mark@klomp.org>
> > 
> > <SNIP>
> > > 
> > > Adding patches directly to the tree is fine with me.
> > > My only hesitation was my own confusion since the default
> > > configure/make setup doesn't pick up a patched forest.
> > > You don't have that issue with patches, which are directly
> > > applied. If we are going for a complete forest setup it
> > > might make sense to also add the tapsets and testsuite
> > > directly there.
> > > 
> > > I'll try and figure it all out again and also port the existing
> > > patches to the forest. Hints and tips appreciated.
> > 
> > So about this patch and 7, I'm getting mixed messages here.
> 
> What is the mixed message?

Just the difference between Andrew's message (which I will
summarize as "forest not tree except where there is no forest")
and yours ("tree is OK, forest is also probably OK but so far I
don't 'get' it").

> I am fine with adding patches directly to
> the
> forest and even adding the other stuff like the tapsets and the
> staptests there. I just don't know the workflow when I would work
> against the forest directly and not just have patches in the tree.
> And I
> just haven't found the time to create a new workflow. I am sure it is
> just a different ./configure flag, just haven't figured out which
> one.
> So, how do people work against the forest directly? What configure
> flags
> do they use? What does your edit/build/test/commit/pull cycle look
> like?

I admit to forest-ignorance as well, and would appreciate any and all
suggestions here.  Perhaps someone has a pointer to some changesets
in both tree and forest where some conditionally-applied patch has
undergone a similar move?

cheers,
jon

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-11-01 19:06                         ` Mark Wielaard
  2012-11-01 22:12                           ` Jon VanAlten
@ 2012-11-02 14:54                           ` Andrew Hughes
  2012-11-02 15:03                             ` Mark Wielaard
  1 sibling, 1 reply; 27+ messages in thread
From: Andrew Hughes @ 2012-11-02 14:54 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: systemtap, distro-pkg-dev, Lukas Berk, Jon VanAlten

----- Original Message -----
> On Thu, 2012-11-01 at 14:32 -0400, Jon VanAlten wrote:
> > I would also prefer the 7 stuff to go to the forest, but...
> > 
> > > From: "Mark Wielaard" <mark@klomp.org>
> > 
> > <SNIP>
> > > 
> > > Adding patches directly to the tree is fine with me.
> > > My only hesitation was my own confusion since the default
> > > configure/make setup doesn't pick up a patched forest.
> > > You don't have that issue with patches, which are directly
> > > applied. If we are going for a complete forest setup it
> > > might make sense to also add the tapsets and testsuite
> > > directly there.
> > > 
> > > I'll try and figure it all out again and also port the existing
> > > patches to the forest. Hints and tips appreciated.
> > 
> > So about this patch and 7, I'm getting mixed messages here.
> 

Mark, is this the whole of your patch or only part of it?

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/75982791ddb6

i.e. could that be added to forest and systemtap.patch removed from IcedTea7?

> What is the mixed message? I am fine with adding patches directly to
> the
> forest and even adding the other stuff like the tapsets and the
> staptests there. I just don't know the workflow when I would work
> against the forest directly and not just have patches in the tree.
> And I
> just haven't found the time to create a new workflow. I am sure it is
> just a different ./configure flag, just haven't figured out which
> one.
> So, how do people work against the forest directly? What configure
> flags
> do they use? What does your edit/build/test/commit/pull cycle look
> like?
> 
> Basically the only step I seem to miss is how to make sure the tree
> is
> in sync with what I push to the forest. Somehow I am missing how when
> I
> commit to the forest the icedtea tree is updated so people who update
> their tree get the new patch. Knowing how that works would also help
> with making sure the buildbot rebuilds the tree each time the forest
> is
> changed and not only when a patch is added to the tree.
> 

It's a two stage process:

1.  Work against the forest, make sure it builds and then commit.
2.  Sync IcedTea7 with the latest forest revisions.

For 1, the IcedTea forest (or any OpenJDK tree) can be built with something
like:

https://bitbucket.org/gnu_andrew/scripts/src/tip/openjdk.sh

(you don't need all that; it's designed for maximum flexibility).

For stage 2, you need to update the changeset and checksums in IcedTea7.
There's a script to do that for you using the latest tip of each repo.
See scripts/update_tarballs.sh.  You then do a build and, if it's successful
with the new tarballs, it can be pushed with the usual ChangeLog.

There is no automation of updating IcedTea7 to match the forest as in many
cases it requires some manual work.  For example, pushing SystemTap to the
forest also requires removing the patch in IcedTea7.  Likewise, when there is
a big upstream merge, bootstrapping often breaks so the bootstrap patches may
need to be updated.

Also, as updating may also pull in other people's changesets, it's important
to announce your intentions on the mailing list before doing so.  Pulling in
an upstream update that hasn't yet been synced with the forest is going to
give you a lot more work to do and possibly duplicate work being done by myself.
It may be appropriate to delegate 2 in this case, if you have a fairly minor
change but there is a mass of other larger changes coming through too.

A typical update for an upstream sync would be:

2012-09-25  Andrew John Hughes  <gnu_andrew@member.fsf.org>

	* Makefile.am:
        (OPENJDK_VERSION): Bump to b08.
        (CORBA_CHANGESET): Update to IcedTea7 forest head.
        (JAXP_CHANGESET): Likewise.
        (JAXWS_CHANGESET): Likewise.
        (JDK_CHANGESET): Likewise.
        (LANGTOOLS_CHANGESET): Likewise.
        (OPENJDK_CHANGESET): Likewise.
        (CORBA_SHA256SUM): Likewise.
        (JAXP_SHA256SUM): Likewise.
        (JAXWS_SHA256SUM): Likewise.
        (JDK_SHA256SUM): Likewise.
        (LANGTOOLS_SHA256SUM): Likewise.
        (OPENJDK_SHA256SUM): Likewise.
        * hotspot.map: Update default to head of IcedTea7
        forest HotSpot.
        * patches/boot/ecj-diamond.patch:
        Regenerated.  Added new cases in javax.crypto.CryptoPermissions,
	javax.crypto.JceSecurityManager and java.beans.Introspector.
        * patches/boot/ecj-multicatch.patch:
        Added new case in sun.tools.jconsole.Resources.
        * patches/boot/ecj-stringswitch.patch:
        Regenerated.

which reminds me I should update the scripts to better handle the multiple HotSpots
we now have to support due to Zero...

If you want to have a builder building against the upstream forest rather than
the supported set of changesets & checksums, this can be done with 6, 7 & 8.
The option --with-openjdk-src-dir can be used to point to a forest checkout.
I use this to maintain icedtea6-hg which compiles against upstream OpenJDK6,
not a tarball.  You may see failures being posted from this when OpenJDK6 is updated
and not yet in sync.

There's also --enable-hg which does the checkout for you, but this isn't heavily
maintained; I don't use it and I believe it still uses the obsolete forest extension.
It's also inefficient as it does a completely fresh checkout when it makes more sense
to do one manual checkout and reuse it.

> Cheers,
> 
> Mark
> 

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC] Enhanced Garbage Collection Probe Points
  2012-11-02 14:54                           ` Andrew Hughes
@ 2012-11-02 15:03                             ` Mark Wielaard
  0 siblings, 0 replies; 27+ messages in thread
From: Mark Wielaard @ 2012-11-02 15:03 UTC (permalink / raw)
  To: Andrew Hughes; +Cc: systemtap, distro-pkg-dev, Lukas Berk, Jon VanAlten

On Fri, 2012-11-02 at 10:53 -0400, Andrew Hughes wrote:
> Mark, is this the whole of your patch or only part of it?
> 
> http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/75982791ddb6
> 
> i.e. could that be added to forest and systemtap.patch removed from IcedTea7?

Yes it is, plus the followup patch to add the testcase I wrote for it:
http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/26351ce8c4b0

Cheers,

Mark

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2012-11-02 15:03 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-02 13:11 [RFC] Enhanced Garbage Collection Probe Points Lukas Berk
2012-08-03 13:56 ` Mark Wielaard
2012-08-03 14:23   ` Lukas Berk
2012-08-07 11:50     ` Mark Wielaard
2012-08-08 14:01       ` Lukas Berk
2012-08-08 14:34         ` Mario Torre
2012-08-08 20:37 ` Jon VanAlten
2012-08-08 21:11   ` Lukas Berk
2012-08-08 22:05     ` Jon VanAlten
2012-08-22 20:34 ` Lukas Berk
2012-08-24 19:59   ` Jon VanAlten
2012-08-28 21:23     ` Lukas Berk
2012-08-29 11:52       ` Mark Wielaard
2012-08-30  1:19       ` Jon VanAlten
2012-08-31 20:07         ` Lukas Berk
2012-09-24 18:17           ` Jon VanAlten
2012-10-23 16:53             ` Lukas Berk
2012-10-25  5:02               ` Jon VanAlten
2012-10-25 13:09                 ` Andrew Hughes
2012-10-30  1:49                   ` Jon VanAlten
2012-10-30  8:03                     ` Mark Wielaard
2012-10-30 12:37                     ` Andrew Hughes
2012-11-01 18:33                       ` Jon VanAlten
2012-11-01 19:06                         ` Mark Wielaard
2012-11-01 22:12                           ` Jon VanAlten
2012-11-02 14:54                           ` Andrew Hughes
2012-11-02 15:03                             ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).