Mercurial > hg > release > icedtea6-1.13
changeset 2961:8b08136ed5c1
Fix build with/without hs23 for CACAO and SystemTap options.
2013-02-15 Andrew John Hughes <gnu.andrew@redhat.com>
* Makefile.am:
(ICEDTEA_PATCHES): Specialise HotSpot segment of
CACAO memory patch and some SystemTap patches.
Split remaining SystemTap patches between hs23
and original builds.
* patches/cacao/memory.patch:
Remove HotSpot fragments.
* patches/hotspot/hs23/systemtap-alloc-size-workaround.patch:
hs23 version of existing patch.
* patches/hotspot/hs23/systemtap.patch:
Taken from IcedTea7 2.3.
* patches/hotspot/hs23/systemtap_gc.patch:
hs23 version of existing patch.
* patches/hotspot/original/sdt-arguments.patch
* patches/hotspot/original/sdt-dtrace-hpp.patch
* patches/hotspot/original/sdt-jni.patch
* patches/hotspot/original/sdt-make.patch:
* patches/hotspot/original/systemtap-alloc-size-workaround.patch
* patches/hotspot/original/systemtap_gc.patch:
Moved from....
* patches/sdt-arguments.patch
* patches/sdt-dtrace-hpp.patch
* patches/sdt-jni.patch
* patches/sdt-make.patch
* patches/systemtap-alloc-size-workaround.patch
* patches/systemtap_gc.patch:
...here.
author | Andrew John Hughes <gnu.andrew@redhat.com> |
---|---|
date | Sat, 16 Feb 2013 14:49:07 +0000 |
parents | 3439277534e3 |
children | 9b60104392f1 |
files | ChangeLog Makefile.am patches/cacao/memory.patch patches/hotspot/hs23/systemtap-alloc-size-workaround.patch patches/hotspot/hs23/systemtap.patch patches/hotspot/hs23/systemtap_gc.patch patches/hotspot/original/sdt-arguments.patch patches/hotspot/original/sdt-dtrace-hpp.patch patches/hotspot/original/sdt-jni.patch patches/hotspot/original/sdt-make.patch patches/hotspot/original/systemtap-alloc-size-workaround.patch patches/hotspot/original/systemtap_gc.patch patches/sdt-arguments.patch patches/sdt-dtrace-hpp.patch patches/sdt-jni.patch patches/sdt-make.patch patches/systemtap-alloc-size-workaround.patch patches/systemtap_gc.patch |
diffstat | 18 files changed, 1176 insertions(+), 645 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri Feb 15 01:09:35 2013 +0000 +++ b/ChangeLog Sat Feb 16 14:49:07 2013 +0000 @@ -1,3 +1,33 @@ +2013-02-15 Andrew John Hughes <gnu.andrew@redhat.com> + + * Makefile.am: + (ICEDTEA_PATCHES): Specialise HotSpot segment of + CACAO memory patch and some SystemTap patches. + Split remaining SystemTap patches between hs23 + and original builds. + * patches/cacao/memory.patch: + Remove HotSpot fragments. + * patches/hotspot/hs23/systemtap-alloc-size-workaround.patch: + hs23 version of existing patch. + * patches/hotspot/hs23/systemtap.patch: + Taken from IcedTea7 2.3. + * patches/hotspot/hs23/systemtap_gc.patch: + hs23 version of existing patch. + * patches/hotspot/original/sdt-arguments.patch + * patches/hotspot/original/sdt-dtrace-hpp.patch + * patches/hotspot/original/sdt-jni.patch + * patches/hotspot/original/sdt-make.patch: + * patches/hotspot/original/systemtap-alloc-size-workaround.patch + * patches/hotspot/original/systemtap_gc.patch: + Moved from.... + * patches/sdt-arguments.patch + * patches/sdt-dtrace-hpp.patch + * patches/sdt-jni.patch + * patches/sdt-make.patch + * patches/systemtap-alloc-size-workaround.patch + * patches/systemtap_gc.patch: + ...here. + 2013-02-14 Andrew John Hughes <gnu.andrew@redhat.com> PR1319: Support GIF lib v5.
--- a/Makefile.am Fri Feb 15 01:09:35 2013 +0000 +++ b/Makefile.am Sat Feb 16 14:49:07 2013 +0000 @@ -528,11 +528,13 @@ ICEDTEA_PATCHES += \ patches/cacao/launcher.patch \ patches/cacao/memory.patch \ + patches/cacao/hotspot/$(HSBUILD)/memory.patch \ patches/cacao/armhf.patch else if USING_CACAO ICEDTEA_PATCHES += \ - patches/cacao/memory.patch + patches/cacao/memory.patch \ + patches/cacao/hotspot/$(HSBUILD)/memory.patch endif endif @@ -548,13 +550,18 @@ endif if ENABLE_SYSTEMTAP -ICEDTEA_PATCHES += patches/sdt-jni.patch \ - patches/sdt-dtrace-hpp.patch \ - patches/sdt-make.patch \ - patches/sdt-arguments.patch \ - patches/systemtap_gc.patch - patches/systemtap-gcc-4.5.patch \ - patches/systemtap-alloc-size-workaround.patch +if WITH_ALT_HSBUILD +ICEDTEA_PATCHES += patches/hotspot/hs23/systemtap.patch +else +ICEDTEA_PATCHES += patches/hotspot/original/sdt-jni.patch \ + patches/hotspot/original/sdt-dtrace-hpp.patch \ + patches/hotspot/original/sdt-make.patch \ + patches/hotspot/original/sdt-arguments.patch \ + patches/systemtap-gcc-4.5.patch +endif +ICEDTEA_PATCHES += \ + patches/hotspot/$(HSBUILD)/systemtap_gc.patch \ + patches/hotspot/$(HSBUILD)/systemtap-alloc-size-workaround.patch endif if ENABLE_NSS
--- a/patches/cacao/memory.patch Fri Feb 15 01:09:35 2013 +0000 +++ b/patches/cacao/memory.patch Sat Feb 16 14:49:07 2013 +0000 @@ -16,42 +16,6 @@ <compilerarg line="${javac.no.jdk.warnings}"/> <compilerarg line="${javac.version.opt}"/> <compilerarg line="${javac.lint.opts}"/> -diff -Nru openjdk.orig/hotspot/make/linux/makefiles/rules.make openjdk-ecj/hotspot/make/linux/makefiles/rules.make ---- openjdk.orig/hotspot/make/linux/makefiles/rules.make 2013-01-26 13:32:42.117831617 +0000 -+++ openjdk/hotspot/make/linux/makefiles/rules.make 2013-01-26 13:33:29.934595340 +0000 -@@ -133,7 +133,7 @@ - # Settings for javac - BOOT_SOURCE_LANGUAGE_VERSION = 5 - BOOT_TARGET_CLASS_VERSION = 5 --JAVAC_FLAGS = -g -encoding ascii -+JAVAC_FLAGS = -g -encoding ascii -J-Xmx512m - BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION) - - # With parallel makes, print a message at the end of compilation. -diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/rules.make openjdk-ecj/hotspot/make/solaris/makefiles/rules.make ---- openjdk.orig/hotspot/make/solaris/makefiles/rules.make 2013-01-26 13:32:42.137831936 +0000 -+++ openjdk/hotspot/make/solaris/makefiles/rules.make 2013-01-26 13:33:41.934787007 +0000 -@@ -133,7 +133,7 @@ - # Settings for javac - BOOT_SOURCE_LANGUAGE_VERSION = 5 - BOOT_TARGET_CLASS_VERSION = 5 --JAVAC_FLAGS = -g -encoding ascii -+JAVAC_FLAGS = -g -encoding ascii -J-Xmx512m - BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION) - - # With parallel makes, print a message at the end of compilation. -diff -Nru openjdk.orig/hotspot/make/windows/makefiles/rules.make openjdk-ecj/hotspot/make/windows/makefiles/rules.make ---- openjdk.orig/hotspot/make/windows/makefiles/rules.make 2013-01-26 13:32:42.153832191 +0000 -+++ openjdk/hotspot/make/windows/makefiles/rules.make 2013-01-26 13:34:12.419273915 +0000 -@@ -45,7 +45,7 @@ - # Settings for javac - BOOT_SOURCE_LANGUAGE_VERSION=5 - BOOT_TARGET_CLASS_VERSION=5 --JAVAC_FLAGS=-g -encoding ascii -+JAVAC_FLAGS=-g -encoding ascii -J-Xmx512m - BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION) - - ProjectFile=jvm.vcproj diff -Nru openjdk.orig/jaxws/build.properties openjdk-ecj/jaxws/build.properties --- openjdk.orig/jaxws/build.properties 2013-01-26 06:52:34.544450267 +0000 +++ openjdk/jaxws/build.properties 2013-01-26 06:52:51.896729971 +0000
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/hs23/systemtap-alloc-size-workaround.patch Sat Feb 16 14:49:07 2013 +0000 @@ -0,0 +1,12 @@ +diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp 2013-02-15 15:41:31.698499811 +0000 +@@ -966,7 +966,7 @@ + Symbol* name = klass->name(); + #ifndef USDT2 + HS_DTRACE_PROBE4(hotspot, object__alloc, get_java_tid(thread), +- name->bytes(), name->utf8_length(), size * HeapWordSize); ++ name->bytes(), name->utf8_length(), size); + #else /* USDT2 */ + HOTSPOT_OBJECT_ALLOC( + get_java_tid(thread),
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/hs23/systemtap.patch Sat Feb 16 14:49:07 2013 +0000 @@ -0,0 +1,140 @@ +diff -Nru openjdk.orig/hotspot/make/linux/makefiles/dtrace.make openjdk/hotspot/make/linux/makefiles/dtrace.make +--- openjdk.orig/hotspot/make/linux/makefiles/dtrace.make 2012-02-22 14:54:31.000000000 +0000 ++++ openjdk/hotspot/make/linux/makefiles/dtrace.make 2012-03-18 18:54:13.482968139 +0000 +@@ -25,3 +25,7 @@ + # Linux does not build jvm_db + LIBJVM_DB = + ++# But it does have a Systemtap dtrace compatible sys/sdt.h ++CFLAGS += -DDTRACE_ENABLED ++ ++# It doesn't support HAVE_DTRACE_H though. +diff -Nru openjdk.orig/hotspot/src/share/vm/prims/jni.cpp openjdk/hotspot/src/share/vm/prims/jni.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/jni.cpp 2012-02-22 14:54:31.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/prims/jni.cpp 2012-03-18 18:54:13.502968466 +0000 +@@ -2818,10 +2818,7 @@ + JNI_QUICK_ENTRY(void, jni_Set##Result##Field(JNIEnv *env, jobject obj, jfieldID fieldID, Argument value)) \ + JNIWrapper("Set" XSTR(Result) "Field"); \ + \ +- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, Set##Result##Field__entry, \ +- ( JNIEnv*, jobject, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \ +- HS_DTRACE_PROBE_N(hotspot_jni, Set##Result##Field__entry, \ +- ( env, obj, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \ ++ FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID, value),DTRACE_PROBE3(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID)); \ + \ + oop o = JNIHandles::resolve_non_null(obj); \ + klassOop k = o->klass(); \ +@@ -3128,10 +3125,7 @@ + \ + JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID fieldID, Argument value)) \ + JNIWrapper("SetStatic" XSTR(Result) "Field"); \ +- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, SetStatic##Result##Field__entry,\ +- ( JNIEnv*, jclass, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \ +- HS_DTRACE_PROBE_N(hotspot_jni, SetStatic##Result##Field__entry, \ +- ( env, clazz, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \ ++ FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID, value),DTRACE_PROBE3(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID)); \ + \ + JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \ + assert(id->is_static_field_id(), "invalid static field id"); \ +--- openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp 2012-02-22 15:54:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/utilities/dtrace.hpp 2012-03-27 13:12:15.857491730 +0200 +@@ -1,5 +1,6 @@ + /* + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2009, 2012 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -32,12 +33,15 @@ + #define DTRACE_ONLY(x) x + #define NOT_DTRACE(x) + ++#if defined(SOLARIS) + // Work around dtrace tail call bug 6672627 until it is fixed in solaris 10. + #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \ + do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0) + +-#if defined(SOLARIS) + #define USDT1 1 ++#elif defined(LINUX) ++#define USDT1 1 ++#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() + #elif defined(__APPLE__) + #define USDT2 1 + #include <sys/types.h> +@@ -63,6 +67,11 @@ + #define DTRACE_PROBE3(a,b,c,d,e) {;} + #define DTRACE_PROBE4(a,b,c,d,e,f) {;} + #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;} ++#define DTRACE_PROBE6(a,b,c,d,e,f,g,h) {;} ++#define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;} ++#define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;} ++#define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;} ++#define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;} + + #else /* USDT2 */ + +@@ -76,10 +85,19 @@ + #define HS_DTRACE_PROBE_FN(provider,name)\ + __dtrace_##provider##___##name + ++#ifdef SOLARIS ++// Solaris dtrace needs actual extern function decls. + #define HS_DTRACE_PROBE_DECL_N(provider,name,args) \ + DTRACE_ONLY(extern "C" void HS_DTRACE_PROBE_FN(provider,name) args) + #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) \ + DTRACE_ONLY(extern void HS_DTRACE_PROBE_FN(provider,name) args) ++#elif defined(LINUX) ++// Systemtap dtrace compatible probes on GNU/Linux don't. ++#define HS_DTRACE_PROBE_DECL_N(provider,name,args) ++#define HS_DTRACE_PROBE_CDECL_N(provider,name,args) ++#else ++#error "USDT1 enabled for unknown os" ++#endif + + /* Dtrace probe declarations */ + #define HS_DTRACE_PROBE_DECL(provider,name) \ +@@ -118,6 +136,8 @@ + uintptr_t,uintptr_t,uintptr_t)) + + /* Dtrace probe definitions */ ++#if defined(SOLARIS) ++// Solaris dtrace uses actual function calls. + #define HS_DTRACE_PROBE_N(provider,name, args) \ + DTRACE_ONLY(HS_DTRACE_PROBE_FN(provider,name) args) + +@@ -153,6 +173,34 @@ + HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\ + (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\ + (uintptr_t)a8,(uintptr_t)a9)) ++#elif defined(LINUX) ++// Systemtap dtrace compatible probes on GNU/Linux use direct macros. ++#define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name) ++#define HS_DTRACE_PROBE0(provider,name)\ ++ DTRACE_PROBE(provider,name) ++#define HS_DTRACE_PROBE1(provider,name,a0)\ ++ DTRACE_PROBE1(provider,name,a0) ++#define HS_DTRACE_PROBE2(provider,name,a0,a1)\ ++ DTRACE_PROBE2(provider,name,a0,a1) ++#define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\ ++ DTRACE_PROBE3(provider,name,a0,a1,a2) ++#define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\ ++ DTRACE_PROBE4(provider,name,a0,a1,a2,a3) ++#define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\ ++ DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4) ++#define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\ ++ DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5) ++#define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\ ++ DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6) ++#define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\ ++ DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7) ++#define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\ ++ DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8) ++#define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\ ++ DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8) ++#else ++#error "USDT1 enabled for unknown os" ++#endif + + #endif /* !USDT2 */ +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/hs23/systemtap_gc.patch Sat Feb 16 14:49:07 2013 +0000 @@ -0,0 +1,378 @@ +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 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/compiler/oopMap.cpp 2013-02-15 15:15:19.117174844 +0000 +@@ -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; +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 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2013-02-15 15:15:19.141175230 +0000 +@@ -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/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 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp 2013-02-15 15:15:19.137175167 +0000 +@@ -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/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 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp 2013-02-15 15:15:19.157175488 +0000 +@@ -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 -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2013-02-15 15:15:19.137175167 +0000 +@@ -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; +@@ -432,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()); + } + +@@ -1969,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"); + +@@ -3375,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/parallelScavenge/psScavenge.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp 2013-02-15 15:17:54.795682059 +0000 +@@ -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 -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 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp 2013-02-15 15:15:19.141175230 +0000 +@@ -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 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp 2013-02-15 15:16:15.374080867 +0000 +@@ -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" +@@ -52,6 +53,11 @@ + # 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 +534,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 +670,9 @@ + // 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/memory/generation.cpp openjdk/hotspot/src/share/vm/memory/generation.cpp +--- openjdk.orig/hotspot/src/share/vm/memory/generation.cpp 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/memory/generation.cpp 2013-02-15 15:15:19.157175488 +0000 +@@ -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(); + } + +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 2013-02-11 23:08:47.000000000 +0000 ++++ openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp 2013-02-15 15:15:19.137175167 +0000 +@@ -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,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/original/sdt-arguments.patch Sat Feb 16 14:49:07 2013 +0000 @@ -0,0 +1,24 @@ +diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp 2010-08-27 20:30:51.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp 2010-08-27 22:37:45.261818795 +0100 +@@ -2460,16 +2460,16 @@ + FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false); + FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true); + } else if (match_option(option, "-XX:+ExtendedDTraceProbes", &tail)) { +-#ifdef SOLARIS ++#ifdef DTRACE_ENABLED + FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true); + FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true); + FLAG_SET_CMDLINE(bool, DTraceAllocProbes, true); + FLAG_SET_CMDLINE(bool, DTraceMonitorProbes, true); +-#else // ndef SOLARIS ++#else // ndef DTRACE_ENABLED + jio_fprintf(defaultStream::error_stream(), +- "ExtendedDTraceProbes flag is only applicable on Solaris\n"); ++ "ExtendedDTraceProbes flag is only applicable on dtrace enabled builds\n"); + return JNI_EINVAL; +-#endif // ndef SOLARIS ++#endif // ndef DTRACE_ENABLED + #ifdef ASSERT + } else if (match_option(option, "-XX:+FullGCALot", &tail)) { + FLAG_SET_CMDLINE(bool, FullGCALot, true);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/original/sdt-dtrace-hpp.patch Sat Feb 16 14:49:07 2013 +0000 @@ -0,0 +1,103 @@ +# 7170638: Define DTRACE macros for use with GNU/Linux SystemTap sys/sdt.h. +# Summary: LINUX also uses USDT1, but with macros instead of function decls. +# Contributed-by: Mark Wielaard <mjw@redhat.com> + +--- openjdk/hotspot/src/share/vm/utilities/dtrace.hpp 2012-07-21 11:01:40.836101766 +0200 ++++ openjdk/hotspot/src/share/vm/utilities/dtrace.hpp 2012-07-21 11:01:40.741100325 +0200 +@@ -1,5 +1,6 @@ + /* + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2009, 2012 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -25,7 +26,7 @@ + #ifndef SHARE_VM_UTILITIES_DTRACE_HPP + #define SHARE_VM_UTILITIES_DTRACE_HPP + +-#if defined(SOLARIS) && defined(DTRACE_ENABLED) ++#if defined(DTRACE_ENABLED) + + #include <sys/sdt.h> + +@@ -36,7 +37,7 @@ + #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \ + do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0) + +-#else // ndef SOLARIS || ndef DTRACE_ENABLED ++#else // ndef DTRACE_ENABLED + + #define DTRACE_ONLY(x) + #define NOT_DTRACE(x) x +@@ -47,11 +48,18 @@ + #define DTRACE_PROBE3(a,b,c,d,e) {;} + #define DTRACE_PROBE4(a,b,c,d,e,f) {;} + #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;} ++#define DTRACE_PROBE6(a,b,c,d,e,f,g,h) {;} ++#define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;} ++#define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;} ++#define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;} ++#define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;} + + #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() + + #endif + ++#if defined(SOLARIS) ++// Solaris dtrace needs actual extern function decls. + #define HS_DTRACE_PROBE_FN(provider,name)\ + __dtrace_##provider##___##name + +@@ -59,6 +67,11 @@ + DTRACE_ONLY(extern "C" void HS_DTRACE_PROBE_FN(provider,name) args) + #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) \ + DTRACE_ONLY(extern void HS_DTRACE_PROBE_FN(provider,name) args) ++#else ++// Systemtap dtrace compatible probes on GNU/Linux don't. ++#define HS_DTRACE_PROBE_DECL_N(provider,name,args) ++#define HS_DTRACE_PROBE_CDECL_N(provider,name,args) ++#endif + + /* Dtrace probe declarations */ + #define HS_DTRACE_PROBE_DECL(provider,name) \ +@@ -97,6 +110,8 @@ + uintptr_t,uintptr_t,uintptr_t)) + + /* Dtrace probe definitions */ ++#if defined(SOLARIS) ++// Solaris dtrace uses actual function calls. + #define HS_DTRACE_PROBE_N(provider,name, args) \ + DTRACE_ONLY(HS_DTRACE_PROBE_FN(provider,name) args) + +@@ -132,5 +147,31 @@ + HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\ + (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\ + (uintptr_t)a8,(uintptr_t)a9)) ++#else ++// Systemtap dtrace compatible probes on GNU/Linux use direct macros. ++#define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name) ++#define HS_DTRACE_PROBE0(provider,name)\ ++ DTRACE_PROBE(provider,name) ++#define HS_DTRACE_PROBE1(provider,name,a0)\ ++ DTRACE_PROBE1(provider,name,a0) ++#define HS_DTRACE_PROBE2(provider,name,a0,a1)\ ++ DTRACE_PROBE2(provider,name,a0,a1) ++#define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\ ++ DTRACE_PROBE3(provider,name,a0,a1,a2) ++#define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\ ++ DTRACE_PROBE4(provider,name,a0,a1,a2,a3) ++#define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\ ++ DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4) ++#define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\ ++ DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5) ++#define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\ ++ DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6) ++#define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\ ++ DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7) ++#define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\ ++ DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8) ++#define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\ ++ DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8) ++#endif + + #endif // SHARE_VM_UTILITIES_DTRACE_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/original/sdt-jni.patch Sat Feb 16 14:49:07 2013 +0000 @@ -0,0 +1,37 @@ +# 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field. +# Summary: Don't use HS_DTRACE_PROBE_CDECL_N and HS_DTRACE_PROBE_N directly. +# Contributed-by: Mark Wielaard <mjw@redhat.com> + +--- openjdk/hotspot/src/share/vm/prims/jni.cpp 2012-07-21 11:00:27.793993673 +0200 ++++ openjdk/hotspot/src/share/vm/prims/jni.cpp 2012-07-21 11:00:27.685992034 +0200 +@@ -1,5 +1,6 @@ + /* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2012 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -1817,10 +1818,7 @@ + JNI_QUICK_ENTRY(void, jni_Set##Result##Field(JNIEnv *env, jobject obj, jfieldID fieldID, Argument value)) \ + JNIWrapper("Set" XSTR(Result) "Field"); \ + \ +- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, Set##Result##Field__entry, \ +- ( JNIEnv*, jobject, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \ +- HS_DTRACE_PROBE_N(hotspot_jni, Set##Result##Field__entry, \ +- ( env, obj, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \ ++ FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID, value),DTRACE_PROBE3(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID)); \ + \ + oop o = JNIHandles::resolve_non_null(obj); \ + klassOop k = o->klass(); \ +@@ -1992,10 +1990,7 @@ + \ + JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID fieldID, Argument value)) \ + JNIWrapper("SetStatic" XSTR(Result) "Field"); \ +- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, SetStatic##Result##Field__entry,\ +- ( JNIEnv*, jclass, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \ +- HS_DTRACE_PROBE_N(hotspot_jni, SetStatic##Result##Field__entry, \ +- ( env, clazz, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \ ++ FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID, value),DTRACE_PROBE3(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID)); \ + \ + JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \ + assert(id->is_static_field_id(), "invalid static field id"); \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/original/sdt-make.patch Sat Feb 16 14:49:07 2013 +0000 @@ -0,0 +1,51 @@ +# 7170638: Enable dtrace compatible sdt probes on GNU/Linux builds. +# Summary: If sys/sdt.h is found, then enable dtrace compatible sdt probes. +# Contributed-by: Mark Wielaard <mjw@redhat.com> + +--- openjdk/hotspot/make/linux/makefiles/dtrace.make 2012-07-21 11:02:17.926664397 +0200 ++++ openjdk/hotspot/make/linux/makefiles/dtrace.make 2012-07-21 11:02:17.829662925 +0200 +@@ -1,5 +1,6 @@ + # + # Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. ++# Copyright (c) 2012 Red Hat, Inc. + # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + # + # This code is free software; you can redistribute it and/or modify it +@@ -25,3 +26,26 @@ + # Linux does not build jvm_db + LIBJVM_DB = + ++# But it does have a SystemTap dtrace compatible sys/sdt.h ++ifneq ($(ALT_SDT_H),) ++ SDT_H_FILE = $(ALT_SDT_H) ++else ++ SDT_H_FILE = /usr/include/sys/sdt.h ++endif ++DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE)) ++ ++ifneq ($(DTRACE_ENABLED),) ++ CFLAGS += -DDTRACE_ENABLED ++endif ++ ++# Phone target used in vm.make build target to check whether enabled. ++.PHONY: dtraceCheck ++ifeq ($(DTRACE_ENABLED),) ++dtraceCheck: ++ $(QUIETLY) echo "**NOTICE** Dtrace support disabled $(SDT_H_FILE) not found" ++else ++dtraceCheck: ++endif ++ ++# It doesn't support HAVE_DTRACE_H though. ++ +--- openjdk/hotspot/make/linux/makefiles/vm.make 2012-07-21 11:02:18.480672801 +0200 ++++ openjdk/hotspot/make/linux/makefiles/vm.make 2012-07-21 11:02:18.384671344 +0200 +@@ -387,7 +387,7 @@ + + #---------------------------------------------------------------------- + +-build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) ++build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) dtraceCheck + + install: install_jvm install_jsig install_saproc +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/original/systemtap-alloc-size-workaround.patch Sat Feb 16 14:49:07 2013 +0000 @@ -0,0 +1,17 @@ +Generating a dwarf location expression for variable * "constant" as used +in this probe argument triggers unforseen complications. See +https://bugzilla.redhat.com/show_bug.cgi?id=613824 +Workaround for now by passing the size without HeapWordSize adjustment. +See also the hotspot.object_alloc in tapset/hotspot.stp[.in]. + +--- openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp 2010-05-18 20:00:22.130618755 +0200 ++++ openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp 2010-07-28 22:53:23.662310007 +0200 +@@ -711,7 +711,7 @@ + int size = o->size(); + symbolOop name = klass->name(); + HS_DTRACE_PROBE4(hotspot, object__alloc, get_java_tid(thread), +- name->bytes(), name->utf8_length(), size * HeapWordSize); ++ name->bytes(), name->utf8_length(), size); + return 0; + } +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/original/systemtap_gc.patch Sat Feb 16 14:49:07 2013 +0000 @@ -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_windows + # include "thread_windows.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 @@ + to()->set_concurrent_iteration_safe_limit(to()->top()); + SpecializationStats::print(); + update_time_of_last_gc(os::javaTimeMillis()); ++#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 */ + bool scavenge_was_done = PSScavenge::invoke_no_policy(); ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__end, &heap, heap->gc_cause()); ++#endif /* !USDT2 */ + + PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters(); + if (UsePerfData) +@@ -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 */ + 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 */ + 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
--- a/patches/sdt-arguments.patch Fri Feb 15 01:09:35 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp ---- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp 2010-08-27 20:30:51.000000000 +0100 -+++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp 2010-08-27 22:37:45.261818795 +0100 -@@ -2460,16 +2460,16 @@ - FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false); - FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true); - } else if (match_option(option, "-XX:+ExtendedDTraceProbes", &tail)) { --#ifdef SOLARIS -+#ifdef DTRACE_ENABLED - FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true); - FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true); - FLAG_SET_CMDLINE(bool, DTraceAllocProbes, true); - FLAG_SET_CMDLINE(bool, DTraceMonitorProbes, true); --#else // ndef SOLARIS -+#else // ndef DTRACE_ENABLED - jio_fprintf(defaultStream::error_stream(), -- "ExtendedDTraceProbes flag is only applicable on Solaris\n"); -+ "ExtendedDTraceProbes flag is only applicable on dtrace enabled builds\n"); - return JNI_EINVAL; --#endif // ndef SOLARIS -+#endif // ndef DTRACE_ENABLED - #ifdef ASSERT - } else if (match_option(option, "-XX:+FullGCALot", &tail)) { - FLAG_SET_CMDLINE(bool, FullGCALot, true);
--- a/patches/sdt-dtrace-hpp.patch Fri Feb 15 01:09:35 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -# 7170638: Define DTRACE macros for use with GNU/Linux SystemTap sys/sdt.h. -# Summary: LINUX also uses USDT1, but with macros instead of function decls. -# Contributed-by: Mark Wielaard <mjw@redhat.com> - ---- openjdk/hotspot/src/share/vm/utilities/dtrace.hpp 2012-07-21 11:01:40.836101766 +0200 -+++ openjdk/hotspot/src/share/vm/utilities/dtrace.hpp 2012-07-21 11:01:40.741100325 +0200 -@@ -1,5 +1,6 @@ - /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2009, 2012 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -25,7 +26,7 @@ - #ifndef SHARE_VM_UTILITIES_DTRACE_HPP - #define SHARE_VM_UTILITIES_DTRACE_HPP - --#if defined(SOLARIS) && defined(DTRACE_ENABLED) -+#if defined(DTRACE_ENABLED) - - #include <sys/sdt.h> - -@@ -36,7 +37,7 @@ - #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \ - do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0) - --#else // ndef SOLARIS || ndef DTRACE_ENABLED -+#else // ndef DTRACE_ENABLED - - #define DTRACE_ONLY(x) - #define NOT_DTRACE(x) x -@@ -47,11 +48,18 @@ - #define DTRACE_PROBE3(a,b,c,d,e) {;} - #define DTRACE_PROBE4(a,b,c,d,e,f) {;} - #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;} -+#define DTRACE_PROBE6(a,b,c,d,e,f,g,h) {;} -+#define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;} -+#define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;} -+#define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;} -+#define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;} - - #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() - - #endif - -+#if defined(SOLARIS) -+// Solaris dtrace needs actual extern function decls. - #define HS_DTRACE_PROBE_FN(provider,name)\ - __dtrace_##provider##___##name - -@@ -59,6 +67,11 @@ - DTRACE_ONLY(extern "C" void HS_DTRACE_PROBE_FN(provider,name) args) - #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) \ - DTRACE_ONLY(extern void HS_DTRACE_PROBE_FN(provider,name) args) -+#else -+// Systemtap dtrace compatible probes on GNU/Linux don't. -+#define HS_DTRACE_PROBE_DECL_N(provider,name,args) -+#define HS_DTRACE_PROBE_CDECL_N(provider,name,args) -+#endif - - /* Dtrace probe declarations */ - #define HS_DTRACE_PROBE_DECL(provider,name) \ -@@ -97,6 +110,8 @@ - uintptr_t,uintptr_t,uintptr_t)) - - /* Dtrace probe definitions */ -+#if defined(SOLARIS) -+// Solaris dtrace uses actual function calls. - #define HS_DTRACE_PROBE_N(provider,name, args) \ - DTRACE_ONLY(HS_DTRACE_PROBE_FN(provider,name) args) - -@@ -132,5 +147,31 @@ - HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\ - (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\ - (uintptr_t)a8,(uintptr_t)a9)) -+#else -+// Systemtap dtrace compatible probes on GNU/Linux use direct macros. -+#define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name) -+#define HS_DTRACE_PROBE0(provider,name)\ -+ DTRACE_PROBE(provider,name) -+#define HS_DTRACE_PROBE1(provider,name,a0)\ -+ DTRACE_PROBE1(provider,name,a0) -+#define HS_DTRACE_PROBE2(provider,name,a0,a1)\ -+ DTRACE_PROBE2(provider,name,a0,a1) -+#define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\ -+ DTRACE_PROBE3(provider,name,a0,a1,a2) -+#define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\ -+ DTRACE_PROBE4(provider,name,a0,a1,a2,a3) -+#define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\ -+ DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4) -+#define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\ -+ DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5) -+#define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\ -+ DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6) -+#define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\ -+ DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7) -+#define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\ -+ DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8) -+#define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\ -+ DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8) -+#endif - - #endif // SHARE_VM_UTILITIES_DTRACE_HPP
--- a/patches/sdt-jni.patch Fri Feb 15 01:09:35 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -# 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field. -# Summary: Don't use HS_DTRACE_PROBE_CDECL_N and HS_DTRACE_PROBE_N directly. -# Contributed-by: Mark Wielaard <mjw@redhat.com> - ---- openjdk/hotspot/src/share/vm/prims/jni.cpp 2012-07-21 11:00:27.793993673 +0200 -+++ openjdk/hotspot/src/share/vm/prims/jni.cpp 2012-07-21 11:00:27.685992034 +0200 -@@ -1,5 +1,6 @@ - /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2012 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -1817,10 +1818,7 @@ - JNI_QUICK_ENTRY(void, jni_Set##Result##Field(JNIEnv *env, jobject obj, jfieldID fieldID, Argument value)) \ - JNIWrapper("Set" XSTR(Result) "Field"); \ - \ -- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, Set##Result##Field__entry, \ -- ( JNIEnv*, jobject, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \ -- HS_DTRACE_PROBE_N(hotspot_jni, Set##Result##Field__entry, \ -- ( env, obj, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \ -+ FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID, value),DTRACE_PROBE3(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID)); \ - \ - oop o = JNIHandles::resolve_non_null(obj); \ - klassOop k = o->klass(); \ -@@ -1992,10 +1990,7 @@ - \ - JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID fieldID, Argument value)) \ - JNIWrapper("SetStatic" XSTR(Result) "Field"); \ -- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, SetStatic##Result##Field__entry,\ -- ( JNIEnv*, jclass, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \ -- HS_DTRACE_PROBE_N(hotspot_jni, SetStatic##Result##Field__entry, \ -- ( env, clazz, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \ -+ FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID, value),DTRACE_PROBE3(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID)); \ - \ - JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \ - assert(id->is_static_field_id(), "invalid static field id"); \
--- a/patches/sdt-make.patch Fri Feb 15 01:09:35 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -# 7170638: Enable dtrace compatible sdt probes on GNU/Linux builds. -# Summary: If sys/sdt.h is found, then enable dtrace compatible sdt probes. -# Contributed-by: Mark Wielaard <mjw@redhat.com> - ---- openjdk/hotspot/make/linux/makefiles/dtrace.make 2012-07-21 11:02:17.926664397 +0200 -+++ openjdk/hotspot/make/linux/makefiles/dtrace.make 2012-07-21 11:02:17.829662925 +0200 -@@ -1,5 +1,6 @@ - # - # Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. -+# Copyright (c) 2012 Red Hat, Inc. - # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - # - # This code is free software; you can redistribute it and/or modify it -@@ -25,3 +26,26 @@ - # Linux does not build jvm_db - LIBJVM_DB = - -+# But it does have a SystemTap dtrace compatible sys/sdt.h -+ifneq ($(ALT_SDT_H),) -+ SDT_H_FILE = $(ALT_SDT_H) -+else -+ SDT_H_FILE = /usr/include/sys/sdt.h -+endif -+DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE)) -+ -+ifneq ($(DTRACE_ENABLED),) -+ CFLAGS += -DDTRACE_ENABLED -+endif -+ -+# Phone target used in vm.make build target to check whether enabled. -+.PHONY: dtraceCheck -+ifeq ($(DTRACE_ENABLED),) -+dtraceCheck: -+ $(QUIETLY) echo "**NOTICE** Dtrace support disabled $(SDT_H_FILE) not found" -+else -+dtraceCheck: -+endif -+ -+# It doesn't support HAVE_DTRACE_H though. -+ ---- openjdk/hotspot/make/linux/makefiles/vm.make 2012-07-21 11:02:18.480672801 +0200 -+++ openjdk/hotspot/make/linux/makefiles/vm.make 2012-07-21 11:02:18.384671344 +0200 -@@ -387,7 +387,7 @@ - - #---------------------------------------------------------------------- - --build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) -+build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) dtraceCheck - - install: install_jvm install_jsig install_saproc -
--- a/patches/systemtap-alloc-size-workaround.patch Fri Feb 15 01:09:35 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -Generating a dwarf location expression for variable * "constant" as used -in this probe argument triggers unforseen complications. See -https://bugzilla.redhat.com/show_bug.cgi?id=613824 -Workaround for now by passing the size without HeapWordSize adjustment. -See also the hotspot.object_alloc in tapset/hotspot.stp[.in]. - ---- openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp 2010-05-18 20:00:22.130618755 +0200 -+++ openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp 2010-07-28 22:53:23.662310007 +0200 -@@ -711,7 +711,7 @@ - int size = o->size(); - symbolOop name = klass->name(); - HS_DTRACE_PROBE4(hotspot, object__alloc, get_java_tid(thread), -- name->bytes(), name->utf8_length(), size * HeapWordSize); -+ name->bytes(), name->utf8_length(), size); - return 0; - } -
--- a/patches/systemtap_gc.patch Fri Feb 15 01:09:35 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,369 +0,0 @@ ---- 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_windows - # include "thread_windows.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 @@ - to()->set_concurrent_iteration_safe_limit(to()->top()); - SpecializationStats::print(); - update_time_of_last_gc(os::javaTimeMillis()); -+#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 */ - bool scavenge_was_done = PSScavenge::invoke_no_policy(); -+#ifndef USDT2 -+ HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__end, &heap, heap->gc_cause()); -+#endif /* !USDT2 */ - - PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters(); - if (UsePerfData) -@@ -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 */ - 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 */ - 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