]> sourceware.org Git - systemtap.git/blob - includes/sys/sdt.h
sys/sdt.h: add troubleshooting blurb
[systemtap.git] / includes / sys / sdt.h
1 /* <sys/sdt.h> - Systemtap static probe definition macros.
2 Copyright (C) 2010-2011 Red Hat Inc.
3
4 This file is part of systemtap, and is free software in the public domain.
5 */
6
7 #ifndef _SYS_SDT_H
8 #define _SYS_SDT_H 1
9
10 /*
11 This file defines a family of macros
12
13 STAP_PROBEn(op1, ..., opn)
14
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.
21
22 The operand strings are selected by the compiler for each operand.
23 They are constrained by gcc inline-assembler codes. The default is:
24
25 #define STAP_SDT_ARG_CONSTRAINT nor
26
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:
33
34 #define STAP_SDT_ARG_CONSTRAINT g
35 #include <sys/sdt.h>
36
37 See also:
38 https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
39 https://gcc.gnu.org/onlinedocs/gcc/Constraints.html
40 */
41
42
43
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)
83
84 # define _SDT_ARGFMT(no) %n[_SDT_S##no]@_SDT_ARGTMPL(_SDT_A##no)
85 # ifndef STAP_SDT_ARG_CONSTRAINT
86 # define STAP_SDT_ARG_CONSTRAINT nor
87 # endif
88 # define _SDT_STRINGIFY(x) #x
89 # define _SDT_ARG_CONSTRAINT_STRING(x) _SDT_STRINGIFY(x)
90 # define _SDT_ARG(n, x) \
91 [_SDT_S##n] "n" ((_SDT_ARGSIGNED (x) ? 1 : -1) * (int) _SDT_ARGSIZE (x)), \
92 [_SDT_A##n] _SDT_ARG_CONSTRAINT_STRING (STAP_SDT_ARG_CONSTRAINT) (_SDT_ARGVAL (x))
93 #endif
94 #define _SDT_ASM_STRING(x) _SDT_ASM_STRING_1(x)
95
96 #define _SDT_ARGARRAY(x) (__builtin_classify_type (x) == 14 \
97 || __builtin_classify_type (x) == 5)
98
99 #ifdef __cplusplus
100 # define _SDT_ARGSIGNED(x) (!_SDT_ARGARRAY (x) \
101 && __sdt_type<__typeof (x)>::__sdt_signed)
102 # define _SDT_ARGSIZE(x) (_SDT_ARGARRAY (x) \
103 ? sizeof (void *) : sizeof (x))
104 # define _SDT_ARGVAL(x) (x)
105
106 # include <cstddef>
107
108 template<typename __sdt_T>
109 struct __sdt_type
110 {
111 static const bool __sdt_signed = false;
112 };
113
114 #define __SDT_ALWAYS_SIGNED(T) \
115 template<> struct __sdt_type<T> { static const bool __sdt_signed = true; };
116 #define __SDT_COND_SIGNED(T) \
117 template<> struct __sdt_type<T> { static const bool __sdt_signed = ((T)(-1) < 1); };
118 __SDT_ALWAYS_SIGNED(signed char)
119 __SDT_ALWAYS_SIGNED(short)
120 __SDT_ALWAYS_SIGNED(int)
121 __SDT_ALWAYS_SIGNED(long)
122 __SDT_ALWAYS_SIGNED(long long)
123 __SDT_ALWAYS_SIGNED(volatile signed char)
124 __SDT_ALWAYS_SIGNED(volatile short)
125 __SDT_ALWAYS_SIGNED(volatile int)
126 __SDT_ALWAYS_SIGNED(volatile long)
127 __SDT_ALWAYS_SIGNED(volatile long long)
128 __SDT_ALWAYS_SIGNED(const signed char)
129 __SDT_ALWAYS_SIGNED(const short)
130 __SDT_ALWAYS_SIGNED(const int)
131 __SDT_ALWAYS_SIGNED(const long)
132 __SDT_ALWAYS_SIGNED(const long long)
133 __SDT_ALWAYS_SIGNED(const volatile signed char)
134 __SDT_ALWAYS_SIGNED(const volatile short)
135 __SDT_ALWAYS_SIGNED(const volatile int)
136 __SDT_ALWAYS_SIGNED(const volatile long)
137 __SDT_ALWAYS_SIGNED(const volatile long long)
138 __SDT_COND_SIGNED(char)
139 __SDT_COND_SIGNED(wchar_t)
140 __SDT_COND_SIGNED(volatile char)
141 __SDT_COND_SIGNED(volatile wchar_t)
142 __SDT_COND_SIGNED(const char)
143 __SDT_COND_SIGNED(const wchar_t)
144 __SDT_COND_SIGNED(const volatile char)
145 __SDT_COND_SIGNED(const volatile wchar_t)
146 #if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
147 /* __SDT_COND_SIGNED(char16_t) */
148 /* __SDT_COND_SIGNED(char32_t) */
149 #endif
150
151 template<typename __sdt_E>
152 struct __sdt_type<__sdt_E[]> : public __sdt_type<__sdt_E *> {};
153
154 template<typename __sdt_E, size_t __sdt_N>
155 struct __sdt_type<__sdt_E[__sdt_N]> : public __sdt_type<__sdt_E *> {};
156
157 #elif !defined(__ASSEMBLER__)
158 __extension__ extern unsigned long long __sdt_unsp;
159 # define _SDT_ARGINTTYPE(x) \
160 __typeof (__builtin_choose_expr (((__builtin_classify_type (x) \
161 + 3) & -4) == 4, (x), 0U))
162 # define _SDT_ARGSIGNED(x) \
163 (!__extension__ \
164 (__builtin_constant_p ((((unsigned long long) \
165 (_SDT_ARGINTTYPE (x)) __sdt_unsp) \
166 & ((unsigned long long)1 << (sizeof (unsigned long long) \
167 * __CHAR_BIT__ - 1))) == 0) \
168 || (_SDT_ARGINTTYPE (x)) -1 > (_SDT_ARGINTTYPE (x)) 0))
169 # define _SDT_ARGSIZE(x) \
170 (_SDT_ARGARRAY (x) ? sizeof (void *) : sizeof (x))
171 # define _SDT_ARGVAL(x) (x)
172 #endif
173
174 #if defined __powerpc__ || defined __powerpc64__
175 # define _SDT_ARGTMPL(id) %I[id]%[id]
176 #else
177 # define _SDT_ARGTMPL(id) %[id]
178 #endif
179
180 #ifdef __LP64__
181 # define _SDT_ASM_ADDR .8byte
182 #else
183 # define _SDT_ASM_ADDR .4byte
184 #endif
185
186 /* The ia64 and s390 nop instructions take an argument. */
187 #if defined(__ia64__) || defined(__s390__) || defined(__s390x__)
188 #define _SDT_NOP nop 0
189 #else
190 #define _SDT_NOP nop
191 #endif
192
193 #define _SDT_NOTE_NAME "stapsdt"
194 #define _SDT_NOTE_TYPE 3
195
196 /* If the assembler supports the necessary feature, then we can play
197 nice with code in COMDAT sections, which comes up in C++ code.
198 Without that assembler support, some combinations of probe placements
199 in certain kinds of C++ code may produce link-time errors. */
200 #include "sdt-config.h"
201 #if _SDT_ASM_SECTION_AUTOGROUP_SUPPORT
202 # define _SDT_ASM_AUTOGROUP "?"
203 #else
204 # define _SDT_ASM_AUTOGROUP ""
205 #endif
206
207 #define _SDT_ASM_BODY(provider, name, pack_args, args) \
208 _SDT_ASM_1(990: _SDT_NOP) \
209 _SDT_ASM_3( .pushsection .note.stapsdt,_SDT_ASM_AUTOGROUP,"note") \
210 _SDT_ASM_1( .balign 4) \
211 _SDT_ASM_3( .4byte 992f-991f, 994f-993f, _SDT_NOTE_TYPE) \
212 _SDT_ASM_1(991: .asciz _SDT_NOTE_NAME) \
213 _SDT_ASM_1(992: .balign 4) \
214 _SDT_ASM_1(993: _SDT_ASM_ADDR 990b) \
215 _SDT_ASM_1( _SDT_ASM_ADDR _.stapsdt.base) \
216 _SDT_SEMAPHORE(provider,name) \
217 _SDT_ASM_STRING(provider) \
218 _SDT_ASM_STRING(name) \
219 pack_args args \
220 _SDT_ASM_1(994: .balign 4) \
221 _SDT_ASM_1( .popsection)
222
223 #define _SDT_ASM_BASE \
224 _SDT_ASM_1(.ifndef _.stapsdt.base) \
225 _SDT_ASM_5( .pushsection .stapsdt.base,"aG","progbits", \
226 .stapsdt.base,comdat) \
227 _SDT_ASM_1( .weak _.stapsdt.base) \
228 _SDT_ASM_1( .hidden _.stapsdt.base) \
229 _SDT_ASM_1( _.stapsdt.base: .space 1) \
230 _SDT_ASM_2( .size _.stapsdt.base, 1) \
231 _SDT_ASM_1( .popsection) \
232 _SDT_ASM_1(.endif)
233
234 #if defined _SDT_HAS_SEMAPHORES
235 #define _SDT_SEMAPHORE(p,n) _SDT_ASM_1( _SDT_ASM_ADDR p##_##n##_semaphore)
236 #else
237 #define _SDT_SEMAPHORE(p,n) _SDT_ASM_1( _SDT_ASM_ADDR 0)
238 #endif
239
240 #define _SDT_ASM_TEMPLATE_0 /* no arguments */
241 #define _SDT_ASM_TEMPLATE_1 _SDT_ARGFMT(1)
242 #define _SDT_ASM_TEMPLATE_2 _SDT_ASM_TEMPLATE_1 _SDT_ARGFMT(2)
243 #define _SDT_ASM_TEMPLATE_3 _SDT_ASM_TEMPLATE_2 _SDT_ARGFMT(3)
244 #define _SDT_ASM_TEMPLATE_4 _SDT_ASM_TEMPLATE_3 _SDT_ARGFMT(4)
245 #define _SDT_ASM_TEMPLATE_5 _SDT_ASM_TEMPLATE_4 _SDT_ARGFMT(5)
246 #define _SDT_ASM_TEMPLATE_6 _SDT_ASM_TEMPLATE_5 _SDT_ARGFMT(6)
247 #define _SDT_ASM_TEMPLATE_7 _SDT_ASM_TEMPLATE_6 _SDT_ARGFMT(7)
248 #define _SDT_ASM_TEMPLATE_8 _SDT_ASM_TEMPLATE_7 _SDT_ARGFMT(8)
249 #define _SDT_ASM_TEMPLATE_9 _SDT_ASM_TEMPLATE_8 _SDT_ARGFMT(9)
250 #define _SDT_ASM_TEMPLATE_10 _SDT_ASM_TEMPLATE_9 _SDT_ARGFMT(10)
251 #define _SDT_ASM_TEMPLATE_11 _SDT_ASM_TEMPLATE_10 _SDT_ARGFMT(11)
252 #define _SDT_ASM_TEMPLATE_12 _SDT_ASM_TEMPLATE_11 _SDT_ARGFMT(12)
253 #define _SDT_ASM_OPERANDS_0() [__sdt_dummy] "g" (0)
254 #define _SDT_ASM_OPERANDS_1(arg1) _SDT_ARG(1, arg1)
255 #define _SDT_ASM_OPERANDS_2(arg1, arg2) \
256 _SDT_ASM_OPERANDS_1(arg1), _SDT_ARG(2, arg2)
257 #define _SDT_ASM_OPERANDS_3(arg1, arg2, arg3) \
258 _SDT_ASM_OPERANDS_2(arg1, arg2), _SDT_ARG(3, arg3)
259 #define _SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4) \
260 _SDT_ASM_OPERANDS_3(arg1, arg2, arg3), _SDT_ARG(4, arg4)
261 #define _SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5) \
262 _SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4), _SDT_ARG(5, arg5)
263 #define _SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
264 _SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5), _SDT_ARG(6, arg6)
265 #define _SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
266 _SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6), _SDT_ARG(7, arg7)
267 #define _SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
268 _SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7), \
269 _SDT_ARG(8, arg8)
270 #define _SDT_ASM_OPERANDS_9(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \
271 _SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), \
272 _SDT_ARG(9, arg9)
273 #define _SDT_ASM_OPERANDS_10(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \
274 _SDT_ASM_OPERANDS_9(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), \
275 _SDT_ARG(10, arg10)
276 #define _SDT_ASM_OPERANDS_11(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
277 _SDT_ASM_OPERANDS_10(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10), \
278 _SDT_ARG(11, arg11)
279 #define _SDT_ASM_OPERANDS_12(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \
280 _SDT_ASM_OPERANDS_11(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11), \
281 _SDT_ARG(12, arg12)
282
283 /* These macros can be used in C, C++, or assembly code.
284 In assembly code the arguments should use normal assembly operand syntax. */
285
286 #define STAP_PROBE(provider, name) \
287 _SDT_PROBE(provider, name, 0, ())
288 #define STAP_PROBE1(provider, name, arg1) \
289 _SDT_PROBE(provider, name, 1, (arg1))
290 #define STAP_PROBE2(provider, name, arg1, arg2) \
291 _SDT_PROBE(provider, name, 2, (arg1, arg2))
292 #define STAP_PROBE3(provider, name, arg1, arg2, arg3) \
293 _SDT_PROBE(provider, name, 3, (arg1, arg2, arg3))
294 #define STAP_PROBE4(provider, name, arg1, arg2, arg3, arg4) \
295 _SDT_PROBE(provider, name, 4, (arg1, arg2, arg3, arg4))
296 #define STAP_PROBE5(provider, name, arg1, arg2, arg3, arg4, arg5) \
297 _SDT_PROBE(provider, name, 5, (arg1, arg2, arg3, arg4, arg5))
298 #define STAP_PROBE6(provider, name, arg1, arg2, arg3, arg4, arg5, arg6) \
299 _SDT_PROBE(provider, name, 6, (arg1, arg2, arg3, arg4, arg5, arg6))
300 #define STAP_PROBE7(provider, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
301 _SDT_PROBE(provider, name, 7, (arg1, arg2, arg3, arg4, arg5, arg6, arg7))
302 #define STAP_PROBE8(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \
303 _SDT_PROBE(provider, name, 8, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
304 #define STAP_PROBE9(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)\
305 _SDT_PROBE(provider, name, 9, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9))
306 #define STAP_PROBE10(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \
307 _SDT_PROBE(provider, name, 10, \
308 (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10))
309 #define STAP_PROBE11(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
310 _SDT_PROBE(provider, name, 11, \
311 (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11))
312 #define STAP_PROBE12(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \
313 _SDT_PROBE(provider, name, 12, \
314 (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12))
315
316 /* This STAP_PROBEV macro can be used in variadic scenarios, where the
317 number of probe arguments is not known until compile time. Since
318 variadic macro support may vary with compiler options, you must
319 pre-#define SDT_USE_VARIADIC to enable this type of probe.
320
321 The trick to count __VA_ARGS__ was inspired by this post by
322 Laurent Deniau <laurent.deniau@cern.ch>:
323 http://groups.google.com/group/comp.std.c/msg/346fc464319b1ee5
324
325 Note that our _SDT_NARG is called with an extra 0 arg that's not
326 counted, so we don't have to worry about the behavior of macros
327 called without any arguments. */
328
329 #ifdef SDT_USE_VARIADIC
330 #define _SDT_NARG(...) __SDT_NARG(__VA_ARGS__, 12,11,10,9,8,7,6,5,4,3,2,1,0)
331 #define __SDT_NARG(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, N, ...) N
332 #define _SDT_PROBE_N(provider, name, N, ...) \
333 _SDT_PROBE(provider, name, N, (__VA_ARGS__))
334 #define STAP_PROBEV(provider, name, ...) \
335 _SDT_PROBE_N(provider, name, _SDT_NARG(0, ##__VA_ARGS__), ##__VA_ARGS__)
336 #endif
337
338 /* These macros are for use in asm statements. You must compile
339 with -std=gnu99 or -std=c99 to use the STAP_PROBE_ASM macro.
340
341 The STAP_PROBE_ASM macro generates a quoted string to be used in the
342 template portion of the asm statement, concatenated with strings that
343 contain the actual assembly code around the probe site.
344
345 For example:
346
347 asm ("before\n"
348 STAP_PROBE_ASM(provider, fooprobe, %eax 4(%esi))
349 "after");
350
351 emits the assembly code for "before\nafter", with a probe in between.
352 The probe arguments are the %eax register, and the value of the memory
353 word located 4 bytes past the address in the %esi register. Note that
354 because this is a simple asm, not a GNU C extended asm statement, these
355 % characters do not need to be doubled to generate literal %reg names.
356
357 In a GNU C extended asm statement, the probe arguments can be specified
358 using the macro STAP_PROBE_ASM_TEMPLATE(n) for n arguments. The paired
359 macro STAP_PROBE_ASM_OPERANDS gives the C values of these probe arguments,
360 and appears in the input operand list of the asm statement. For example:
361
362 asm ("someinsn %0,%1\n" // %0 is output operand, %1 is input operand
363 STAP_PROBE_ASM(provider, fooprobe, STAP_PROBE_ASM_TEMPLATE(3))
364 "otherinsn %[namedarg]"
365 : "r" (outvar)
366 : "g" (some_value), [namedarg] "i" (1234),
367 STAP_PROBE_ASM_OPERANDS(3, some_value, some_ptr->field, 1234));
368
369 This is just like writing:
370
371 STAP_PROBE3(provider, fooprobe, some_value, some_ptr->field, 1234));
372
373 but the probe site is right between "someinsn" and "otherinsn".
374
375 The probe arguments in STAP_PROBE_ASM can be given as assembly
376 operands instead, even inside a GNU C extended asm statement.
377 Note that these can use operand templates like %0 or %[name],
378 and likewise they must write %%reg for a literal operand of %reg. */
379
380 #if __STDC_VERSION__ >= 199901L
381 # define STAP_PROBE_ASM(provider, name, ...) \
382 _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING, (__VA_ARGS__)) \
383 _SDT_ASM_BASE
384 # define STAP_PROBE_ASM_OPERANDS(n, ...) _SDT_ASM_OPERANDS_##n(__VA_ARGS__)
385 #else
386 # define STAP_PROBE_ASM(provider, name, args) \
387 _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING, (args)) \
388 _SDT_ASM_BASE
389 #endif
390 #define STAP_PROBE_ASM_TEMPLATE(n) _SDT_ASM_TEMPLATE_##n
391
392
393 /* DTrace compatible macro names. */
394 #define DTRACE_PROBE(provider,probe) \
395 STAP_PROBE(provider,probe)
396 #define DTRACE_PROBE1(provider,probe,parm1) \
397 STAP_PROBE1(provider,probe,parm1)
398 #define DTRACE_PROBE2(provider,probe,parm1,parm2) \
399 STAP_PROBE2(provider,probe,parm1,parm2)
400 #define DTRACE_PROBE3(provider,probe,parm1,parm2,parm3) \
401 STAP_PROBE3(provider,probe,parm1,parm2,parm3)
402 #define DTRACE_PROBE4(provider,probe,parm1,parm2,parm3,parm4) \
403 STAP_PROBE4(provider,probe,parm1,parm2,parm3,parm4)
404 #define DTRACE_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5) \
405 STAP_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5)
406 #define DTRACE_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6) \
407 STAP_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6)
408 #define DTRACE_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \
409 STAP_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7)
410 #define DTRACE_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \
411 STAP_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8)
412 #define DTRACE_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \
413 STAP_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9)
414 #define DTRACE_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \
415 STAP_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10)
416 #define DTRACE_PROBE11(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11) \
417 STAP_PROBE11(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11)
418 #define DTRACE_PROBE12(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11,parm12) \
419 STAP_PROBE12(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11,parm12)
420
421
422 #endif /* sys/sdt.h */
This page took 0.059246 seconds and 6 git commands to generate.