hotspot/src/share/vm/utilities/dtrace.hpp
changeset 10739 91935236600e
parent 7397 5b173b4ca846
child 13958 f5598a86c223
--- a/hotspot/src/share/vm/utilities/dtrace.hpp	Mon Oct 10 21:01:36 2011 -0400
+++ b/hotspot/src/share/vm/utilities/dtrace.hpp	Thu Oct 13 09:35:42 2011 -0700
@@ -25,7 +25,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,11 +36,27 @@
 #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
+#if defined(SOLARIS)
+#define USDT1 1
+#elif defined(__APPLE__)
+#define USDT2 1
+#include <sys/types.h>
+#include "dtracefiles/hotspot.h"
+#include "dtracefiles/hotspot_jni.h"
+#include "dtracefiles/hs_private.h"
+#else
+#error "dtrace enabled for unknown os"
+#endif /* defined(SOLARIS) */
+
+#else /* defined(DTRACE_ENABLED) */
 
 #define DTRACE_ONLY(x)
 #define NOT_DTRACE(x) x
 
+#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
+
+#ifndef USDT2
+
 #define DTRACE_PROBE(a,b) {;}
 #define DTRACE_PROBE1(a,b,c) {;}
 #define DTRACE_PROBE2(a,b,c,d) {;}
@@ -48,9 +64,14 @@
 #define DTRACE_PROBE4(a,b,c,d,e,f) {;}
 #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;}
 
-#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
+#else /* USDT2 */
 
-#endif
+#include "dtrace_usdt2_disabled.hpp"
+#endif /* USDT2 */
+
+#endif /* defined(DTRACE_ENABLED) */
+
+#ifndef USDT2
 
 #define HS_DTRACE_PROBE_FN(provider,name)\
   __dtrace_##provider##___##name
@@ -133,4 +154,6 @@
     (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\
     (uintptr_t)a8,(uintptr_t)a9))
 
+#endif /* !USDT2 */
+
 #endif // SHARE_VM_UTILITIES_DTRACE_HPP