Mercurial > hg > truffle
comparison src/share/vm/utilities/dtrace.hpp @ 14521:29ccc4cbabca
Merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 12 Mar 2014 13:30:08 +0100 |
parents | e6195383bcaf |
children | 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14520:f84115370178 | 14521:29ccc4cbabca |
---|---|
35 | 35 |
36 #if defined(SOLARIS) | 36 #if defined(SOLARIS) |
37 // Work around dtrace tail call bug 6672627 until it is fixed in solaris 10. | 37 // Work around dtrace tail call bug 6672627 until it is fixed in solaris 10. |
38 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \ | 38 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \ |
39 do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0) | 39 do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0) |
40 | |
41 #define USDT1 1 | |
42 #elif defined(LINUX) | 40 #elif defined(LINUX) |
43 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() | 41 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() |
44 #define USDT1 1 | |
45 #elif defined(__APPLE__) | 42 #elif defined(__APPLE__) |
46 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() | 43 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() |
47 #define USDT2 1 | |
48 #include <sys/types.h> | 44 #include <sys/types.h> |
45 #else | |
46 #error "dtrace enabled for unknown os" | |
47 #endif /* defined(SOLARIS) */ | |
48 | |
49 #include "dtracefiles/hotspot.h" | 49 #include "dtracefiles/hotspot.h" |
50 #include "dtracefiles/hotspot_jni.h" | 50 #include "dtracefiles/hotspot_jni.h" |
51 #include "dtracefiles/hs_private.h" | 51 #include "dtracefiles/hs_private.h" |
52 #else | |
53 #error "dtrace enabled for unknown os" | |
54 #endif /* defined(SOLARIS) */ | |
55 | 52 |
56 #else /* defined(DTRACE_ENABLED) */ | 53 #else /* defined(DTRACE_ENABLED) */ |
57 | 54 |
58 #define DTRACE_ONLY(x) | 55 #define DTRACE_ONLY(x) |
59 #define NOT_DTRACE(x) x | 56 #define NOT_DTRACE(x) x |
60 | 57 |
61 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() | 58 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() |
62 | 59 |
63 #ifndef USDT2 | 60 #include "dtrace_disabled.hpp" |
64 | |
65 #define DTRACE_PROBE(a,b) {;} | |
66 #define DTRACE_PROBE1(a,b,c) {;} | |
67 #define DTRACE_PROBE2(a,b,c,d) {;} | |
68 #define DTRACE_PROBE3(a,b,c,d,e) {;} | |
69 #define DTRACE_PROBE4(a,b,c,d,e,f) {;} | |
70 #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;} | |
71 #define DTRACE_PROBE6(a,b,c,d,e,f,g,h) {;} | |
72 #define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;} | |
73 #define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;} | |
74 #define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;} | |
75 #define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;} | |
76 | |
77 #else /* USDT2 */ | |
78 | |
79 #include "dtrace_usdt2_disabled.hpp" | |
80 #endif /* USDT2 */ | |
81 | 61 |
82 #endif /* defined(DTRACE_ENABLED) */ | 62 #endif /* defined(DTRACE_ENABLED) */ |
83 | 63 |
84 #ifndef USDT2 | |
85 | |
86 #define HS_DTRACE_PROBE_FN(provider,name)\ | |
87 __dtrace_##provider##___##name | |
88 | |
89 #ifdef SOLARIS | |
90 // Solaris dtrace needs actual extern function decls. | |
91 #define HS_DTRACE_PROBE_DECL_N(provider,name,args) \ | |
92 DTRACE_ONLY(extern "C" void HS_DTRACE_PROBE_FN(provider,name) args) | |
93 #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) \ | |
94 DTRACE_ONLY(extern void HS_DTRACE_PROBE_FN(provider,name) args) | |
95 #else | |
96 // Systemtap dtrace compatible probes on GNU/Linux don't. | |
97 // If dtrace is disabled this macro becomes NULL | |
98 #define HS_DTRACE_PROBE_DECL_N(provider,name,args) | |
99 #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) | |
100 #endif | |
101 | |
102 /* Dtrace probe declarations */ | |
103 #define HS_DTRACE_PROBE_DECL(provider,name) \ | |
104 HS_DTRACE_PROBE_DECL0(provider,name) | |
105 #define HS_DTRACE_PROBE_DECL0(provider,name)\ | |
106 HS_DTRACE_PROBE_DECL_N(provider,name,(void)) | |
107 #define HS_DTRACE_PROBE_DECL1(provider,name,t0)\ | |
108 HS_DTRACE_PROBE_DECL_N(provider,name,(uintptr_t)) | |
109 #define HS_DTRACE_PROBE_DECL2(provider,name,t0,t1)\ | |
110 HS_DTRACE_PROBE_DECL_N(provider,name,(uintptr_t,uintptr_t)) | |
111 #define HS_DTRACE_PROBE_DECL3(provider,name,t0,t1,t2)\ | |
112 HS_DTRACE_PROBE_DECL_N(provider,name,(uintptr_t,uintptr_t,uintptr_t)) | |
113 #define HS_DTRACE_PROBE_DECL4(provider,name,t0,t1,t2,t3)\ | |
114 HS_DTRACE_PROBE_DECL_N(provider,name,(uintptr_t,uintptr_t,uintptr_t,\ | |
115 uintptr_t)) | |
116 #define HS_DTRACE_PROBE_DECL5(provider,name,t0,t1,t2,t3,t4)\ | |
117 HS_DTRACE_PROBE_DECL_N(provider,name,(\ | |
118 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t)) | |
119 #define HS_DTRACE_PROBE_DECL6(provider,name,t0,t1,t2,t3,t4,t5)\ | |
120 HS_DTRACE_PROBE_DECL_N(provider,name,(\ | |
121 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t)) | |
122 #define HS_DTRACE_PROBE_DECL7(provider,name,t0,t1,t2,t3,t4,t5,t6)\ | |
123 HS_DTRACE_PROBE_DECL_N(provider,name,(\ | |
124 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t)) | |
125 #define HS_DTRACE_PROBE_DECL8(provider,name,t0,t1,t2,t3,t4,t5,t6,t7)\ | |
126 HS_DTRACE_PROBE_DECL_N(provider,name,(\ | |
127 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,\ | |
128 uintptr_t)) | |
129 #define HS_DTRACE_PROBE_DECL9(provider,name,t0,t1,t2,t3,t4,t5,t6,t7,t8)\ | |
130 HS_DTRACE_PROBE_DECL_N(provider,name,(\ | |
131 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,\ | |
132 uintptr_t,uintptr_t)) | |
133 #define HS_DTRACE_PROBE_DECL10(provider,name,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9)\ | |
134 HS_DTRACE_PROBE_DECL_N(provider,name,(\ | |
135 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,\ | |
136 uintptr_t,uintptr_t,uintptr_t)) | |
137 | |
138 /* Dtrace probe definitions */ | |
139 #if defined(SOLARIS) | |
140 // Solaris dtrace uses actual function calls. | |
141 #define HS_DTRACE_PROBE_N(provider,name, args) \ | |
142 DTRACE_ONLY(HS_DTRACE_PROBE_FN(provider,name) args) | |
143 | |
144 #define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name) | |
145 #define HS_DTRACE_PROBE0(provider,name)\ | |
146 HS_DTRACE_PROBE_N(provider,name,()) | |
147 #define HS_DTRACE_PROBE1(provider,name,a0)\ | |
148 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0)) | |
149 #define HS_DTRACE_PROBE2(provider,name,a0,a1)\ | |
150 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1)) | |
151 #define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\ | |
152 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2)) | |
153 #define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\ | |
154 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\ | |
155 (uintptr_t)a3)) | |
156 #define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\ | |
157 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\ | |
158 (uintptr_t)a3,(uintptr_t)a4)) | |
159 #define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\ | |
160 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\ | |
161 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5)) | |
162 #define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\ | |
163 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\ | |
164 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6)) | |
165 #define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\ | |
166 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\ | |
167 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7)) | |
168 #define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\ | |
169 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\ | |
170 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\ | |
171 (uintptr_t)a8)) | |
172 #define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)\ | |
173 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\ | |
174 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\ | |
175 (uintptr_t)a8,(uintptr_t)a9)) | |
176 #else | |
177 // Systemtap dtrace compatible probes on GNU/Linux use direct macros. | |
178 // If dtrace is disabled this macro becomes NULL | |
179 #define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name) | |
180 #define HS_DTRACE_PROBE0(provider,name)\ | |
181 DTRACE_PROBE(provider,name) | |
182 #define HS_DTRACE_PROBE1(provider,name,a0)\ | |
183 DTRACE_PROBE1(provider,name,a0) | |
184 #define HS_DTRACE_PROBE2(provider,name,a0,a1)\ | |
185 DTRACE_PROBE2(provider,name,a0,a1) | |
186 #define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\ | |
187 DTRACE_PROBE3(provider,name,a0,a1,a2) | |
188 #define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\ | |
189 DTRACE_PROBE4(provider,name,a0,a1,a2,a3) | |
190 #define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\ | |
191 DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4) | |
192 #define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\ | |
193 DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5) | |
194 #define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\ | |
195 DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6) | |
196 #define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\ | |
197 DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7) | |
198 #define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\ | |
199 DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8) | |
200 #define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)\ | |
201 DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9) | |
202 #endif | |
203 | |
204 #endif /* !USDT2 */ | |
205 | |
206 #endif // SHARE_VM_UTILITIES_DTRACE_HPP | 64 #endif // SHARE_VM_UTILITIES_DTRACE_HPP |