Mercurial > hg > truffle
annotate src/share/vm/utilities/dtrace.hpp @ 7555:9c6602e65423
Updated .hgignore file to also ignore IntelliJ project files.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 25 Jan 2013 11:11:32 +0100 |
parents | 75982791ddb6 |
children | a3ba776d6ab6 |
rev | line source |
---|---|
0 | 1 /* |
6837
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
2 * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
3 * Copyright (c) 2009, 2012 Red Hat, Inc. |
0 | 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * | |
6 * This code is free software; you can redistribute it and/or modify it | |
7 * under the terms of the GNU General Public License version 2 only, as | |
8 * published by the Free Software Foundation. | |
9 * | |
10 * This code is distributed in the hope that it will be useful, but WITHOUT | |
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 * version 2 for more details (a copy is included in the LICENSE file that | |
14 * accompanied this code). | |
15 * | |
16 * You should have received a copy of the GNU General Public License version | |
17 * 2 along with this work; if not, write to the Free Software Foundation, | |
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
19 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1547
diff
changeset
|
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1547
diff
changeset
|
21 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1547
diff
changeset
|
22 * questions. |
0 | 23 * |
24 */ | |
25 | |
1972 | 26 #ifndef SHARE_VM_UTILITIES_DTRACE_HPP |
27 #define SHARE_VM_UTILITIES_DTRACE_HPP | |
28 | |
4006 | 29 #if defined(DTRACE_ENABLED) |
0 | 30 |
31 #include <sys/sdt.h> | |
32 | |
33 #define DTRACE_ONLY(x) x | |
34 #define NOT_DTRACE(x) | |
35 | |
6837
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
36 #if defined(SOLARIS) |
1547
fb1a39993f69
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
0
diff
changeset
|
37 // Work around dtrace tail call bug 6672627 until it is fixed in solaris 10. |
fb1a39993f69
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
0
diff
changeset
|
38 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \ |
fb1a39993f69
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
0
diff
changeset
|
39 do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0) |
fb1a39993f69
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
0
diff
changeset
|
40 |
6837
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
41 #define USDT1 1 |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
42 #elif defined(LINUX) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
43 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() |
4006 | 44 #define USDT1 1 |
45 #elif defined(__APPLE__) | |
6837
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
46 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() |
4006 | 47 #define USDT2 1 |
48 #include <sys/types.h> | |
49 #include "dtracefiles/hotspot.h" | |
50 #include "dtracefiles/hotspot_jni.h" | |
51 #include "dtracefiles/hs_private.h" | |
52 #else | |
53 #error "dtrace enabled for unknown os" | |
54 #endif /* defined(SOLARIS) */ | |
55 | |
56 #else /* defined(DTRACE_ENABLED) */ | |
0 | 57 |
58 #define DTRACE_ONLY(x) | |
59 #define NOT_DTRACE(x) x | |
60 | |
4006 | 61 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() |
62 | |
63 #ifndef USDT2 | |
64 | |
0 | 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) {;} | |
6837
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
71 #define DTRACE_PROBE6(a,b,c,d,e,f,g,h) {;} |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
72 #define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;} |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
73 #define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;} |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
74 #define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;} |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
75 #define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;} |
0 | 76 |
4006 | 77 #else /* USDT2 */ |
1547
fb1a39993f69
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
0
diff
changeset
|
78 |
4006 | 79 #include "dtrace_usdt2_disabled.hpp" |
80 #endif /* USDT2 */ | |
81 | |
82 #endif /* defined(DTRACE_ENABLED) */ | |
83 | |
84 #ifndef USDT2 | |
0 | 85 |
86 #define HS_DTRACE_PROBE_FN(provider,name)\ | |
87 __dtrace_##provider##___##name | |
88 | |
6837
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
89 #ifdef SOLARIS |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
90 // Solaris dtrace needs actual extern function decls. |
0 | 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) | |
6837
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
95 #else |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
96 // Systemtap dtrace compatible probes on GNU/Linux don't. |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
97 // If dtrace is disabled this macro becomes NULL |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
98 #define HS_DTRACE_PROBE_DECL_N(provider,name,args) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
99 #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
100 #endif |
0 | 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 */ | |
6837
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
139 #if defined(SOLARIS) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
140 // Solaris dtrace uses actual function calls. |
0 | 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)) | |
6837
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
176 #else |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
177 // Systemtap dtrace compatible probes on GNU/Linux use direct macros. |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
178 // If dtrace is disabled this macro becomes NULL |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
179 #define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
180 #define HS_DTRACE_PROBE0(provider,name)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
181 DTRACE_PROBE(provider,name) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
182 #define HS_DTRACE_PROBE1(provider,name,a0)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
183 DTRACE_PROBE1(provider,name,a0) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
184 #define HS_DTRACE_PROBE2(provider,name,a0,a1)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
185 DTRACE_PROBE2(provider,name,a0,a1) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
186 #define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
187 DTRACE_PROBE3(provider,name,a0,a1,a2) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
188 #define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
189 DTRACE_PROBE4(provider,name,a0,a1,a2,a3) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
190 #define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
191 DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
192 #define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
193 DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
194 #define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
195 DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
196 #define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
197 DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
198 #define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
199 DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
200 #define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)\ |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
201 DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9) |
75982791ddb6
7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents:
4006
diff
changeset
|
202 #endif |
1972 | 203 |
4006 | 204 #endif /* !USDT2 */ |
205 | |
1972 | 206 #endif // SHARE_VM_UTILITIES_DTRACE_HPP |