# HG changeset patch # User Mark Wielaard # Date 1345040193 -7200 # Node ID e632cc2df162df92b602b1bd073eded8f60a2479 # Parent a5758742058dcc21a2b683f022a6425c7f8431cc Split up systemtap.patch in separate sdt-*patches and add testcase. Individual patches, plus testcase as proposed and discussed on hotspot-dev: http://mail.openjdk.java.net/pipermail/hotspot-dev/2012-May/005739.html http://mail.openjdk.java.net/pipermail/hotspot-dev/2012-July/006196.html * Makefile.am (ICEDTEA_PATCHES): Remove systemtap.patch, add individual sdt-*.patches. * patches/systemtap.patch: Removed. * patches/sdt-arguments.patch: Added. * patches/sdt-dtrace-hpp.patch: Added. * patches/sdt-jni.patch: Added. * patches/sdt-make.patch: Added. * overlays/openjdk/hotspot/test/serviceability/SDTProbesGNULinuxTest.sh: New testcase. diff -r a5758742058d -r e632cc2df162 ChangeLog --- a/ChangeLog Wed Aug 15 12:17:03 2012 +0100 +++ b/ChangeLog Wed Aug 15 16:16:33 2012 +0200 @@ -1,3 +1,15 @@ +2012-08-15 Mark Wielaard + + * Makefile.am (ICEDTEA_PATCHES): Remove systemtap.patch, add + individual sdt-*.patches. + * patches/systemtap.patch: Removed. + * patches/sdt-arguments.patch: Added. + * patches/sdt-dtrace-hpp.patch: Added. + * patches/sdt-jni.patch: Added. + * patches/sdt-make.patch: Added. + * overlays/openjdk/hotspot/test/serviceability/SDTProbesGNULinuxTest.sh: + New testcase. + 2012-08-14 Andrew John Hughes PR1113: Include tapset tests in distribution. diff -r a5758742058d -r e632cc2df162 Makefile.am --- a/Makefile.am Wed Aug 15 12:17:03 2012 +0100 +++ b/Makefile.am Wed Aug 15 16:16:33 2012 +0200 @@ -474,7 +474,10 @@ endif if ENABLE_SYSTEMTAP -ICEDTEA_PATCHES += patches/systemtap.patch \ +ICEDTEA_PATCHES += patches/sdt-jni.patch \ + patches/sdt-dtrace-hpp.patch \ + patches/sdt-make.patch \ + patches/sdt-arguments.patch \ patches/systemtap-gcc-4.5.patch \ patches/systemtap-alloc-size-workaround.patch endif diff -r a5758742058d -r e632cc2df162 overlays/openjdk/hotspot/test/serviceability/SDTProbesGNULinuxTest.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/overlays/openjdk/hotspot/test/serviceability/SDTProbesGNULinuxTest.sh Wed Aug 15 16:16:33 2012 +0200 @@ -0,0 +1,68 @@ +# +# 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# @test SDTProbesGNULinuxTest.sh +# @bug 7170638 +# @summary Test SDT probes available on GNU/Linux when DTRACE_ENABLED +# @run shell SDTProbesGNULinuxTest.sh + +# This test only matters on GNU/Linux, others trivially PASS. +OS=`uname -s` +case "$OS" in + Linux ) + ;; + *) + echo "Not testing on anything but GNU/Linux. PASSED" + exit 0; + ;; +esac + +# Where is our java (parent) directory? +if [ "${TESTJAVA}" = "" ]; then + PARENT=$(dirname $(readlink -f $(which java))) + TESTJAVA=`dirname ${PARENT}` + echo "TESTJAVA directory not set, using " ${TESTJAVA} +fi + +# This test only matters when build with DTRACE_ENABLED. +${TESTJAVA}/bin/java -XX:+ExtendedDTraceProbes -version +if [ "$?" != "0" ]; then + echo "Not build using DTRACE_ENABLED. PASSED" + exit 0 +fi + +# Test all available libjvm.so variants +for libjvm in $(find ${TESTJAVA} -name libjvm.so); do + echo "Testing ${libjvm}" + # Check whether the SDT probes are compiled in. + readelf -S ${libjvm} | grep '.note.stapsdt' + if [ "$?" != "0" ]; then + echo "Failed: ${libjvm} doesn't contain SDT probes." + exit 1 + fi + # We could iterate over all SDT probes and test them individually + # with readelf -n, but older readelf versions don't understand them. +done + +echo "Passed." +exit 0 diff -r a5758742058d -r e632cc2df162 patches/sdt-arguments.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/sdt-arguments.patch Wed Aug 15 16:16:33 2012 +0200 @@ -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); diff -r a5758742058d -r e632cc2df162 patches/sdt-dtrace-hpp.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/sdt-dtrace-hpp.patch Wed Aug 15 16:16:33 2012 +0200 @@ -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 + +--- 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 + +@@ -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 diff -r a5758742058d -r e632cc2df162 patches/sdt-jni.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/sdt-jni.patch Wed Aug 15 16:16:33 2012 +0200 @@ -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 + +--- 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"); \ diff -r a5758742058d -r e632cc2df162 patches/sdt-make.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/sdt-make.patch Wed Aug 15 16:16:33 2012 +0200 @@ -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 + +--- 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 + diff -r a5758742058d -r e632cc2df162 patches/systemtap.patch --- a/patches/systemtap.patch Wed Aug 15 12:17:03 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ -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 2010-06-21 22:12:13.000000000 +0100 -+++ openjdk/hotspot/make/linux/makefiles/dtrace.make 2010-08-27 22:37:45.253819793 +0100 -@@ -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 2010-06-21 22:12:20.000000000 +0100 -+++ openjdk/hotspot/src/share/vm/prims/jni.cpp 2010-08-27 22:37:45.261818795 +0100 -@@ -1753,10 +1753,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(); \ -@@ -1930,10 +1927,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"); \ -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); -diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp openjdk/hotspot/src/share/vm/utilities/dtrace.hpp ---- openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp 2011-01-25 22:57:24.000000000 +0000 -+++ openjdk/hotspot/src/share/vm/utilities/dtrace.hpp 2011-01-28 02:39:02.052518309 +0000 -@@ -1,5 +1,6 @@ - /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright 2009 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 - -@@ -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