Lines Matching +full:c +full:- +full:define +full:- +full:name
1 /* <sys/sdt.h> - Systemtap static probe definition macros.
8 #define _SYS_SDT_H 1
19 the nop, and decode the location operand-strings, like an assembler,
23 They are constrained by gcc inline-assembler codes. The default is:
25 #define STAP_SDT_ARG_CONSTRAINT nor
34 #define STAP_SDT_ARG_CONSTRAINT g
45 # define _SDT_PROBE(provider, name, n, arglist) \ argument
46 _SDT_ASM_BODY(provider, name, _SDT_ASM_SUBSTR_1, (_SDT_DEPAREN_##n arglist)) \
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; argument
51 # define _SDT_ASM_5(a, b, c, d, e) a,b,c,d,e; argument
52 # define _SDT_ASM_STRING_1(x) .asciz #x;
53 # define _SDT_ASM_SUBSTR_1(x) .ascii #x;
54 # define _SDT_DEPAREN_0() /* empty */
55 # define _SDT_DEPAREN_1(a) a
56 # define _SDT_DEPAREN_2(a,b) a b
57 # define _SDT_DEPAREN_3(a,b,c) a b c argument
58 # define _SDT_DEPAREN_4(a,b,c,d) a b c d argument
59 # define _SDT_DEPAREN_5(a,b,c,d,e) a b c d e argument
60 # define _SDT_DEPAREN_6(a,b,c,d,e,f) a b c d e f argument
61 # define _SDT_DEPAREN_7(a,b,c,d,e,f,g) a b c d e f g argument
62 # define _SDT_DEPAREN_8(a,b,c,d,e,f,g,h) a b c d e f g h argument
63 # define _SDT_DEPAREN_9(a,b,c,d,e,f,g,h,i) a b c d e f g h i argument
64 # define _SDT_DEPAREN_10(a,b,c,d,e,f,g,h,i,j) a b c d e f g h i j argument
65 # 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 argument
66 # 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 argument
69 #define _SDT_NOTE_SEMAPHORE_USE(provider, name) \ argument
70 __asm__ __volatile__ ("" :: "m" (provider##_##name##_semaphore));
72 #define _SDT_NOTE_SEMAPHORE_USE(provider, name) argument
75 # define _SDT_PROBE(provider, name, n, arglist) \ argument
77 _SDT_NOTE_SEMAPHORE_USE(provider, name); \
78 __asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \
82 # define _SDT_S(x) #x
83 # define _SDT_ASM_1(x) _SDT_S(x) "\n"
84 # define _SDT_ASM_2(a, b) _SDT_S(a) "," _SDT_S(b) "\n"
85 # define _SDT_ASM_3(a, b, c) _SDT_S(a) "," _SDT_S(b) "," \ argument
86 _SDT_S(c) "\n"
87 # define _SDT_ASM_5(a, b, c, d, e) _SDT_S(a) "," _SDT_S(b) "," \ argument
88 _SDT_S(c) "," _SDT_S(d) "," \
90 # define _SDT_ASM_ARGS(n) _SDT_ASM_TEMPLATE_##n
91 # define _SDT_ASM_STRING_1(x) _SDT_ASM_1(.asciz #x)
92 # define _SDT_ASM_SUBSTR_1(x) _SDT_ASM_1(.ascii #x)
94 # define _SDT_ARGFMT(no) _SDT_ASM_1(_SDT_SIGN %n[_SDT_S##no]) \
102 # define STAP_SDT_ARG_CONSTRAINT nZr
104 # define STAP_SDT_ARG_CONSTRAINT g
106 # define STAP_SDT_ARG_CONSTRAINT nor
110 # define _SDT_STRINGIFY(x) #x
111 # define _SDT_ARG_CONSTRAINT_STRING(x) _SDT_STRINGIFY(x)
114 # define _SDT_ARG(n, x) \
115 …[_SDT_S##n] "n" ((_SDT_ARGSIGNED (x) ? (int)-1 : 1) * (-(((int) _SDT_ARGSIZE (x)) << 8) + (-(0x7f …
118 #define _SDT_ASM_STRING(x) _SDT_ASM_STRING_1(x)
119 #define _SDT_ASM_SUBSTR(x) _SDT_ASM_SUBSTR_1(x)
121 #define _SDT_ARGARRAY(x) (__builtin_classify_type (x) == 14 \
125 # define _SDT_ARGSIGNED(x) (!_SDT_ARGARRAY (x) \
127 # define _SDT_ARGSIZE(x) (_SDT_ARGARRAY (x) \
129 # define _SDT_ARGVAL(x) (x)
139 #define __SDT_ALWAYS_SIGNED(T) \
141 #define __SDT_COND_SIGNED(T,CT) \
142 template<> struct __sdt_type<T> { static const bool __sdt_signed = ((CT)(-1) < 1); };
184 # define _SDT_ARGINTTYPE(x) \
186 + 3) & -4) == 4, (x), 0U))
187 # define _SDT_ARGSIGNED(x) \
192 * __CHAR_BIT__ - 1))) == 0) \
193 || (_SDT_ARGINTTYPE (x)) -1 > (_SDT_ARGINTTYPE (x)) 0))
194 # define _SDT_ARGSIZE(x) \
196 # define _SDT_ARGVAL(x) (x)
200 # define _SDT_ARGTMPL(id) %I[id]%[id]
202 # define _SDT_ARGTMPL(id) %k[id] /* gcc.gnu.org/PR80115 sourceware.org/PR24541 */
204 # define _SDT_ARGTMPL(id) %[id]
212 i386, 64-bit value may be put in register pairs, and the register
213 name stored would identify just one of them. Previously, gcc was
214 asked to emit the %w[id] (16-bit alias of some registers holding
215 operands), even when a wider 32-bit value was used.
217 Bottom line: the byte-width given before the @ sign governs. If
220 architecture-specific heuristics to figure out where the compiler
225 # define _SDT_ASM_ADDR .8byte
227 # define _SDT_ASM_ADDR .4byte
232 #define _SDT_NOP nop 0
234 #define _SDT_NOP nop
237 #define _SDT_NOTE_NAME "stapsdt"
238 #define _SDT_NOTE_TYPE 3
241 nice with code in COMDAT sections, which comes up in C++ code.
243 in certain kinds of C++ code may produce link-time errors. */
244 #include "sdt-config.h"
246 # define _SDT_ASM_AUTOGROUP "?"
248 # define _SDT_ASM_AUTOGROUP ""
251 #define _SDT_DEF_MACROS \
256 _SDT_ASM_1(.ascii "-") \
266 _SDT_ASM_1(_SDT_SIZE_ %%((-(-\\x*((-\\x>0)-(-\\x<0))))>>8)) \
280 #define _SDT_UNDEF_MACROS \
287 #define _SDT_ASM_BODY(provider, name, pack_args, args, ...) \
292 _SDT_ASM_3( .4byte 992f-991f, 994f-993f, _SDT_NOTE_TYPE) \
297 _SDT_SEMAPHORE(provider,name) \
299 _SDT_ASM_STRING(name) \
306 #define _SDT_ASM_BASE \
318 #define _SDT_SEMAPHORE(p,n) \
321 #define _SDT_SEMAPHORE(p,n) _SDT_ASM_1( _SDT_ASM_ADDR 0)
324 #define _SDT_ASM_BLANK _SDT_ASM_SUBSTR(\x20)
325 #define _SDT_ASM_TEMPLATE_0 /* no arguments */
326 #define _SDT_ASM_TEMPLATE_1 _SDT_ARGFMT(1)
327 #define _SDT_ASM_TEMPLATE_2 _SDT_ASM_TEMPLATE_1 _SDT_ASM_BLANK _SDT_ARGFMT(2)
328 #define _SDT_ASM_TEMPLATE_3 _SDT_ASM_TEMPLATE_2 _SDT_ASM_BLANK _SDT_ARGFMT(3)
329 #define _SDT_ASM_TEMPLATE_4 _SDT_ASM_TEMPLATE_3 _SDT_ASM_BLANK _SDT_ARGFMT(4)
330 #define _SDT_ASM_TEMPLATE_5 _SDT_ASM_TEMPLATE_4 _SDT_ASM_BLANK _SDT_ARGFMT(5)
331 #define _SDT_ASM_TEMPLATE_6 _SDT_ASM_TEMPLATE_5 _SDT_ASM_BLANK _SDT_ARGFMT(6)
332 #define _SDT_ASM_TEMPLATE_7 _SDT_ASM_TEMPLATE_6 _SDT_ASM_BLANK _SDT_ARGFMT(7)
333 #define _SDT_ASM_TEMPLATE_8 _SDT_ASM_TEMPLATE_7 _SDT_ASM_BLANK _SDT_ARGFMT(8)
334 #define _SDT_ASM_TEMPLATE_9 _SDT_ASM_TEMPLATE_8 _SDT_ASM_BLANK _SDT_ARGFMT(9)
335 #define _SDT_ASM_TEMPLATE_10 _SDT_ASM_TEMPLATE_9 _SDT_ASM_BLANK _SDT_ARGFMT(10)
336 #define _SDT_ASM_TEMPLATE_11 _SDT_ASM_TEMPLATE_10 _SDT_ASM_BLANK _SDT_ARGFMT(11)
337 #define _SDT_ASM_TEMPLATE_12 _SDT_ASM_TEMPLATE_11 _SDT_ASM_BLANK _SDT_ARGFMT(12)
338 #define _SDT_ASM_OPERANDS_0() [__sdt_dummy] "g" (0)
339 #define _SDT_ASM_OPERANDS_1(arg1) _SDT_ARG(1, arg1)
340 #define _SDT_ASM_OPERANDS_2(arg1, arg2) \
342 #define _SDT_ASM_OPERANDS_3(arg1, arg2, arg3) \
344 #define _SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4) \
346 #define _SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5) \
348 #define _SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
350 #define _SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
352 #define _SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
355 #define _SDT_ASM_OPERANDS_9(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \
358 #define _SDT_ASM_OPERANDS_10(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \
361 #define _SDT_ASM_OPERANDS_11(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
364 #define _SDT_ASM_OPERANDS_12(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \
368 /* These macros can be used in C, C++, or assembly code.
371 #define STAP_PROBE(provider, name) \
372 _SDT_PROBE(provider, name, 0, ())
373 #define STAP_PROBE1(provider, name, arg1) \
374 _SDT_PROBE(provider, name, 1, (arg1))
375 #define STAP_PROBE2(provider, name, arg1, arg2) \
376 _SDT_PROBE(provider, name, 2, (arg1, arg2))
377 #define STAP_PROBE3(provider, name, arg1, arg2, arg3) \
378 _SDT_PROBE(provider, name, 3, (arg1, arg2, arg3))
379 #define STAP_PROBE4(provider, name, arg1, arg2, arg3, arg4) \
380 _SDT_PROBE(provider, name, 4, (arg1, arg2, arg3, arg4))
381 #define STAP_PROBE5(provider, name, arg1, arg2, arg3, arg4, arg5) \
382 _SDT_PROBE(provider, name, 5, (arg1, arg2, arg3, arg4, arg5))
383 #define STAP_PROBE6(provider, name, arg1, arg2, arg3, arg4, arg5, arg6) \
384 _SDT_PROBE(provider, name, 6, (arg1, arg2, arg3, arg4, arg5, arg6))
385 #define STAP_PROBE7(provider, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
386 _SDT_PROBE(provider, name, 7, (arg1, arg2, arg3, arg4, arg5, arg6, arg7))
387 #define STAP_PROBE8(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \
388 _SDT_PROBE(provider, name, 8, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
389 #define STAP_PROBE9(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)\
390 _SDT_PROBE(provider, name, 9, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9))
391 #define STAP_PROBE10(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \
392 _SDT_PROBE(provider, name, 10, \
394 #define STAP_PROBE11(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
395 _SDT_PROBE(provider, name, 11, \
397 #define STAP_PROBE12(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \
398 _SDT_PROBE(provider, name, 12, \
404 pre-#define SDT_USE_VARIADIC to enable this type of probe.
408 http://groups.google.com/group/comp.std.c/msg/346fc464319b1ee5
414 #define _SDT_NARG(...) __SDT_NARG(__VA_ARGS__, 12,11,10,9,8,7,6,5,4,3,2,1,0)
415 #define __SDT_NARG(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, N, ...) N
417 #define _SDT_PROBE_N(provider, name, N, ...) \
418 _SDT_PROBE(provider, name, N, (__VA_ARGS__))
419 #define STAP_PROBEV(provider, name, ...) \
420 _SDT_PROBE_N(provider, name, _SDT_NARG(0, ##__VA_ARGS__), ##__VA_ARGS__)
424 with -std=gnu99 or -std=c99 to use the STAP_PROBE_ASM macro.
439 because this is a simple asm, not a GNU C extended asm statement, these
442 In a GNU C extended asm statement, the probe arguments can be specified
444 macro STAP_PROBE_ASM_OPERANDS gives the C values of these probe arguments,
452 STAP_PROBE_ASM_OPERANDS(3, some_value, some_ptr->field, 1234));
456 STAP_PROBE3(provider, fooprobe, some_value, some_ptr->field, 1234));
461 operands instead, even inside a GNU C extended asm statement.
462 Note that these can use operand templates like %0 or %[name],
465 #define _SDT_ASM_BODY_1(p,n,...) _SDT_ASM_BODY(p,n,_SDT_ASM_SUBSTR,(__VA_ARGS__))
466 #define _SDT_ASM_BODY_2(p,n,...) _SDT_ASM_BODY(p,n,/*_SDT_ASM_STRING */,__VA_ARGS__)
467 #define _SDT_ASM_BODY_N2(p,n,no,...) _SDT_ASM_BODY_ ## no(p,n,__VA_ARGS__)
468 #define _SDT_ASM_BODY_N1(p,n,no,...) _SDT_ASM_BODY_N2(p,n,no,__VA_ARGS__)
469 #define _SDT_ASM_BODY_N(p,n,...) _SDT_ASM_BODY_N1(p,n,_SDT_NARG(0, __VA_ARGS__),__VA_ARGS__)
472 # define STAP_PROBE_ASM(provider, name, ...) \
473 _SDT_ASM_BODY_N(provider, name, __VA_ARGS__) \
475 # define STAP_PROBE_ASM_OPERANDS(n, ...) _SDT_ASM_OPERANDS_##n(__VA_ARGS__)
477 # define STAP_PROBE_ASM(provider, name, args) \
478 _SDT_ASM_BODY(provider, name, /* _SDT_ASM_STRING */, (args)) \
481 #define STAP_PROBE_ASM_TEMPLATE(n) _SDT_ASM_TEMPLATE_##n,"use _SDT_ASM_TEMPLATE_"
485 #define DTRACE_PROBE(provider,probe) \
487 #define DTRACE_PROBE1(provider,probe,parm1) \
489 #define DTRACE_PROBE2(provider,probe,parm1,parm2) \
491 #define DTRACE_PROBE3(provider,probe,parm1,parm2,parm3) \
493 #define DTRACE_PROBE4(provider,probe,parm1,parm2,parm3,parm4) \
495 #define DTRACE_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5) \
497 #define DTRACE_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6) \
499 #define DTRACE_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \
501 #define DTRACE_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \
503 #define DTRACE_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \
505 #define DTRACE_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10)…
507 #define DTRACE_PROBE11(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,…
509 #define DTRACE_PROBE12(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,…