Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/sys
File: sdt.h
/* <sys/sdt.h> - Systemtap static probe definition macros.
[0] Fix | Delete
[1] Fix | Delete
This file is dedicated to the public domain, pursuant to CC0
[2] Fix | Delete
(https://creativecommons.org/publicdomain/zero/1.0/)
[3] Fix | Delete
*/
[4] Fix | Delete
[5] Fix | Delete
#ifndef _SYS_SDT_H
[6] Fix | Delete
#define _SYS_SDT_H 1
[7] Fix | Delete
[8] Fix | Delete
/*
[9] Fix | Delete
This file defines a family of macros
[10] Fix | Delete
[11] Fix | Delete
STAP_PROBEn(op1, ..., opn)
[12] Fix | Delete
[13] Fix | Delete
that emit a nop into the instruction stream, and some data into an auxiliary
[14] Fix | Delete
note section. The data in the note section describes the operands, in terms
[15] Fix | Delete
of size and location. Each location is encoded as assembler operand string.
[16] Fix | Delete
Consumer tools such as gdb or systemtap insert breakpoints on top of
[17] Fix | Delete
the nop, and decode the location operand-strings, like an assembler,
[18] Fix | Delete
to find the values being passed.
[19] Fix | Delete
[20] Fix | Delete
The operand strings are selected by the compiler for each operand.
[21] Fix | Delete
They are constrained by gcc inline-assembler codes. The default is:
[22] Fix | Delete
[23] Fix | Delete
#define STAP_SDT_ARG_CONSTRAINT nor
[24] Fix | Delete
[25] Fix | Delete
This is a good default if the operands tend to be integral and
[26] Fix | Delete
moderate in number (smaller than number of registers). In other
[27] Fix | Delete
cases, the compiler may report "'asm' requires impossible reload" or
[28] Fix | Delete
similar. In this case, consider simplifying the macro call (fewer
[29] Fix | Delete
and simpler operands), reduce optimization, or override the default
[30] Fix | Delete
constraints string via:
[31] Fix | Delete
[32] Fix | Delete
#define STAP_SDT_ARG_CONSTRAINT g
[33] Fix | Delete
#include <sys/sdt.h>
[34] Fix | Delete
[35] Fix | Delete
See also:
[36] Fix | Delete
https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
[37] Fix | Delete
https://gcc.gnu.org/onlinedocs/gcc/Constraints.html
[38] Fix | Delete
*/
[39] Fix | Delete
[40] Fix | Delete
[41] Fix | Delete
[42] Fix | Delete
#ifdef __ASSEMBLER__
[43] Fix | Delete
# define _SDT_PROBE(provider, name, n, arglist) \
[44] Fix | Delete
_SDT_ASM_BODY(provider, name, _SDT_ASM_SUBSTR_1, (_SDT_DEPAREN_##n arglist)) \
[45] Fix | Delete
_SDT_ASM_BASE
[46] Fix | Delete
# define _SDT_ASM_1(x) x;
[47] Fix | Delete
# define _SDT_ASM_2(a, b) a,b;
[48] Fix | Delete
# define _SDT_ASM_3(a, b, c) a,b,c;
[49] Fix | Delete
# define _SDT_ASM_5(a, b, c, d, e) a,b,c,d,e;
[50] Fix | Delete
# define _SDT_ASM_STRING_1(x) .asciz #x;
[51] Fix | Delete
# define _SDT_ASM_SUBSTR_1(x) .ascii #x;
[52] Fix | Delete
# define _SDT_DEPAREN_0() /* empty */
[53] Fix | Delete
# define _SDT_DEPAREN_1(a) a
[54] Fix | Delete
# define _SDT_DEPAREN_2(a,b) a b
[55] Fix | Delete
# define _SDT_DEPAREN_3(a,b,c) a b c
[56] Fix | Delete
# define _SDT_DEPAREN_4(a,b,c,d) a b c d
[57] Fix | Delete
# define _SDT_DEPAREN_5(a,b,c,d,e) a b c d e
[58] Fix | Delete
# define _SDT_DEPAREN_6(a,b,c,d,e,f) a b c d e f
[59] Fix | Delete
# define _SDT_DEPAREN_7(a,b,c,d,e,f,g) a b c d e f g
[60] Fix | Delete
# define _SDT_DEPAREN_8(a,b,c,d,e,f,g,h) a b c d e f g h
[61] Fix | Delete
# define _SDT_DEPAREN_9(a,b,c,d,e,f,g,h,i) a b c d e f g h i
[62] Fix | Delete
# define _SDT_DEPAREN_10(a,b,c,d,e,f,g,h,i,j) a b c d e f g h i j
[63] Fix | Delete
# 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
[64] Fix | Delete
# 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
[65] Fix | Delete
#else
[66] Fix | Delete
#if defined _SDT_HAS_SEMAPHORES
[67] Fix | Delete
#define _SDT_NOTE_SEMAPHORE_USE(provider, name) \
[68] Fix | Delete
__asm__ __volatile__ ("" :: "m" (provider##_##name##_semaphore));
[69] Fix | Delete
#else
[70] Fix | Delete
#define _SDT_NOTE_SEMAPHORE_USE(provider, name)
[71] Fix | Delete
#endif
[72] Fix | Delete
[73] Fix | Delete
# define _SDT_PROBE(provider, name, n, arglist) \
[74] Fix | Delete
do { \
[75] Fix | Delete
_SDT_NOTE_SEMAPHORE_USE(provider, name); \
[76] Fix | Delete
__asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \
[77] Fix | Delete
:: _SDT_ASM_OPERANDS_##n arglist); \
[78] Fix | Delete
__asm__ __volatile__ (_SDT_ASM_BASE); \
[79] Fix | Delete
} while (0)
[80] Fix | Delete
# define _SDT_S(x) #x
[81] Fix | Delete
# define _SDT_ASM_1(x) _SDT_S(x) "\n"
[82] Fix | Delete
# define _SDT_ASM_2(a, b) _SDT_S(a) "," _SDT_S(b) "\n"
[83] Fix | Delete
# define _SDT_ASM_3(a, b, c) _SDT_S(a) "," _SDT_S(b) "," \
[84] Fix | Delete
_SDT_S(c) "\n"
[85] Fix | Delete
# define _SDT_ASM_5(a, b, c, d, e) _SDT_S(a) "," _SDT_S(b) "," \
[86] Fix | Delete
_SDT_S(c) "," _SDT_S(d) "," \
[87] Fix | Delete
_SDT_S(e) "\n"
[88] Fix | Delete
# define _SDT_ASM_ARGS(n) _SDT_ASM_TEMPLATE_##n
[89] Fix | Delete
# define _SDT_ASM_STRING_1(x) _SDT_ASM_1(.asciz #x)
[90] Fix | Delete
# define _SDT_ASM_SUBSTR_1(x) _SDT_ASM_1(.ascii #x)
[91] Fix | Delete
[92] Fix | Delete
# define _SDT_ARGFMT(no) _SDT_ASM_1(_SDT_SIGN %n[_SDT_S##no]) \
[93] Fix | Delete
_SDT_ASM_1(_SDT_SIZE %n[_SDT_S##no]) \
[94] Fix | Delete
_SDT_ASM_1(_SDT_TYPE %n[_SDT_S##no]) \
[95] Fix | Delete
_SDT_ASM_SUBSTR(_SDT_ARGTMPL(_SDT_A##no))
[96] Fix | Delete
[97] Fix | Delete
[98] Fix | Delete
# ifndef STAP_SDT_ARG_CONSTRAINT
[99] Fix | Delete
# if defined __powerpc__
[100] Fix | Delete
# define STAP_SDT_ARG_CONSTRAINT nZr
[101] Fix | Delete
# elif defined __arm__
[102] Fix | Delete
# define STAP_SDT_ARG_CONSTRAINT g
[103] Fix | Delete
# else
[104] Fix | Delete
# define STAP_SDT_ARG_CONSTRAINT nor
[105] Fix | Delete
# endif
[106] Fix | Delete
# endif
[107] Fix | Delete
[108] Fix | Delete
# define _SDT_STRINGIFY(x) #x
[109] Fix | Delete
# define _SDT_ARG_CONSTRAINT_STRING(x) _SDT_STRINGIFY(x)
[110] Fix | Delete
/* _SDT_S encodes the size and type as 0xSSTT which is decoded by the assembler
[111] Fix | Delete
macros _SDT_SIZE and _SDT_TYPE */
[112] Fix | Delete
# define _SDT_ARG(n, x) \
[113] Fix | Delete
[_SDT_S##n] "n" ((_SDT_ARGSIGNED (x) ? (int)-1 : 1) * (-(((int) _SDT_ARGSIZE (x)) << 8) + (-(0x7f & __builtin_classify_type (x))))), \
[114] Fix | Delete
[_SDT_A##n] _SDT_ARG_CONSTRAINT_STRING (STAP_SDT_ARG_CONSTRAINT) (_SDT_ARGVAL (x))
[115] Fix | Delete
#endif
[116] Fix | Delete
#define _SDT_ASM_STRING(x) _SDT_ASM_STRING_1(x)
[117] Fix | Delete
#define _SDT_ASM_SUBSTR(x) _SDT_ASM_SUBSTR_1(x)
[118] Fix | Delete
[119] Fix | Delete
#define _SDT_ARGARRAY(x) (__builtin_classify_type (x) == 14 \
[120] Fix | Delete
|| __builtin_classify_type (x) == 5)
[121] Fix | Delete
[122] Fix | Delete
#ifdef __cplusplus
[123] Fix | Delete
# define _SDT_ARGSIGNED(x) (!_SDT_ARGARRAY (x) \
[124] Fix | Delete
&& __sdt_type<__typeof (x)>::__sdt_signed)
[125] Fix | Delete
# define _SDT_ARGSIZE(x) (_SDT_ARGARRAY (x) \
[126] Fix | Delete
? sizeof (void *) : sizeof (x))
[127] Fix | Delete
# define _SDT_ARGVAL(x) (x)
[128] Fix | Delete
[129] Fix | Delete
# include <cstddef>
[130] Fix | Delete
[131] Fix | Delete
template<typename __sdt_T>
[132] Fix | Delete
struct __sdt_type
[133] Fix | Delete
{
[134] Fix | Delete
static const bool __sdt_signed = false;
[135] Fix | Delete
};
[136] Fix | Delete
[137] Fix | Delete
#define __SDT_ALWAYS_SIGNED(T) \
[138] Fix | Delete
template<> struct __sdt_type<T> { static const bool __sdt_signed = true; };
[139] Fix | Delete
#define __SDT_COND_SIGNED(T,CT) \
[140] Fix | Delete
template<> struct __sdt_type<T> { static const bool __sdt_signed = ((CT)(-1) < 1); };
[141] Fix | Delete
__SDT_ALWAYS_SIGNED(signed char)
[142] Fix | Delete
__SDT_ALWAYS_SIGNED(short)
[143] Fix | Delete
__SDT_ALWAYS_SIGNED(int)
[144] Fix | Delete
__SDT_ALWAYS_SIGNED(long)
[145] Fix | Delete
__SDT_ALWAYS_SIGNED(long long)
[146] Fix | Delete
__SDT_ALWAYS_SIGNED(volatile signed char)
[147] Fix | Delete
__SDT_ALWAYS_SIGNED(volatile short)
[148] Fix | Delete
__SDT_ALWAYS_SIGNED(volatile int)
[149] Fix | Delete
__SDT_ALWAYS_SIGNED(volatile long)
[150] Fix | Delete
__SDT_ALWAYS_SIGNED(volatile long long)
[151] Fix | Delete
__SDT_ALWAYS_SIGNED(const signed char)
[152] Fix | Delete
__SDT_ALWAYS_SIGNED(const short)
[153] Fix | Delete
__SDT_ALWAYS_SIGNED(const int)
[154] Fix | Delete
__SDT_ALWAYS_SIGNED(const long)
[155] Fix | Delete
__SDT_ALWAYS_SIGNED(const long long)
[156] Fix | Delete
__SDT_ALWAYS_SIGNED(const volatile signed char)
[157] Fix | Delete
__SDT_ALWAYS_SIGNED(const volatile short)
[158] Fix | Delete
__SDT_ALWAYS_SIGNED(const volatile int)
[159] Fix | Delete
__SDT_ALWAYS_SIGNED(const volatile long)
[160] Fix | Delete
__SDT_ALWAYS_SIGNED(const volatile long long)
[161] Fix | Delete
__SDT_COND_SIGNED(char, char)
[162] Fix | Delete
__SDT_COND_SIGNED(wchar_t, wchar_t)
[163] Fix | Delete
__SDT_COND_SIGNED(volatile char, char)
[164] Fix | Delete
__SDT_COND_SIGNED(volatile wchar_t, wchar_t)
[165] Fix | Delete
__SDT_COND_SIGNED(const char, char)
[166] Fix | Delete
__SDT_COND_SIGNED(const wchar_t, wchar_t)
[167] Fix | Delete
__SDT_COND_SIGNED(const volatile char, char)
[168] Fix | Delete
__SDT_COND_SIGNED(const volatile wchar_t, wchar_t)
[169] Fix | Delete
#if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
[170] Fix | Delete
/* __SDT_COND_SIGNED(char16_t) */
[171] Fix | Delete
/* __SDT_COND_SIGNED(char32_t) */
[172] Fix | Delete
#endif
[173] Fix | Delete
[174] Fix | Delete
template<typename __sdt_E>
[175] Fix | Delete
struct __sdt_type<__sdt_E[]> : public __sdt_type<__sdt_E *> {};
[176] Fix | Delete
[177] Fix | Delete
template<typename __sdt_E, size_t __sdt_N>
[178] Fix | Delete
struct __sdt_type<__sdt_E[__sdt_N]> : public __sdt_type<__sdt_E *> {};
[179] Fix | Delete
[180] Fix | Delete
#elif !defined(__ASSEMBLER__)
[181] Fix | Delete
__extension__ extern unsigned long long __sdt_unsp;
[182] Fix | Delete
# define _SDT_ARGINTTYPE(x) \
[183] Fix | Delete
__typeof (__builtin_choose_expr (((__builtin_classify_type (x) \
[184] Fix | Delete
+ 3) & -4) == 4, (x), 0U))
[185] Fix | Delete
# define _SDT_ARGSIGNED(x) \
[186] Fix | Delete
(!__extension__ \
[187] Fix | Delete
(__builtin_constant_p ((((unsigned long long) \
[188] Fix | Delete
(_SDT_ARGINTTYPE (x)) __sdt_unsp) \
[189] Fix | Delete
& ((unsigned long long)1 << (sizeof (unsigned long long) \
[190] Fix | Delete
* __CHAR_BIT__ - 1))) == 0) \
[191] Fix | Delete
|| (_SDT_ARGINTTYPE (x)) -1 > (_SDT_ARGINTTYPE (x)) 0))
[192] Fix | Delete
# define _SDT_ARGSIZE(x) \
[193] Fix | Delete
(_SDT_ARGARRAY (x) ? sizeof (void *) : sizeof (x))
[194] Fix | Delete
# define _SDT_ARGVAL(x) (x)
[195] Fix | Delete
#endif
[196] Fix | Delete
[197] Fix | Delete
#if defined __powerpc__ || defined __powerpc64__
[198] Fix | Delete
# define _SDT_ARGTMPL(id) %I[id]%[id]
[199] Fix | Delete
#elif defined __i386__
[200] Fix | Delete
# define _SDT_ARGTMPL(id) %k[id] /* gcc.gnu.org/PR80115 sourceware.org/PR24541 */
[201] Fix | Delete
#else
[202] Fix | Delete
# define _SDT_ARGTMPL(id) %[id]
[203] Fix | Delete
#endif
[204] Fix | Delete
[205] Fix | Delete
/* NB: gdb PR24541 highlighted an unspecified corner of the sdt.h
[206] Fix | Delete
operand note format.
[207] Fix | Delete
[208] Fix | Delete
The named register may be a longer or shorter (!) alias for the
[209] Fix | Delete
storage where the value in question is found. For example, on
[210] Fix | Delete
i386, 64-bit value may be put in register pairs, and the register
[211] Fix | Delete
name stored would identify just one of them. Previously, gcc was
[212] Fix | Delete
asked to emit the %w[id] (16-bit alias of some registers holding
[213] Fix | Delete
operands), even when a wider 32-bit value was used.
[214] Fix | Delete
[215] Fix | Delete
Bottom line: the byte-width given before the @ sign governs. If
[216] Fix | Delete
there is a mismatch between that width and that of the named
[217] Fix | Delete
register, then a sys/sdt.h note consumer may need to employ
[218] Fix | Delete
architecture-specific heuristics to figure out where the compiler
[219] Fix | Delete
has actually put the complete value.
[220] Fix | Delete
*/
[221] Fix | Delete
[222] Fix | Delete
#ifdef __LP64__
[223] Fix | Delete
# define _SDT_ASM_ADDR .8byte
[224] Fix | Delete
#else
[225] Fix | Delete
# define _SDT_ASM_ADDR .4byte
[226] Fix | Delete
#endif
[227] Fix | Delete
[228] Fix | Delete
/* The ia64 and s390 nop instructions take an argument. */
[229] Fix | Delete
#if defined(__ia64__) || defined(__s390__) || defined(__s390x__)
[230] Fix | Delete
#define _SDT_NOP nop 0
[231] Fix | Delete
#else
[232] Fix | Delete
#define _SDT_NOP nop
[233] Fix | Delete
#endif
[234] Fix | Delete
[235] Fix | Delete
#define _SDT_NOTE_NAME "stapsdt"
[236] Fix | Delete
#define _SDT_NOTE_TYPE 3
[237] Fix | Delete
[238] Fix | Delete
/* If the assembler supports the necessary feature, then we can play
[239] Fix | Delete
nice with code in COMDAT sections, which comes up in C++ code.
[240] Fix | Delete
Without that assembler support, some combinations of probe placements
[241] Fix | Delete
in certain kinds of C++ code may produce link-time errors. */
[242] Fix | Delete
#include "sdt-config.h"
[243] Fix | Delete
#if _SDT_ASM_SECTION_AUTOGROUP_SUPPORT
[244] Fix | Delete
# define _SDT_ASM_AUTOGROUP "?"
[245] Fix | Delete
#else
[246] Fix | Delete
# define _SDT_ASM_AUTOGROUP ""
[247] Fix | Delete
#endif
[248] Fix | Delete
[249] Fix | Delete
#define _SDT_DEF_MACROS \
[250] Fix | Delete
_SDT_ASM_1(.altmacro) \
[251] Fix | Delete
_SDT_ASM_1(.macro _SDT_SIGN x) \
[252] Fix | Delete
_SDT_ASM_1(.iflt \\x) \
[253] Fix | Delete
_SDT_ASM_1(.ascii "-") \
[254] Fix | Delete
_SDT_ASM_1(.endif) \
[255] Fix | Delete
_SDT_ASM_1(.endm) \
[256] Fix | Delete
_SDT_ASM_1(.macro _SDT_SIZE_ x) \
[257] Fix | Delete
_SDT_ASM_1(.ascii "\x") \
[258] Fix | Delete
_SDT_ASM_1(.endm) \
[259] Fix | Delete
_SDT_ASM_1(.macro _SDT_SIZE x) \
[260] Fix | Delete
_SDT_ASM_1(_SDT_SIZE_ %%((-(-\\x*((-\\x>0)-(-\\x<0))))>>8)) \
[261] Fix | Delete
_SDT_ASM_1(.endm) \
[262] Fix | Delete
_SDT_ASM_1(.macro _SDT_TYPE_ x) \
[263] Fix | Delete
_SDT_ASM_2(.ifc 8,\\x) \
[264] Fix | Delete
_SDT_ASM_1(.ascii "f") \
[265] Fix | Delete
_SDT_ASM_1(.endif) \
[266] Fix | Delete
_SDT_ASM_1(.ascii "@") \
[267] Fix | Delete
_SDT_ASM_1(.endm) \
[268] Fix | Delete
_SDT_ASM_1(.macro _SDT_TYPE x) \
[269] Fix | Delete
_SDT_ASM_1(_SDT_TYPE_ %%((\\x)&(0xff))) \
[270] Fix | Delete
_SDT_ASM_1(.endm)
[271] Fix | Delete
[272] Fix | Delete
#define _SDT_UNDEF_MACROS \
[273] Fix | Delete
_SDT_ASM_1(.purgem _SDT_SIGN) \
[274] Fix | Delete
_SDT_ASM_1(.purgem _SDT_SIZE_) \
[275] Fix | Delete
_SDT_ASM_1(.purgem _SDT_SIZE) \
[276] Fix | Delete
_SDT_ASM_1(.purgem _SDT_TYPE_) \
[277] Fix | Delete
_SDT_ASM_1(.purgem _SDT_TYPE)
[278] Fix | Delete
[279] Fix | Delete
#define _SDT_ASM_BODY(provider, name, pack_args, args, ...) \
[280] Fix | Delete
_SDT_DEF_MACROS \
[281] Fix | Delete
_SDT_ASM_1(990: _SDT_NOP) \
[282] Fix | Delete
_SDT_ASM_3( .pushsection .note.stapsdt,_SDT_ASM_AUTOGROUP,"note") \
[283] Fix | Delete
_SDT_ASM_1( .balign 4) \
[284] Fix | Delete
_SDT_ASM_3( .4byte 992f-991f, 994f-993f, _SDT_NOTE_TYPE) \
[285] Fix | Delete
_SDT_ASM_1(991: .asciz _SDT_NOTE_NAME) \
[286] Fix | Delete
_SDT_ASM_1(992: .balign 4) \
[287] Fix | Delete
_SDT_ASM_1(993: _SDT_ASM_ADDR 990b) \
[288] Fix | Delete
_SDT_ASM_1( _SDT_ASM_ADDR _.stapsdt.base) \
[289] Fix | Delete
_SDT_SEMAPHORE(provider,name) \
[290] Fix | Delete
_SDT_ASM_STRING(provider) \
[291] Fix | Delete
_SDT_ASM_STRING(name) \
[292] Fix | Delete
pack_args args \
[293] Fix | Delete
_SDT_ASM_SUBSTR(\x00) \
[294] Fix | Delete
_SDT_UNDEF_MACROS \
[295] Fix | Delete
_SDT_ASM_1(994: .balign 4) \
[296] Fix | Delete
_SDT_ASM_1( .popsection)
[297] Fix | Delete
[298] Fix | Delete
#define _SDT_ASM_BASE \
[299] Fix | Delete
_SDT_ASM_1(.ifndef _.stapsdt.base) \
[300] Fix | Delete
_SDT_ASM_5( .pushsection .stapsdt.base,"aG","progbits", \
[301] Fix | Delete
.stapsdt.base,comdat) \
[302] Fix | Delete
_SDT_ASM_1( .weak _.stapsdt.base) \
[303] Fix | Delete
_SDT_ASM_1( .hidden _.stapsdt.base) \
[304] Fix | Delete
_SDT_ASM_1( _.stapsdt.base: .space 1) \
[305] Fix | Delete
_SDT_ASM_2( .size _.stapsdt.base, 1) \
[306] Fix | Delete
_SDT_ASM_1( .popsection) \
[307] Fix | Delete
_SDT_ASM_1(.endif)
[308] Fix | Delete
[309] Fix | Delete
#if defined _SDT_HAS_SEMAPHORES
[310] Fix | Delete
#define _SDT_SEMAPHORE(p,n) \
[311] Fix | Delete
_SDT_ASM_1( _SDT_ASM_ADDR p##_##n##_semaphore)
[312] Fix | Delete
#else
[313] Fix | Delete
#define _SDT_SEMAPHORE(p,n) _SDT_ASM_1( _SDT_ASM_ADDR 0)
[314] Fix | Delete
#endif
[315] Fix | Delete
[316] Fix | Delete
#define _SDT_ASM_BLANK _SDT_ASM_SUBSTR(\x20)
[317] Fix | Delete
#define _SDT_ASM_TEMPLATE_0 /* no arguments */
[318] Fix | Delete
#define _SDT_ASM_TEMPLATE_1 _SDT_ARGFMT(1)
[319] Fix | Delete
#define _SDT_ASM_TEMPLATE_2 _SDT_ASM_TEMPLATE_1 _SDT_ASM_BLANK _SDT_ARGFMT(2)
[320] Fix | Delete
#define _SDT_ASM_TEMPLATE_3 _SDT_ASM_TEMPLATE_2 _SDT_ASM_BLANK _SDT_ARGFMT(3)
[321] Fix | Delete
#define _SDT_ASM_TEMPLATE_4 _SDT_ASM_TEMPLATE_3 _SDT_ASM_BLANK _SDT_ARGFMT(4)
[322] Fix | Delete
#define _SDT_ASM_TEMPLATE_5 _SDT_ASM_TEMPLATE_4 _SDT_ASM_BLANK _SDT_ARGFMT(5)
[323] Fix | Delete
#define _SDT_ASM_TEMPLATE_6 _SDT_ASM_TEMPLATE_5 _SDT_ASM_BLANK _SDT_ARGFMT(6)
[324] Fix | Delete
#define _SDT_ASM_TEMPLATE_7 _SDT_ASM_TEMPLATE_6 _SDT_ASM_BLANK _SDT_ARGFMT(7)
[325] Fix | Delete
#define _SDT_ASM_TEMPLATE_8 _SDT_ASM_TEMPLATE_7 _SDT_ASM_BLANK _SDT_ARGFMT(8)
[326] Fix | Delete
#define _SDT_ASM_TEMPLATE_9 _SDT_ASM_TEMPLATE_8 _SDT_ASM_BLANK _SDT_ARGFMT(9)
[327] Fix | Delete
#define _SDT_ASM_TEMPLATE_10 _SDT_ASM_TEMPLATE_9 _SDT_ASM_BLANK _SDT_ARGFMT(10)
[328] Fix | Delete
#define _SDT_ASM_TEMPLATE_11 _SDT_ASM_TEMPLATE_10 _SDT_ASM_BLANK _SDT_ARGFMT(11)
[329] Fix | Delete
#define _SDT_ASM_TEMPLATE_12 _SDT_ASM_TEMPLATE_11 _SDT_ASM_BLANK _SDT_ARGFMT(12)
[330] Fix | Delete
#define _SDT_ASM_OPERANDS_0() [__sdt_dummy] "g" (0)
[331] Fix | Delete
#define _SDT_ASM_OPERANDS_1(arg1) _SDT_ARG(1, arg1)
[332] Fix | Delete
#define _SDT_ASM_OPERANDS_2(arg1, arg2) \
[333] Fix | Delete
_SDT_ASM_OPERANDS_1(arg1), _SDT_ARG(2, arg2)
[334] Fix | Delete
#define _SDT_ASM_OPERANDS_3(arg1, arg2, arg3) \
[335] Fix | Delete
_SDT_ASM_OPERANDS_2(arg1, arg2), _SDT_ARG(3, arg3)
[336] Fix | Delete
#define _SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4) \
[337] Fix | Delete
_SDT_ASM_OPERANDS_3(arg1, arg2, arg3), _SDT_ARG(4, arg4)
[338] Fix | Delete
#define _SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5) \
[339] Fix | Delete
_SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4), _SDT_ARG(5, arg5)
[340] Fix | Delete
#define _SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
[341] Fix | Delete
_SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5), _SDT_ARG(6, arg6)
[342] Fix | Delete
#define _SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
[343] Fix | Delete
_SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6), _SDT_ARG(7, arg7)
[344] Fix | Delete
#define _SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
[345] Fix | Delete
_SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7), \
[346] Fix | Delete
_SDT_ARG(8, arg8)
[347] Fix | Delete
#define _SDT_ASM_OPERANDS_9(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \
[348] Fix | Delete
_SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), \
[349] Fix | Delete
_SDT_ARG(9, arg9)
[350] Fix | Delete
#define _SDT_ASM_OPERANDS_10(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \
[351] Fix | Delete
_SDT_ASM_OPERANDS_9(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), \
[352] Fix | Delete
_SDT_ARG(10, arg10)
[353] Fix | Delete
#define _SDT_ASM_OPERANDS_11(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
[354] Fix | Delete
_SDT_ASM_OPERANDS_10(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10), \
[355] Fix | Delete
_SDT_ARG(11, arg11)
[356] Fix | Delete
#define _SDT_ASM_OPERANDS_12(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \
[357] Fix | Delete
_SDT_ASM_OPERANDS_11(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11), \
[358] Fix | Delete
_SDT_ARG(12, arg12)
[359] Fix | Delete
[360] Fix | Delete
/* These macros can be used in C, C++, or assembly code.
[361] Fix | Delete
In assembly code the arguments should use normal assembly operand syntax. */
[362] Fix | Delete
[363] Fix | Delete
#define STAP_PROBE(provider, name) \
[364] Fix | Delete
_SDT_PROBE(provider, name, 0, ())
[365] Fix | Delete
#define STAP_PROBE1(provider, name, arg1) \
[366] Fix | Delete
_SDT_PROBE(provider, name, 1, (arg1))
[367] Fix | Delete
#define STAP_PROBE2(provider, name, arg1, arg2) \
[368] Fix | Delete
_SDT_PROBE(provider, name, 2, (arg1, arg2))
[369] Fix | Delete
#define STAP_PROBE3(provider, name, arg1, arg2, arg3) \
[370] Fix | Delete
_SDT_PROBE(provider, name, 3, (arg1, arg2, arg3))
[371] Fix | Delete
#define STAP_PROBE4(provider, name, arg1, arg2, arg3, arg4) \
[372] Fix | Delete
_SDT_PROBE(provider, name, 4, (arg1, arg2, arg3, arg4))
[373] Fix | Delete
#define STAP_PROBE5(provider, name, arg1, arg2, arg3, arg4, arg5) \
[374] Fix | Delete
_SDT_PROBE(provider, name, 5, (arg1, arg2, arg3, arg4, arg5))
[375] Fix | Delete
#define STAP_PROBE6(provider, name, arg1, arg2, arg3, arg4, arg5, arg6) \
[376] Fix | Delete
_SDT_PROBE(provider, name, 6, (arg1, arg2, arg3, arg4, arg5, arg6))
[377] Fix | Delete
#define STAP_PROBE7(provider, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
[378] Fix | Delete
_SDT_PROBE(provider, name, 7, (arg1, arg2, arg3, arg4, arg5, arg6, arg7))
[379] Fix | Delete
#define STAP_PROBE8(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \
[380] Fix | Delete
_SDT_PROBE(provider, name, 8, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
[381] Fix | Delete
#define STAP_PROBE9(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)\
[382] Fix | Delete
_SDT_PROBE(provider, name, 9, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9))
[383] Fix | Delete
#define STAP_PROBE10(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \
[384] Fix | Delete
_SDT_PROBE(provider, name, 10, \
[385] Fix | Delete
(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10))
[386] Fix | Delete
#define STAP_PROBE11(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
[387] Fix | Delete
_SDT_PROBE(provider, name, 11, \
[388] Fix | Delete
(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11))
[389] Fix | Delete
#define STAP_PROBE12(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \
[390] Fix | Delete
_SDT_PROBE(provider, name, 12, \
[391] Fix | Delete
(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12))
[392] Fix | Delete
[393] Fix | Delete
/* This STAP_PROBEV macro can be used in variadic scenarios, where the
[394] Fix | Delete
number of probe arguments is not known until compile time. Since
[395] Fix | Delete
variadic macro support may vary with compiler options, you must
[396] Fix | Delete
pre-#define SDT_USE_VARIADIC to enable this type of probe.
[397] Fix | Delete
[398] Fix | Delete
The trick to count __VA_ARGS__ was inspired by this post by
[399] Fix | Delete
Laurent Deniau <laurent.deniau@cern.ch>:
[400] Fix | Delete
http://groups.google.com/group/comp.std.c/msg/346fc464319b1ee5
[401] Fix | Delete
[402] Fix | Delete
Note that our _SDT_NARG is called with an extra 0 arg that's not
[403] Fix | Delete
counted, so we don't have to worry about the behavior of macros
[404] Fix | Delete
called without any arguments. */
[405] Fix | Delete
[406] Fix | Delete
#define _SDT_NARG(...) __SDT_NARG(__VA_ARGS__, 12,11,10,9,8,7,6,5,4,3,2,1,0)
[407] Fix | Delete
#define __SDT_NARG(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, N, ...) N
[408] Fix | Delete
#ifdef SDT_USE_VARIADIC
[409] Fix | Delete
#define _SDT_PROBE_N(provider, name, N, ...) \
[410] Fix | Delete
_SDT_PROBE(provider, name, N, (__VA_ARGS__))
[411] Fix | Delete
#define STAP_PROBEV(provider, name, ...) \
[412] Fix | Delete
_SDT_PROBE_N(provider, name, _SDT_NARG(0, ##__VA_ARGS__), ##__VA_ARGS__)
[413] Fix | Delete
#endif
[414] Fix | Delete
[415] Fix | Delete
/* These macros are for use in asm statements. You must compile
[416] Fix | Delete
with -std=gnu99 or -std=c99 to use the STAP_PROBE_ASM macro.
[417] Fix | Delete
[418] Fix | Delete
The STAP_PROBE_ASM macro generates a quoted string to be used in the
[419] Fix | Delete
template portion of the asm statement, concatenated with strings that
[420] Fix | Delete
contain the actual assembly code around the probe site.
[421] Fix | Delete
[422] Fix | Delete
For example:
[423] Fix | Delete
[424] Fix | Delete
asm ("before\n"
[425] Fix | Delete
STAP_PROBE_ASM(provider, fooprobe, %eax 4(%esi))
[426] Fix | Delete
"after");
[427] Fix | Delete
[428] Fix | Delete
emits the assembly code for "before\nafter", with a probe in between.
[429] Fix | Delete
The probe arguments are the %eax register, and the value of the memory
[430] Fix | Delete
word located 4 bytes past the address in the %esi register. Note that
[431] Fix | Delete
because this is a simple asm, not a GNU C extended asm statement, these
[432] Fix | Delete
% characters do not need to be doubled to generate literal %reg names.
[433] Fix | Delete
[434] Fix | Delete
In a GNU C extended asm statement, the probe arguments can be specified
[435] Fix | Delete
using the macro STAP_PROBE_ASM_TEMPLATE(n) for n arguments. The paired
[436] Fix | Delete
macro STAP_PROBE_ASM_OPERANDS gives the C values of these probe arguments,
[437] Fix | Delete
and appears in the input operand list of the asm statement. For example:
[438] Fix | Delete
[439] Fix | Delete
asm ("someinsn %0,%1\n" // %0 is output operand, %1 is input operand
[440] Fix | Delete
STAP_PROBE_ASM(provider, fooprobe, STAP_PROBE_ASM_TEMPLATE(3))
[441] Fix | Delete
"otherinsn %[namedarg]"
[442] Fix | Delete
: "r" (outvar)
[443] Fix | Delete
: "g" (some_value), [namedarg] "i" (1234),
[444] Fix | Delete
STAP_PROBE_ASM_OPERANDS(3, some_value, some_ptr->field, 1234));
[445] Fix | Delete
[446] Fix | Delete
This is just like writing:
[447] Fix | Delete
[448] Fix | Delete
STAP_PROBE3(provider, fooprobe, some_value, some_ptr->field, 1234));
[449] Fix | Delete
[450] Fix | Delete
but the probe site is right between "someinsn" and "otherinsn".
[451] Fix | Delete
[452] Fix | Delete
The probe arguments in STAP_PROBE_ASM can be given as assembly
[453] Fix | Delete
operands instead, even inside a GNU C extended asm statement.
[454] Fix | Delete
Note that these can use operand templates like %0 or %[name],
[455] Fix | Delete
and likewise they must write %%reg for a literal operand of %reg. */
[456] Fix | Delete
[457] Fix | Delete
#define _SDT_ASM_BODY_1(p,n,...) _SDT_ASM_BODY(p,n,_SDT_ASM_SUBSTR,(__VA_ARGS__))
[458] Fix | Delete
#define _SDT_ASM_BODY_2(p,n,...) _SDT_ASM_BODY(p,n,/*_SDT_ASM_STRING */,__VA_ARGS__)
[459] Fix | Delete
#define _SDT_ASM_BODY_N2(p,n,no,...) _SDT_ASM_BODY_ ## no(p,n,__VA_ARGS__)
[460] Fix | Delete
#define _SDT_ASM_BODY_N1(p,n,no,...) _SDT_ASM_BODY_N2(p,n,no,__VA_ARGS__)
[461] Fix | Delete
#define _SDT_ASM_BODY_N(p,n,...) _SDT_ASM_BODY_N1(p,n,_SDT_NARG(0, __VA_ARGS__),__VA_ARGS__)
[462] Fix | Delete
[463] Fix | Delete
#if __STDC_VERSION__ >= 199901L
[464] Fix | Delete
# define STAP_PROBE_ASM(provider, name, ...) \
[465] Fix | Delete
_SDT_ASM_BODY_N(provider, name, __VA_ARGS__) \
[466] Fix | Delete
_SDT_ASM_BASE
[467] Fix | Delete
# define STAP_PROBE_ASM_OPERANDS(n, ...) _SDT_ASM_OPERANDS_##n(__VA_ARGS__)
[468] Fix | Delete
#else
[469] Fix | Delete
# define STAP_PROBE_ASM(provider, name, args) \
[470] Fix | Delete
_SDT_ASM_BODY(provider, name, /* _SDT_ASM_STRING */, (args)) \
[471] Fix | Delete
_SDT_ASM_BASE
[472] Fix | Delete
#endif
[473] Fix | Delete
#define STAP_PROBE_ASM_TEMPLATE(n) _SDT_ASM_TEMPLATE_##n,"use _SDT_ASM_TEMPLATE_"
[474] Fix | Delete
[475] Fix | Delete
[476] Fix | Delete
/* DTrace compatible macro names. */
[477] Fix | Delete
#define DTRACE_PROBE(provider,probe) \
[478] Fix | Delete
STAP_PROBE(provider,probe)
[479] Fix | Delete
#define DTRACE_PROBE1(provider,probe,parm1) \
[480] Fix | Delete
STAP_PROBE1(provider,probe,parm1)
[481] Fix | Delete
#define DTRACE_PROBE2(provider,probe,parm1,parm2) \
[482] Fix | Delete
STAP_PROBE2(provider,probe,parm1,parm2)
[483] Fix | Delete
#define DTRACE_PROBE3(provider,probe,parm1,parm2,parm3) \
[484] Fix | Delete
STAP_PROBE3(provider,probe,parm1,parm2,parm3)
[485] Fix | Delete
#define DTRACE_PROBE4(provider,probe,parm1,parm2,parm3,parm4) \
[486] Fix | Delete
STAP_PROBE4(provider,probe,parm1,parm2,parm3,parm4)
[487] Fix | Delete
#define DTRACE_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5) \
[488] Fix | Delete
STAP_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5)
[489] Fix | Delete
#define DTRACE_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6) \
[490] Fix | Delete
STAP_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6)
[491] Fix | Delete
#define DTRACE_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \
[492] Fix | Delete
STAP_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7)
[493] Fix | Delete
#define DTRACE_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \
[494] Fix | Delete
STAP_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8)
[495] Fix | Delete
#define DTRACE_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \
[496] Fix | Delete
STAP_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9)
[497] Fix | Delete
#define DTRACE_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \
[498] Fix | Delete
STAP_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10)
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function