# HG changeset patch # User Mark Wielaard # Date 1345042893 -7200 # Node ID 704714f568d98a8226620c72e6d72d2325902286 # Parent 32dfd32d567405cacfa0073bd66a630bc85dc419 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-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 32dfd32d5674 -r 704714f568d9 ChangeLog --- a/ChangeLog Wed Aug 15 13:20:11 2012 +0200 +++ b/ChangeLog Wed Aug 15 17:01:33 2012 +0200 @@ -1,3 +1,14 @@ +2012-08-15 Mark Wielaard + + * Makefile.am (ICEDTEA_PATCHES): Remove systemtap.patch, add + individual sdt-*.patches. + * patches/systemtap.patch: Removed. + * 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-15 Xerxes RĂ„nby Robert Lougher diff -r 32dfd32d5674 -r 704714f568d9 Makefile.am --- a/Makefile.am Wed Aug 15 13:20:11 2012 +0200 +++ b/Makefile.am Wed Aug 15 17:01:33 2012 +0200 @@ -286,7 +286,9 @@ endif if ENABLE_SYSTEMTAP -ICEDTEA_PATCHES += patches/systemtap.patch +ICEDTEA_PATCHES += patches/sdt-jni.patch \ + patches/sdt-dtrace-hpp.patch \ + patches/sdt-make.patch endif if ENABLE_NSS diff -r 32dfd32d5674 -r 704714f568d9 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 17:01: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 32dfd32d5674 -r 704714f568d9 patches/sdt-dtrace-hpp.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/sdt-dtrace-hpp.patch Wed Aug 15 17:01:33 2012 +0200 @@ -0,0 +1,106 @@ +# 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 +@@ -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 +@@ -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 */ + diff -r 32dfd32d5674 -r 704714f568d9 patches/sdt-jni.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/sdt-jni.patch Wed Aug 15 17:01: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, 2012, 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 +@@ -2820,10 +2821,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(); \ +@@ -3130,10 +3128,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 32dfd32d5674 -r 704714f568d9 patches/sdt-make.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/sdt-make.patch Wed Aug 15 17:01: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 $(WB_JAR) + + install: install_jvm install_jsig install_saproc + diff -r 32dfd32d5674 -r 704714f568d9 patches/systemtap.patch --- a/patches/systemtap.patch Wed Aug 15 13:20:11 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +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 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 -@@ -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 */ -