1.1 --- a/src/share/vm/utilities/dtrace.hpp Mon Oct 10 21:01:36 2011 -0400 1.2 +++ b/src/share/vm/utilities/dtrace.hpp Thu Oct 13 09:35:42 2011 -0700 1.3 @@ -25,7 +25,7 @@ 1.4 #ifndef SHARE_VM_UTILITIES_DTRACE_HPP 1.5 #define SHARE_VM_UTILITIES_DTRACE_HPP 1.6 1.7 -#if defined(SOLARIS) && defined(DTRACE_ENABLED) 1.8 +#if defined(DTRACE_ENABLED) 1.9 1.10 #include <sys/sdt.h> 1.11 1.12 @@ -36,11 +36,27 @@ 1.13 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \ 1.14 do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0) 1.15 1.16 -#else // ndef SOLARIS || ndef DTRACE_ENABLED 1.17 +#if defined(SOLARIS) 1.18 +#define USDT1 1 1.19 +#elif defined(__APPLE__) 1.20 +#define USDT2 1 1.21 +#include <sys/types.h> 1.22 +#include "dtracefiles/hotspot.h" 1.23 +#include "dtracefiles/hotspot_jni.h" 1.24 +#include "dtracefiles/hs_private.h" 1.25 +#else 1.26 +#error "dtrace enabled for unknown os" 1.27 +#endif /* defined(SOLARIS) */ 1.28 + 1.29 +#else /* defined(DTRACE_ENABLED) */ 1.30 1.31 #define DTRACE_ONLY(x) 1.32 #define NOT_DTRACE(x) x 1.33 1.34 +#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() 1.35 + 1.36 +#ifndef USDT2 1.37 + 1.38 #define DTRACE_PROBE(a,b) {;} 1.39 #define DTRACE_PROBE1(a,b,c) {;} 1.40 #define DTRACE_PROBE2(a,b,c,d) {;} 1.41 @@ -48,9 +64,14 @@ 1.42 #define DTRACE_PROBE4(a,b,c,d,e,f) {;} 1.43 #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;} 1.44 1.45 -#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() 1.46 +#else /* USDT2 */ 1.47 1.48 -#endif 1.49 +#include "dtrace_usdt2_disabled.hpp" 1.50 +#endif /* USDT2 */ 1.51 + 1.52 +#endif /* defined(DTRACE_ENABLED) */ 1.53 + 1.54 +#ifndef USDT2 1.55 1.56 #define HS_DTRACE_PROBE_FN(provider,name)\ 1.57 __dtrace_##provider##___##name 1.58 @@ -133,4 +154,6 @@ 1.59 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\ 1.60 (uintptr_t)a8,(uintptr_t)a9)) 1.61 1.62 +#endif /* !USDT2 */ 1.63 + 1.64 #endif // SHARE_VM_UTILITIES_DTRACE_HPP