archrelease: copy trunk to extra-x86_64
[arch-packages.git] / glibc / trunk / sdt.h
blobc0c5a492cb9cd03f26a03c4ea16aaf31a9dd6e4d
1 /* <sys/sdt.h> - Systemtap static probe definition macros.
3 This file is dedicated to the public domain, pursuant to CC0
4 (https://creativecommons.org/publicdomain/zero/1.0/)
5 */
7 #ifndef _SYS_SDT_H
8 #define _SYS_SDT_H 1
11 This file defines a family of macros
13 STAP_PROBEn(op1, ..., opn)
15 that emit a nop into the instruction stream, and some data into an auxiliary
16 note section. The data in the note section describes the operands, in terms
17 of size and location. Each location is encoded as assembler operand string.
18 Consumer tools such as gdb or systemtap insert breakpoints on top of
19 the nop, and decode the location operand-strings, like an assembler,
20 to find the values being passed.
22 The operand strings are selected by the compiler for each operand.
23 They are constrained by gcc inline-assembler codes. The default is:
25 #define STAP_SDT_ARG_CONSTRAINT nor
27 This is a good default if the operands tend to be integral and
28 moderate in number (smaller than number of registers). In other
29 cases, the compiler may report "'asm' requires impossible reload" or
30 similar. In this case, consider simplifying the macro call (fewer
31 and simpler operands), reduce optimization, or override the default
32 constraints string via:
34 #define STAP_SDT_ARG_CONSTRAINT g
35 #include <sys/sdt.h>
37 See also:
38 https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
39 https://gcc.gnu.org/onlinedocs/gcc/Constraints.html
44 #ifdef __ASSEMBLER__
45 # define _SDT_PROBE(provider, name, n, arglist) \
46 _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING_1, (_SDT_DEPAREN_##n arglist)) \
47 _SDT_ASM_BASE
48 # define _SDT_ASM_1(x) x;
49 # define _SDT_ASM_2(a, b) a,b;
50 # define _SDT_ASM_3(a, b, c) a,b,c;
51 # define _SDT_ASM_5(a, b, c, d, e) a,b,c,d,e;
52 # define _SDT_ASM_STRING_1(x) .asciz #x;
53 # define _SDT_DEPAREN_0() /* empty */
54 # define _SDT_DEPAREN_1(a) a
55 # define _SDT_DEPAREN_2(a,b) a b
56 # define _SDT_DEPAREN_3(a,b,c) a b c
57 # define _SDT_DEPAREN_4(a,b,c,d) a b c d
58 # define _SDT_DEPAREN_5(a,b,c,d,e) a b c d e
59 # define _SDT_DEPAREN_6(a,b,c,d,e,f) a b c d e f
60 # define _SDT_DEPAREN_7(a,b,c,d,e,f,g) a b c d e f g
61 # define _SDT_DEPAREN_8(a,b,c,d,e,f,g,h) a b c d e f g h
62 # define _SDT_DEPAREN_9(a,b,c,d,e,f,g,h,i) a b c d e f g h i
63 # define _SDT_DEPAREN_10(a,b,c,d,e,f,g,h,i,j) a b c d e f g h i j
64 # define _SDT_DEPAREN_11(a,b,c,d,e,f,g,h,i,j,k) a b c d e f g h i j k
65 # define _SDT_DEPAREN_12(a,b,c,d,e,f,g,h,i,j,k,l) a b c d e f g h i j k l
66 #else
67 # define _SDT_PROBE(provider, name, n, arglist) \
68 do { \
69 __asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \
70 :: _SDT_ASM_OPERANDS_##n arglist); \
71 __asm__ __volatile__ (_SDT_ASM_BASE); \
72 } while (0)
73 # define _SDT_S(x) #x
74 # define _SDT_ASM_1(x) _SDT_S(x) "\n"
75 # define _SDT_ASM_2(a, b) _SDT_S(a) "," _SDT_S(b) "\n"
76 # define _SDT_ASM_3(a, b, c) _SDT_S(a) "," _SDT_S(b) "," \
77 _SDT_S(c) "\n"
78 # define _SDT_ASM_5(a, b, c, d, e) _SDT_S(a) "," _SDT_S(b) "," \
79 _SDT_S(c) "," _SDT_S(d) "," \
80 _SDT_S(e) "\n"
81 # define _SDT_ASM_ARGS(n) _SDT_ASM_STRING(_SDT_ASM_TEMPLATE_##n)
82 # define _SDT_ASM_STRING_1(x) _SDT_ASM_1(.asciz #x)
84 # define _SDT_ARGFMT(no) %n[_SDT_S##no]@_SDT_ARGTMPL(_SDT_A##no)
86 # ifndef STAP_SDT_ARG_CONSTRAINT
87 # if defined __powerpc__
88 # define STAP_SDT_ARG_CONSTRAINT nZr
89 # else
90 # define STAP_SDT_ARG_CONSTRAINT nor
91 # endif
92 # endif
94 # define _SDT_STRINGIFY(x) #x
95 # define _SDT_ARG_CONSTRAINT_STRING(x) _SDT_STRINGIFY(x)
96 # define _SDT_ARG(n, x) \
97 [_SDT_S##n] "n" ((_SDT_ARGSIGNED (x) ? 1 : -1) * (int) _SDT_ARGSIZE (x)), \
98 [_SDT_A##n] _SDT_ARG_CONSTRAINT_STRING (STAP_SDT_ARG_CONSTRAINT) (_SDT_ARGVAL (x))
99 #endif
100 #define _SDT_ASM_STRING(x) _SDT_ASM_STRING_1(x)
102 #define _SDT_ARGARRAY(x) (__builtin_classify_type (x) == 14 \
103 || __builtin_classify_type (x) == 5)
105 #ifdef __cplusplus
106 # define _SDT_ARGSIGNED(x) (!_SDT_ARGARRAY (x) \
107 && __sdt_type<__typeof (x)>::__sdt_signed)
108 # define _SDT_ARGSIZE(x) (_SDT_ARGARRAY (x) \
109 ? sizeof (void *) : sizeof (x))
110 # define _SDT_ARGVAL(x) (x)
112 # include <cstddef>
114 template<typename __sdt_T>
115 struct __sdt_type
117 static const bool __sdt_signed = false;
120 #define __SDT_ALWAYS_SIGNED(T) \
121 template<> struct __sdt_type<T> { static const bool __sdt_signed = true; };
122 #define __SDT_COND_SIGNED(T,CT) \
123 template<> struct __sdt_type<T> { static const bool __sdt_signed = ((CT)(-1) < 1); };
124 __SDT_ALWAYS_SIGNED(signed char)
125 __SDT_ALWAYS_SIGNED(short)
126 __SDT_ALWAYS_SIGNED(int)
127 __SDT_ALWAYS_SIGNED(long)
128 __SDT_ALWAYS_SIGNED(long long)
129 __SDT_ALWAYS_SIGNED(volatile signed char)
130 __SDT_ALWAYS_SIGNED(volatile short)
131 __SDT_ALWAYS_SIGNED(volatile int)
132 __SDT_ALWAYS_SIGNED(volatile long)
133 __SDT_ALWAYS_SIGNED(volatile long long)
134 __SDT_ALWAYS_SIGNED(const signed char)
135 __SDT_ALWAYS_SIGNED(const short)
136 __SDT_ALWAYS_SIGNED(const int)
137 __SDT_ALWAYS_SIGNED(const long)
138 __SDT_ALWAYS_SIGNED(const long long)
139 __SDT_ALWAYS_SIGNED(const volatile signed char)
140 __SDT_ALWAYS_SIGNED(const volatile short)
141 __SDT_ALWAYS_SIGNED(const volatile int)
142 __SDT_ALWAYS_SIGNED(const volatile long)
143 __SDT_ALWAYS_SIGNED(const volatile long long)
144 __SDT_COND_SIGNED(char, char)
145 __SDT_COND_SIGNED(wchar_t, wchar_t)
146 __SDT_COND_SIGNED(volatile char, char)
147 __SDT_COND_SIGNED(volatile wchar_t, wchar_t)
148 __SDT_COND_SIGNED(const char, char)
149 __SDT_COND_SIGNED(const wchar_t, wchar_t)
150 __SDT_COND_SIGNED(const volatile char, char)
151 __SDT_COND_SIGNED(const volatile wchar_t, wchar_t)
152 #if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
153 /* __SDT_COND_SIGNED(char16_t) */
154 /* __SDT_COND_SIGNED(char32_t) */
155 #endif
157 template<typename __sdt_E>
158 struct __sdt_type<__sdt_E[]> : public __sdt_type<__sdt_E *> {};
160 template<typename __sdt_E, size_t __sdt_N>
161 struct __sdt_type<__sdt_E[__sdt_N]> : public __sdt_type<__sdt_E *> {};
163 #elif !defined(__ASSEMBLER__)
164 __extension__ extern unsigned long long __sdt_unsp;
165 # define _SDT_ARGINTTYPE(x) \
166 __typeof (__builtin_choose_expr (((__builtin_classify_type (x) \
167 + 3) & -4) == 4, (x), 0U))
168 # define _SDT_ARGSIGNED(x) \
169 (!__extension__ \
170 (__builtin_constant_p ((((unsigned long long) \
171 (_SDT_ARGINTTYPE (x)) __sdt_unsp) \
172 & ((unsigned long long)1 << (sizeof (unsigned long long) \
173 * __CHAR_BIT__ - 1))) == 0) \
174 || (_SDT_ARGINTTYPE (x)) -1 > (_SDT_ARGINTTYPE (x)) 0))
175 # define _SDT_ARGSIZE(x) \
176 (_SDT_ARGARRAY (x) ? sizeof (void *) : sizeof (x))
177 # define _SDT_ARGVAL(x) (x)
178 #endif
180 #if defined __powerpc__ || defined __powerpc64__
181 # define _SDT_ARGTMPL(id) %I[id]%[id]
182 #elif defined __i386__
183 # define _SDT_ARGTMPL(id) %w[id] /* gcc.gnu.org/PR80115 */
184 #else
185 # define _SDT_ARGTMPL(id) %[id]
186 #endif
188 #ifdef __LP64__
189 # define _SDT_ASM_ADDR .8byte
190 #else
191 # define _SDT_ASM_ADDR .4byte
192 #endif
194 /* The ia64 and s390 nop instructions take an argument. */
195 #if defined(__ia64__) || defined(__s390__) || defined(__s390x__)
196 #define _SDT_NOP nop 0
197 #else
198 #define _SDT_NOP nop
199 #endif
201 #define _SDT_NOTE_NAME "stapsdt"
202 #define _SDT_NOTE_TYPE 3
204 /* If the assembler supports the necessary feature, then we can play
205 nice with code in COMDAT sections, which comes up in C++ code.
206 Without that assembler support, some combinations of probe placements
207 in certain kinds of C++ code may produce link-time errors. */
208 #include "sdt-config.h"
209 #if _SDT_ASM_SECTION_AUTOGROUP_SUPPORT
210 # define _SDT_ASM_AUTOGROUP "?"
211 #else
212 # define _SDT_ASM_AUTOGROUP ""
213 #endif
215 #define _SDT_ASM_BODY(provider, name, pack_args, args) \
216 _SDT_ASM_1(990: _SDT_NOP) \
217 _SDT_ASM_3( .pushsection .note.stapsdt,_SDT_ASM_AUTOGROUP,"note") \
218 _SDT_ASM_1( .balign 4) \
219 _SDT_ASM_3( .4byte 992f-991f, 994f-993f, _SDT_NOTE_TYPE) \
220 _SDT_ASM_1(991: .asciz _SDT_NOTE_NAME) \
221 _SDT_ASM_1(992: .balign 4) \
222 _SDT_ASM_1(993: _SDT_ASM_ADDR 990b) \
223 _SDT_ASM_1( _SDT_ASM_ADDR _.stapsdt.base) \
224 _SDT_SEMAPHORE(provider,name) \
225 _SDT_ASM_STRING(provider) \
226 _SDT_ASM_STRING(name) \
227 pack_args args \
228 _SDT_ASM_1(994: .balign 4) \
229 _SDT_ASM_1( .popsection)
231 #define _SDT_ASM_BASE \
232 _SDT_ASM_1(.ifndef _.stapsdt.base) \
233 _SDT_ASM_5( .pushsection .stapsdt.base,"aG","progbits", \
234 .stapsdt.base,comdat) \
235 _SDT_ASM_1( .weak _.stapsdt.base) \
236 _SDT_ASM_1( .hidden _.stapsdt.base) \
237 _SDT_ASM_1( _.stapsdt.base: .space 1) \
238 _SDT_ASM_2( .size _.stapsdt.base, 1) \
239 _SDT_ASM_1( .popsection) \
240 _SDT_ASM_1(.endif)
242 #if defined _SDT_HAS_SEMAPHORES
243 #define _SDT_SEMAPHORE(p,n) _SDT_ASM_1( _SDT_ASM_ADDR p##_##n##_semaphore)
244 #else
245 #define _SDT_SEMAPHORE(p,n) _SDT_ASM_1( _SDT_ASM_ADDR 0)
246 #endif
248 #define _SDT_ASM_TEMPLATE_0 /* no arguments */
249 #define _SDT_ASM_TEMPLATE_1 _SDT_ARGFMT(1)
250 #define _SDT_ASM_TEMPLATE_2 _SDT_ASM_TEMPLATE_1 _SDT_ARGFMT(2)
251 #define _SDT_ASM_TEMPLATE_3 _SDT_ASM_TEMPLATE_2 _SDT_ARGFMT(3)
252 #define _SDT_ASM_TEMPLATE_4 _SDT_ASM_TEMPLATE_3 _SDT_ARGFMT(4)
253 #define _SDT_ASM_TEMPLATE_5 _SDT_ASM_TEMPLATE_4 _SDT_ARGFMT(5)
254 #define _SDT_ASM_TEMPLATE_6 _SDT_ASM_TEMPLATE_5 _SDT_ARGFMT(6)
255 #define _SDT_ASM_TEMPLATE_7 _SDT_ASM_TEMPLATE_6 _SDT_ARGFMT(7)
256 #define _SDT_ASM_TEMPLATE_8 _SDT_ASM_TEMPLATE_7 _SDT_ARGFMT(8)
257 #define _SDT_ASM_TEMPLATE_9 _SDT_ASM_TEMPLATE_8 _SDT_ARGFMT(9)
258 #define _SDT_ASM_TEMPLATE_10 _SDT_ASM_TEMPLATE_9 _SDT_ARGFMT(10)
259 #define _SDT_ASM_TEMPLATE_11 _SDT_ASM_TEMPLATE_10 _SDT_ARGFMT(11)
260 #define _SDT_ASM_TEMPLATE_12 _SDT_ASM_TEMPLATE_11 _SDT_ARGFMT(12)
261 #define _SDT_ASM_OPERANDS_0() [__sdt_dummy] "g" (0)
262 #define _SDT_ASM_OPERANDS_1(arg1) _SDT_ARG(1, arg1)
263 #define _SDT_ASM_OPERANDS_2(arg1, arg2) \
264 _SDT_ASM_OPERANDS_1(arg1), _SDT_ARG(2, arg2)
265 #define _SDT_ASM_OPERANDS_3(arg1, arg2, arg3) \
266 _SDT_ASM_OPERANDS_2(arg1, arg2), _SDT_ARG(3, arg3)
267 #define _SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4) \
268 _SDT_ASM_OPERANDS_3(arg1, arg2, arg3), _SDT_ARG(4, arg4)
269 #define _SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5) \
270 _SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4), _SDT_ARG(5, arg5)
271 #define _SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
272 _SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5), _SDT_ARG(6, arg6)
273 #define _SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
274 _SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6), _SDT_ARG(7, arg7)
275 #define _SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
276 _SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7), \
277 _SDT_ARG(8, arg8)
278 #define _SDT_ASM_OPERANDS_9(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \
279 _SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), \
280 _SDT_ARG(9, arg9)
281 #define _SDT_ASM_OPERANDS_10(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \
282 _SDT_ASM_OPERANDS_9(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), \
283 _SDT_ARG(10, arg10)
284 #define _SDT_ASM_OPERANDS_11(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
285 _SDT_ASM_OPERANDS_10(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10), \
286 _SDT_ARG(11, arg11)
287 #define _SDT_ASM_OPERANDS_12(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \
288 _SDT_ASM_OPERANDS_11(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11), \
289 _SDT_ARG(12, arg12)
291 /* These macros can be used in C, C++, or assembly code.
292 In assembly code the arguments should use normal assembly operand syntax. */
294 #define STAP_PROBE(provider, name) \
295 _SDT_PROBE(provider, name, 0, ())
296 #define STAP_PROBE1(provider, name, arg1) \
297 _SDT_PROBE(provider, name, 1, (arg1))
298 #define STAP_PROBE2(provider, name, arg1, arg2) \
299 _SDT_PROBE(provider, name, 2, (arg1, arg2))
300 #define STAP_PROBE3(provider, name, arg1, arg2, arg3) \
301 _SDT_PROBE(provider, name, 3, (arg1, arg2, arg3))
302 #define STAP_PROBE4(provider, name, arg1, arg2, arg3, arg4) \
303 _SDT_PROBE(provider, name, 4, (arg1, arg2, arg3, arg4))
304 #define STAP_PROBE5(provider, name, arg1, arg2, arg3, arg4, arg5) \
305 _SDT_PROBE(provider, name, 5, (arg1, arg2, arg3, arg4, arg5))
306 #define STAP_PROBE6(provider, name, arg1, arg2, arg3, arg4, arg5, arg6) \
307 _SDT_PROBE(provider, name, 6, (arg1, arg2, arg3, arg4, arg5, arg6))
308 #define STAP_PROBE7(provider, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
309 _SDT_PROBE(provider, name, 7, (arg1, arg2, arg3, arg4, arg5, arg6, arg7))
310 #define STAP_PROBE8(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \
311 _SDT_PROBE(provider, name, 8, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
312 #define STAP_PROBE9(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)\
313 _SDT_PROBE(provider, name, 9, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9))
314 #define STAP_PROBE10(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \
315 _SDT_PROBE(provider, name, 10, \
316 (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10))
317 #define STAP_PROBE11(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
318 _SDT_PROBE(provider, name, 11, \
319 (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11))
320 #define STAP_PROBE12(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \
321 _SDT_PROBE(provider, name, 12, \
322 (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12))
324 /* This STAP_PROBEV macro can be used in variadic scenarios, where the
325 number of probe arguments is not known until compile time. Since
326 variadic macro support may vary with compiler options, you must
327 pre-#define SDT_USE_VARIADIC to enable this type of probe.
329 The trick to count __VA_ARGS__ was inspired by this post by
330 Laurent Deniau <laurent.deniau@cern.ch>:
331 http://groups.google.com/group/comp.std.c/msg/346fc464319b1ee5
333 Note that our _SDT_NARG is called with an extra 0 arg that's not
334 counted, so we don't have to worry about the behavior of macros
335 called without any arguments. */
337 #ifdef SDT_USE_VARIADIC
338 #define _SDT_NARG(...) __SDT_NARG(__VA_ARGS__, 12,11,10,9,8,7,6,5,4,3,2,1,0)
339 #define __SDT_NARG(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, N, ...) N
340 #define _SDT_PROBE_N(provider, name, N, ...) \
341 _SDT_PROBE(provider, name, N, (__VA_ARGS__))
342 #define STAP_PROBEV(provider, name, ...) \
343 _SDT_PROBE_N(provider, name, _SDT_NARG(0, ##__VA_ARGS__), ##__VA_ARGS__)
344 #endif
346 /* These macros are for use in asm statements. You must compile
347 with -std=gnu99 or -std=c99 to use the STAP_PROBE_ASM macro.
349 The STAP_PROBE_ASM macro generates a quoted string to be used in the
350 template portion of the asm statement, concatenated with strings that
351 contain the actual assembly code around the probe site.
353 For example:
355 asm ("before\n"
356 STAP_PROBE_ASM(provider, fooprobe, %eax 4(%esi))
357 "after");
359 emits the assembly code for "before\nafter", with a probe in between.
360 The probe arguments are the %eax register, and the value of the memory
361 word located 4 bytes past the address in the %esi register. Note that
362 because this is a simple asm, not a GNU C extended asm statement, these
363 % characters do not need to be doubled to generate literal %reg names.
365 In a GNU C extended asm statement, the probe arguments can be specified
366 using the macro STAP_PROBE_ASM_TEMPLATE(n) for n arguments. The paired
367 macro STAP_PROBE_ASM_OPERANDS gives the C values of these probe arguments,
368 and appears in the input operand list of the asm statement. For example:
370 asm ("someinsn %0,%1\n" // %0 is output operand, %1 is input operand
371 STAP_PROBE_ASM(provider, fooprobe, STAP_PROBE_ASM_TEMPLATE(3))
372 "otherinsn %[namedarg]"
373 : "r" (outvar)
374 : "g" (some_value), [namedarg] "i" (1234),
375 STAP_PROBE_ASM_OPERANDS(3, some_value, some_ptr->field, 1234));
377 This is just like writing:
379 STAP_PROBE3(provider, fooprobe, some_value, some_ptr->field, 1234));
381 but the probe site is right between "someinsn" and "otherinsn".
383 The probe arguments in STAP_PROBE_ASM can be given as assembly
384 operands instead, even inside a GNU C extended asm statement.
385 Note that these can use operand templates like %0 or %[name],
386 and likewise they must write %%reg for a literal operand of %reg. */
388 #if __STDC_VERSION__ >= 199901L
389 # define STAP_PROBE_ASM(provider, name, ...) \
390 _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING, (__VA_ARGS__)) \
391 _SDT_ASM_BASE
392 # define STAP_PROBE_ASM_OPERANDS(n, ...) _SDT_ASM_OPERANDS_##n(__VA_ARGS__)
393 #else
394 # define STAP_PROBE_ASM(provider, name, args) \
395 _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING, (args)) \
396 _SDT_ASM_BASE
397 #endif
398 #define STAP_PROBE_ASM_TEMPLATE(n) _SDT_ASM_TEMPLATE_##n
401 /* DTrace compatible macro names. */
402 #define DTRACE_PROBE(provider,probe) \
403 STAP_PROBE(provider,probe)
404 #define DTRACE_PROBE1(provider,probe,parm1) \
405 STAP_PROBE1(provider,probe,parm1)
406 #define DTRACE_PROBE2(provider,probe,parm1,parm2) \
407 STAP_PROBE2(provider,probe,parm1,parm2)
408 #define DTRACE_PROBE3(provider,probe,parm1,parm2,parm3) \
409 STAP_PROBE3(provider,probe,parm1,parm2,parm3)
410 #define DTRACE_PROBE4(provider,probe,parm1,parm2,parm3,parm4) \
411 STAP_PROBE4(provider,probe,parm1,parm2,parm3,parm4)
412 #define DTRACE_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5) \
413 STAP_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5)
414 #define DTRACE_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6) \
415 STAP_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6)
416 #define DTRACE_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \
417 STAP_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7)
418 #define DTRACE_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \
419 STAP_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8)
420 #define DTRACE_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \
421 STAP_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9)
422 #define DTRACE_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \
423 STAP_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10)
424 #define DTRACE_PROBE11(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11) \
425 STAP_PROBE11(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11)
426 #define DTRACE_PROBE12(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11,parm12) \
427 STAP_PROBE12(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11,parm12)
430 #endif /* sys/sdt.h */