€•Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ/translations/zh_CN/bpf/btf”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/zh_TW/bpf/btf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/it_IT/bpf/btf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/ja_JP/bpf/btf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/ko_KR/bpf/btf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/pt_BR/bpf/btf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/sp_SP/bpf/btf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒBPF Type Format (BTF)”h]”hŒBPF Type Format (BTF)”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ5/var/lib/git/docbuild/linux/Documentation/bpf/btf.rst”h´Kubh¶)�”}”(hhh]”(h»)�”}”(hŒ1. Introduction”h]”hŒ1. Introduction”…”�”}”(hhÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhhËh²hh³hÊh´KubhŒ paragraph”“”)�”}”(hXBTF (BPF Type Format) is the metadata format which encodes the debug info related to BPF program/map. The name BTF was used initially to describe data types. The BTF was later extended to include function info for defined subroutines, and line info for source/line information.”h]”hXBTF (BPF Type Format) is the metadata format which encodes the debug info related to BPF program/map. The name BTF was used initially to describe data types. The BTF was later extended to include function info for defined subroutines, and line info for source/line information.”…”�”}”(hhÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhhËh²hubhÝ)�”}”(hŒðThe debug info is used for map pretty print, function signature, etc. The function signature enables better bpf program/function kernel symbol. The line info helps generate source annotated translated byte code, jited code and verifier log.”h]”hŒðThe debug info is used for map pretty print, function signature, etc. The function signature enables better bpf program/function kernel symbol. The line info helps generate source annotated translated byte code, jited code and verifier log.”…”�”}”(hhìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K hhËh²hubhŒdefinition_list”“”)�”}”(hhh]”hŒdefinition_list_item”“”)�”}”(hŒQThe BTF specification contains two parts, * BTF kernel API * BTF ELF file format ”h]”(hŒterm”“”)�”}”(hŒ)The BTF specification contains two parts,”h]”hŒ)The BTF specification contains two parts,”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KhjubhŒ definition”“”)�”}”(hhh]”hŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒBTF kernel API”h]”hÝ)�”}”(hj#h]”hŒBTF kernel API”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj )�”}”(hŒBTF ELF file format ”h]”hÝ)�”}”(hŒBTF ELF file format”h]”hŒBTF ELF file format”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj8ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1jh³hÊh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´Khhüubah}”(h]”h ]”h"]”h$]”h&]”uh1húhhËh²hh³Nh´NubhÝ)�”}”(hŒÀThe kernel API is the contract between user space and kernel. The kernel verifies the BTF info before using it. The ELF file format is a user space contract between ELF file and libbpf loader.”h]”hŒÀThe kernel API is the contract between user space and kernel. The kernel verifies the BTF info before using it. The ELF file format is a user space contract between ELF file and libbpf loader.”…”�”}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhhËh²hubhÝ)�”}”(hŒÓThe type and string sections are part of the BTF kernel API, describing the debug info (mostly types related) referenced by the bpf program. These two sections are discussed in details in :ref:`BTF_Type_String`.”h]”(hŒ¼The type and string sections are part of the BTF kernel API, describing the debug info (mostly types related) referenced by the bpf program. These two sections are discussed in details in ”…”�”}”(hjxh²hh³Nh´Nubh)�”}”(hŒ:ref:`BTF_Type_String`”h]”hŒinline”“”)�”}”(hj‚h]”hŒBTF_Type_String”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j„hj€ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œbpf/btf”Œ refdomain”j‘Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆŒ reftarget”Œbtf_type_string”uh1hh³hÊh´KhjxubhŒ.”…”�”}”(hjxh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhhËh²hubhŒtarget”“”)�”}”(hŒ.. _BTF_Type_String:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œbtf-type-string”uh1j¯h´KhhËh²hh³hÊubeh}”(h]”Œ introduction”ah ]”h"]”Œ1. introduction”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)�”}”(hhh]”(h»)�”}”(hŒ2. BTF Type and String Encoding”h]”hŒ2. BTF Type and String Encoding”…”�”}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÅh²hh³hÊh´K!ubhÝ)�”}”(hŒfThe file ``include/uapi/linux/btf.h`` provides high-level definition of how types/strings are encoded.”h]”(hŒ The file ”…”�”}”(hjÖh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ``include/uapi/linux/btf.h``”h]”hŒinclude/uapi/linux/btf.h”…”�”}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÖubhŒA provides high-level definition of how types/strings are encoded.”…”�”}”(hjÖh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K#hjÅh²hubhÝ)�”}”(hŒ$The beginning of data blob must be::”h]”hŒ#The beginning of data blob must be:”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K&hjÅh²hubhŒ literal_block”“”)�”}”(hX©struct btf_header { __u16 magic; __u8 version; __u8 flags; __u32 hdr_len; /* All offsets are in bytes relative to the end of this header */ __u32 type_off; /* offset of type section */ __u32 type_len; /* length of type section */ __u32 str_off; /* offset of string section */ __u32 str_len; /* length of string section */ };”h]”hX©struct btf_header { __u16 magic; __u8 version; __u8 flags; __u32 hdr_len; /* All offsets are in bytes relative to the end of this header */ __u32 type_off; /* offset of type section */ __u32 type_len; /* length of type section */ __u32 str_off; /* offset of string section */ __u32 str_len; /* length of string section */ };”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jh³hÊh´K(hjÅh²hubhÝ)�”}”(hX2The magic is ``0xeB9F``, which has different encoding for big and little endian systems, and can be used to test whether BTF is generated for big- or little-endian target. The ``btf_header`` is designed to be extensible with ``hdr_len`` equal to ``sizeof(struct btf_header)`` when a data blob is generated.”h]”(hŒ The magic is ”…”�”}”(hjh²hh³Nh´Nubjß)�”}”(hŒ ``0xeB9F``”h]”hŒ0xeB9F”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ™, which has different encoding for big and little endian systems, and can be used to test whether BTF is generated for big- or little-endian target. The ”…”�”}”(hjh²hh³Nh´Nubjß)�”}”(hŒ``btf_header``”h]”hŒ btf_header”…”�”}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ# is designed to be extensible with ”…”�”}”(hjh²hh³Nh´Nubjß)�”}”(hŒ ``hdr_len``”h]”hŒhdr_len”…”�”}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ equal to ”…”�”}”(hjh²hh³Nh´Nubjß)�”}”(hŒ``sizeof(struct btf_header)``”h]”hŒsizeof(struct btf_header)”…”�”}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ when a data blob is generated.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K5hjÅh²hubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.1 String Encoding”h]”hŒ2.1 String Encoding”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjnh²hh³hÊh´Khjnh²hubeh}”(h]”Œstring-encoding”ah ]”h"]”Œ2.1 string encoding”ah$]”h&]”uh1hµhjÅh²hh³hÊh´K> 24) #define BTF_INT_OFFSET(VAL) (((VAL) & 0x00ff0000) >> 16) #define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff)”h]”hŒ¯#define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24) #define BTF_INT_OFFSET(VAL) (((VAL) & 0x00ff0000) >> 16) #define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff)”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´Kˆhjfh²hubhÝ)�”}”(hŒ7The ``BTF_INT_ENCODING`` has the following attributes::”h]”(hŒThe ”…”�”}”(hj®h²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_ENCODING``”h]”hŒBTF_INT_ENCODING”…”�”}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj®ubhŒ has the following attributes:”…”�”}”(hj®h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KŒhjfh²hubj)�”}”(hŒb#define BTF_INT_SIGNED (1 << 0) #define BTF_INT_CHAR (1 << 1) #define BTF_INT_BOOL (1 << 2)”h]”hŒb#define BTF_INT_SIGNED (1 << 0) #define BTF_INT_CHAR (1 << 1) #define BTF_INT_BOOL (1 << 2)”…”�”}”hjÎsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´KŽhjfh²hubhÝ)�”}”(hŒÚThe ``BTF_INT_ENCODING()`` provides extra information: signedness, char, or bool, for the int type. The char and bool encoding are mostly useful for pretty print. At most one encoding can be specified for the int type.”h]”(hŒThe ”…”�”}”(hjÜh²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_ENCODING()``”h]”hŒBTF_INT_ENCODING()”…”�”}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÜubhŒÀ provides extra information: signedness, char, or bool, for the int type. The char and bool encoding are mostly useful for pretty print. At most one encoding can be specified for the int type.”…”�”}”(hjÜh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K’hjfh²hubhÝ)�”}”(hX#The ``BTF_INT_BITS()`` specifies the number of actual bits held by this int type. For example, a 4-bit bitfield encodes ``BTF_INT_BITS()`` equals to 4. The ``btf_type.size * 8`` must be equal to or greater than ``BTF_INT_BITS()`` for the type. The maximum value of ``BTF_INT_BITS()`` is 128.”h]”(hŒThe ”…”�”}”(hjüh²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_BITS()``”h]”hŒBTF_INT_BITS()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjüubhŒb specifies the number of actual bits held by this int type. For example, a 4-bit bitfield encodes ”…”�”}”(hjüh²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_BITS()``”h]”hŒBTF_INT_BITS()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjüubhŒ equals to 4. The ”…”�”}”(hjüh²hh³Nh´Nubjß)�”}”(hŒ``btf_type.size * 8``”h]”hŒbtf_type.size * 8”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjüubhŒ" must be equal to or greater than ”…”�”}”(hjüh²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_BITS()``”h]”hŒBTF_INT_BITS()”…”�”}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjüubhŒ$ for the type. The maximum value of ”…”�”}”(hjüh²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_BITS()``”h]”hŒBTF_INT_BITS()”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjüubhŒ is 128.”…”�”}”(hjüh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K–hjfh²hubhÝ)�”}”(hŒ‡The ``BTF_INT_OFFSET()`` specifies the starting bit offset to calculate values for this int. For example, a bitfield struct member has:”h]”(hŒThe ”…”�”}”(hjdh²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_OFFSET()``”h]”hŒBTF_INT_OFFSET()”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjdubhŒo specifies the starting bit offset to calculate values for this int. For example, a bitfield struct member has:”…”�”}”(hjdh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K›hjfh²hubhŒ block_quote”“”)�”}”(hŒª* btf member bit offset 100 from the start of the structure, * btf member pointing to an int type, * the int type has ``BTF_INT_OFFSET() = 2`` and ``BTF_INT_BITS() = 4`` ”h]”j)�”}”(hhh]”(j )�”}”(hŒ:btf member bit offset 100 from the start of the structure,”h]”hÝ)�”}”(hj�h]”hŒ:btf member bit offset 100 from the start of the structure,”…”�”}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kžhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjŠubj )�”}”(hŒ#btf member pointing to an int type,”h]”hÝ)�”}”(hj¦h]”hŒ#btf member pointing to an int type,”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KŸhj¤ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjŠubj )�”}”(hŒEthe int type has ``BTF_INT_OFFSET() = 2`` and ``BTF_INT_BITS() = 4`` ”h]”hÝ)�”}”(hŒDthe int type has ``BTF_INT_OFFSET() = 2`` and ``BTF_INT_BITS() = 4``”h]”(hŒthe int type has ”…”�”}”(hj¿h²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_OFFSET() = 2``”h]”hŒBTF_INT_OFFSET() = 2”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¿ubhŒ and ”…”�”}”(hj¿h²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_BITS() = 4``”h]”hŒBTF_INT_BITS() = 4”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¿ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K hj»ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjŠubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´Kžhj†ubah}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÊh´Kžhjfh²hubhÝ)�”}”(hŒjThen in the struct memory layout, this member will occupy ``4`` bits starting from bits ``100 + 2 = 102``.”h]”(hŒ:Then in the struct memory layout, this member will occupy ”…”�”}”(hjÿh²hh³Nh´Nubjß)�”}”(hŒ``4``”h]”hŒ4”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÿubhŒ bits starting from bits ”…”�”}”(hjÿh²hh³Nh´Nubjß)�”}”(hŒ``100 + 2 = 102``”h]”hŒ 100 + 2 = 102”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÿubhŒ.”…”�”}”(hjÿh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¢hjfh²hubhÝ)�”}”(hŒdAlternatively, the bitfield struct member can be the following to access the same bits as the above:”h]”hŒdAlternatively, the bitfield struct member can be the following to access the same bits as the above:”…”�”}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¥hjfh²hubj…)�”}”(hŒŠ* btf member bit offset 102, * btf member pointing to an int type, * the int type has ``BTF_INT_OFFSET() = 0`` and ``BTF_INT_BITS() = 4`` ”h]”j)�”}”(hhh]”(j )�”}”(hŒbtf member bit offset 102,”h]”hÝ)�”}”(hjHh]”hŒbtf member bit offset 102,”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¨hjFubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjCubj )�”}”(hŒ#btf member pointing to an int type,”h]”hÝ)�”}”(hj_h]”hŒ#btf member pointing to an int type,”…”�”}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K©hj]ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjCubj )�”}”(hŒEthe int type has ``BTF_INT_OFFSET() = 0`` and ``BTF_INT_BITS() = 4`` ”h]”hÝ)�”}”(hŒDthe int type has ``BTF_INT_OFFSET() = 0`` and ``BTF_INT_BITS() = 4``”h]”(hŒthe int type has ”…”�”}”(hjxh²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_OFFSET() = 0``”h]”hŒBTF_INT_OFFSET() = 0”…”�”}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjxubhŒ and ”…”�”}”(hjxh²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_BITS() = 4``”h]”hŒBTF_INT_BITS() = 4”…”�”}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjxubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kªhjtubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjCubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´K¨hj?ubah}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÊh´K¨hjfh²hubhÝ)�”}”(hŒ³The original intention of ``BTF_INT_OFFSET()`` is to provide flexibility of bitfield encoding. Currently, both llvm and pahole generate ``BTF_INT_OFFSET() = 0`` for all int types.”h]”(hŒThe original intention of ”…”�”}”(hj¸h²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_OFFSET()``”h]”hŒBTF_INT_OFFSET()”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¸ubhŒZ is to provide flexibility of bitfield encoding. Currently, both llvm and pahole generate ”…”�”}”(hj¸h²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_OFFSET() = 0``”h]”hŒBTF_INT_OFFSET() = 0”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¸ubhŒ for all int types.”…”�”}”(hj¸h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¬hjfh²hubeh}”(h]”Œ btf-kind-int”ah ]”h"]”Œ2.2.1 btf_kind_int”ah$]”h&]”uh1hµhj•h²hh³hÊh´K}ubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.2 BTF_KIND_PTR”h]”hŒ2.2.2 BTF_KIND_PTR”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjòh²hh³hÊh´K±ubhû)�”}”(hhh]”j)�”}”(hŒ±``struct btf_type`` encoding requirement: * ``name_off``: 0 * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_PTR * ``info.vlen``: 0 * ``type``: the pointee type of the pointer ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj ubhŒ encoding requirement:”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K¸hjubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ``name_off``: 0”h]”hÝ)�”}”(hj.h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj0ubhŒ: 0”…”�”}”(hj0h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K´hj,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj)ubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hjSh]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjUubhŒ: 0”…”�”}”(hjUh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KµhjQubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj)ubj )�”}”(hŒ``info.kind``: BTF_KIND_PTR”h]”hÝ)�”}”(hjxh]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjzubhŒ: BTF_KIND_PTR”…”�”}”(hjzh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¶hjvubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj)ubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hj�h]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjŸubhŒ: 0”…”�”}”(hjŸh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K·hj›ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj)ubj )�”}”(hŒ*``type``: the pointee type of the pointer ”h]”hÝ)�”}”(hŒ)``type``: the pointee type of the pointer”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÄubhŒ!: the pointee type of the pointer”…”�”}”(hjÄh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¸hjÀubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj)ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´K´hj&ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´K¸hjubah}”(h]”h ]”h"]”h$]”h&]”uh1húhjòh²hh³Nh´NubhÝ)�”}”(hŒ,No additional type data follow ``btf_type``.”h]”(hŒNo additional type data follow ”…”�”}”(hjþh²hh³Nh´Nubjß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjþubhŒ.”…”�”}”(hjþh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kºhjòh²hubeh}”(h]”Œ btf-kind-ptr”ah ]”h"]”Œ2.2.2 btf_kind_ptr”ah$]”h&]”uh1hµhj•h²hh³hÊh´K±ubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.3 BTF_KIND_ARRAY”h]”hŒ2.2.3 BTF_KIND_ARRAY”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj&h²hh³hÊh´K½ubhû)�”}”(hhh]”j)�”}”(hŒ¤``struct btf_type`` encoding requirement: * ``name_off``: 0 * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_ARRAY * ``info.vlen``: 0 * ``size/type``: 0, not used ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj>ubhŒ encoding requirement:”…”�”}”(hj>h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KÄhj:ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ``name_off``: 0”h]”hÝ)�”}”(hjbh]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjdubhŒ: 0”…”�”}”(hjdh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÀhj`ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj]ubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hj‡h]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj‰ubhŒ: 0”…”�”}”(hj‰h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÁhj…ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj]ubj )�”}”(hŒ``info.kind``: BTF_KIND_ARRAY”h]”hÝ)�”}”(hj¬h]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj®ubhŒ: BTF_KIND_ARRAY”…”�”}”(hj®h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÂhjªubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj]ubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hjÑh]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÓubhŒ: 0”…”�”}”(hjÓh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÃhjÏubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj]ubj )�”}”(hŒ``size/type``: 0, not used ”h]”hÝ)�”}”(hŒ``size/type``: 0, not used”h]”(jß)�”}”(hŒ ``size/type``”h]”hŒ size/type”…”�”}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjøubhŒ : 0, not used”…”�”}”(hjøh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÄhjôubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj]ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´KÀhjZubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj:ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´KÄhj7ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj&h²hh³Nh´NubhÝ)�”}”(hŒ6``btf_type`` is followed by one ``struct btf_array``::”h]”(jß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hj6 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj2 ubhŒ is followed by one ”…”�”}”(hj2 h²hh³Nh´Nubjß)�”}”(hŒ``struct btf_array``”h]”hŒstruct btf_array”…”�”}”(hjH h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj2 ubhŒ:”…”�”}”(hj2 h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÆhj&h²hubj)�”}”(hŒSstruct btf_array { __u32 type; __u32 index_type; __u32 nelems; };”h]”hŒSstruct btf_array { __u32 type; __u32 index_type; __u32 nelems; };”…”�”}”hj` sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´KÈhj&h²hubhû)�”}”(hhh]”j)�”}”(hŒ®The ``struct btf_array`` encoding: * ``type``: the element type * ``index_type``: the index type * ``nelems``: the number of elements for this array (``0`` is also allowed). ”h]”(j)�”}”(hŒ"The ``struct btf_array`` encoding:”h]”(hŒThe ”…”�”}”(hju h²hh³Nh´Nubjß)�”}”(hŒ``struct btf_array``”h]”hŒstruct btf_array”…”�”}”(hj} h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhju ubhŒ encoding:”…”�”}”(hju h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KÑhjq ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ``type``: the element type”h]”hÝ)�”}”(hj� h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hj¢ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjŸ ubhŒ: the element type”…”�”}”(hjŸ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÏhj› ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj˜ ubj )�”}”(hŒ``index_type``: the index type”h]”hÝ)�”}”(hj h]”(jß)�”}”(hŒ``index_type``”h]”hŒ index_type”…”�”}”(hjÇ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÄ ubhŒ: the index type”…”�”}”(hjÄ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÐhjÀ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj˜ ubj )�”}”(hŒK``nelems``: the number of elements for this array (``0`` is also allowed). ”h]”hÝ)�”}”(hŒJ``nelems``: the number of elements for this array (``0`` is also allowed).”h]”(jß)�”}”(hŒ ``nelems``”h]”hŒnelems”…”�”}”(hjí h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjé ubhŒ): the number of elements for this array (”…”�”}”(hjé h²hh³Nh´Nubjß)�”}”(hŒ``0``”h]”hŒ0”…”�”}”(hjÿ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjé ubhŒ is also allowed).”…”�”}”(hjé h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÑhjå ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj˜ ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´KÏhj• ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjq ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´KÑhjn ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj&h²hh³Nh´NubhÝ)�”}”(hX%The ``index_type`` can be any regular int type (``u8``, ``u16``, ``u32``, ``u64``, ``unsigned __int128``). The original design of including ``index_type`` follows DWARF, which has an ``index_type`` for its array type. Currently in BTF, beyond type verification, the ``index_type`` is not used.”h]”(hŒThe ”…”�”}”(hj5 h²hh³Nh´Nubjß)�”}”(hŒ``index_type``”h]”hŒ index_type”…”�”}”(hj= h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj5 ubhŒ can be any regular int type (”…”�”}”(hj5 h²hh³Nh´Nubjß)�”}”(hŒ``u8``”h]”hŒu8”…”�”}”(hjO h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj5 ubhŒ, ”…”�”}”(hj5 h²hh³Nh´Nubjß)�”}”(hŒ``u16``”h]”hŒu16”…”�”}”(hja h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj5 ubhŒ, ”…”�”}”hj5 sbjß)�”}”(hŒ``u32``”h]”hŒu32”…”�”}”(hjs h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj5 ubhŒ, ”…”�”}”(hj5 h²hh³Nh´Nubjß)�”}”(hŒ``u64``”h]”hŒu64”…”�”}”(hj… h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj5 ubhŒ, ”…”�”}”hj5 sbjß)�”}”(hŒ``unsigned __int128``”h]”hŒunsigned __int128”…”�”}”(hj— h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj5 ubhŒ$). The original design of including ”…”�”}”(hj5 h²hh³Nh´Nubjß)�”}”(hŒ``index_type``”h]”hŒ index_type”…”�”}”(hj© h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj5 ubhŒ follows DWARF, which has an ”…”�”}”(hj5 h²hh³Nh´Nubjß)�”}”(hŒ``index_type``”h]”hŒ index_type”…”�”}”(hj» h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj5 ubhŒE for its array type. Currently in BTF, beyond type verification, the ”…”�”}”(hj5 h²hh³Nh´Nubjß)�”}”(hŒ``index_type``”h]”hŒ index_type”…”�”}”(hjÍ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj5 ubhŒ is not used.”…”�”}”(hj5 h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÓhj&h²hubhÝ)�”}”(hŒ¾The ``struct btf_array`` allows chaining through element type to represent multidimensional arrays. For example, for ``int a[5][6]``, the following type information illustrates the chaining:”h]”(hŒThe ”…”�”}”(hjå h²hh³Nh´Nubjß)�”}”(hŒ``struct btf_array``”h]”hŒstruct btf_array”…”�”}”(hjí h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjå ubhŒ] allows chaining through element type to represent multidimensional arrays. For example, for ”…”�”}”(hjå h²hh³Nh´Nubjß)�”}”(hŒ``int a[5][6]``”h]”hŒ int a[5][6]”…”�”}”(hjÿ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjå ubhŒ:, the following type information illustrates the chaining:”…”�”}”(hjå h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KØhj&h²hubj…)�”}”(hŒ�* [1]: int * [2]: array, ``btf_array.type = [1]``, ``btf_array.nelems = 6`` * [3]: array, ``btf_array.type = [2]``, ``btf_array.nelems = 5`` ”h]”j)�”}”(hhh]”(j )�”}”(hŒ[1]: int”h]”hÝ)�”}”(hj h]”hŒ[1]: int”…”�”}”(hj" h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÜhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubj )�”}”(hŒ>[2]: array, ``btf_array.type = [1]``, ``btf_array.nelems = 6``”h]”hÝ)�”}”(hj7 h]”(hŒ [2]: array, ”…”�”}”(hj9 h²hh³Nh´Nubjß)�”}”(hŒ``btf_array.type = [1]``”h]”hŒbtf_array.type = [1]”…”�”}”(hj@ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj9 ubhŒ, ”…”�”}”(hj9 h²hh³Nh´Nubjß)�”}”(hŒ``btf_array.nelems = 6``”h]”hŒbtf_array.nelems = 6”…”�”}”(hjR h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj9 ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÝhj5 ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubj )�”}”(hŒ?[3]: array, ``btf_array.type = [2]``, ``btf_array.nelems = 5`` ”h]”hÝ)�”}”(hŒ>[3]: array, ``btf_array.type = [2]``, ``btf_array.nelems = 5``”h]”(hŒ [3]: array, ”…”�”}”(hjp h²hh³Nh´Nubjß)�”}”(hŒ``btf_array.type = [2]``”h]”hŒbtf_array.type = [2]”…”�”}”(hjx h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjp ubhŒ, ”…”�”}”(hjp h²hh³Nh´Nubjß)�”}”(hŒ``btf_array.nelems = 5``”h]”hŒbtf_array.nelems = 5”…”�”}”(hjŠ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjp ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÞhjl ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´KÜhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÊh´KÜhj&h²hubhÝ)�”}”(hX¦Currently, both pahole and llvm collapse multidimensional array into one-dimensional array, e.g., for ``a[5][6]``, the ``btf_array.nelems`` is equal to ``30``. This is because the original use case is map pretty print where the whole array is dumped out so one-dimensional array is enough. As more BTF usage is explored, pahole and llvm can be changed to generate proper chained representation for multidimensional arrays.”h]”(hŒfCurrently, both pahole and llvm collapse multidimensional array into one-dimensional array, e.g., for ”…”�”}”(hj° h²hh³Nh´Nubjß)�”}”(hŒ ``a[5][6]``”h]”hŒa[5][6]”…”�”}”(hj¸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj° ubhŒ, the ”…”�”}”(hj° h²hh³Nh´Nubjß)�”}”(hŒ``btf_array.nelems``”h]”hŒbtf_array.nelems”…”�”}”(hjÊ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj° ubhŒ is equal to ”…”�”}”(hj° h²hh³Nh´Nubjß)�”}”(hŒ``30``”h]”hŒ30”…”�”}”(hjÜ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj° ubhX. This is because the original use case is map pretty print where the whole array is dumped out so one-dimensional array is enough. As more BTF usage is explored, pahole and llvm can be changed to generate proper chained representation for multidimensional arrays.”…”�”}”(hj° h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kàhj&h²hubeh}”(h]”Œbtf-kind-array”ah ]”h"]”Œ2.2.3 btf_kind_array”ah$]”h&]”uh1hµhj•h²hh³hÊh´K½ubh¶)�”}”(hhh]”h»)�”}”(hŒ2.2.4 BTF_KIND_STRUCT”h]”hŒ2.2.4 BTF_KIND_STRUCT”…”�”}”(hjÿ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjü h²hh³hÊh´Kèubah}”(h]”Œbtf-kind-struct”ah ]”h"]”Œ2.2.4 btf_kind_struct”ah$]”h&]”uh1hµhj•h²hh³hÊh´Kèubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.5 BTF_KIND_UNION”h]”hŒ2.2.5 BTF_KIND_UNION”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj h²hh³hÊh´Kêubhû)�”}”(hhh]”j)�”}”(hX``struct btf_type`` encoding requirement: * ``name_off``: 0 or offset to a valid C identifier * ``info.kind_flag``: 0 or 1 * ``info.kind``: BTF_KIND_STRUCT or BTF_KIND_UNION * ``info.vlen``: the number of struct/union members * ``info.size``: the size of the struct/union in bytes ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hj1 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj- ubhŒ encoding requirement:”…”�”}”(hj- h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kñhj) ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ1``name_off``: 0 or offset to a valid C identifier”h]”hÝ)�”}”(hjQ h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjV h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjS ubhŒ%: 0 or offset to a valid C identifier”…”�”}”(hjS h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KíhjO ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjL ubj )�”}”(hŒ``info.kind_flag``: 0 or 1”h]”hÝ)�”}”(hjv h]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hj{ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjx ubhŒ: 0 or 1”…”�”}”(hjx h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kîhjt ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjL ubj )�”}”(hŒ0``info.kind``: BTF_KIND_STRUCT or BTF_KIND_UNION”h]”hÝ)�”}”(hj› h]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hj  h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj� ubhŒ#: BTF_KIND_STRUCT or BTF_KIND_UNION”…”�”}”(hj� h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kïhj™ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjL ubj )�”}”(hŒ1``info.vlen``: the number of struct/union members”h]”hÝ)�”}”(hjÀ h]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjÅ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj ubhŒ$: the number of struct/union members”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kðhj¾ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjL ubj )�”}”(hŒ5``info.size``: the size of the struct/union in bytes ”h]”hÝ)�”}”(hŒ4``info.size``: the size of the struct/union in bytes”h]”(jß)�”}”(hŒ ``info.size``”h]”hŒ info.size”…”�”}”(hjë h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjç ubhŒ': the size of the struct/union in bytes”…”�”}”(hjç h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kñhjã ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjL ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´KíhjI ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj) ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´Kñhj& ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj h²hh³Nh´NubhÝ)�”}”(hŒL``btf_type`` is followed by ``info.vlen`` number of ``struct btf_member``.::”h]”(jß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hj% h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj! ubhŒ is followed by ”…”�”}”(hj! h²hh³Nh´Nubjß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj7 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj! ubhŒ number of ”…”�”}”(hj! h²hh³Nh´Nubjß)�”}”(hŒ``struct btf_member``”h]”hŒstruct btf_member”…”�”}”(hjI h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj! ubhŒ.:”…”�”}”(hj! h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kóhj h²hubj)�”}”(hŒRstruct btf_member { __u32 name_off; __u32 type; __u32 offset; };”h]”hŒRstruct btf_member { __u32 name_off; __u32 type; __u32 offset; };”…”�”}”hja sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´Kõhj h²hubhû)�”}”(hhh]”j)�”}”(hŒ…``struct btf_member`` encoding: * ``name_off``: offset to a valid C identifier * ``type``: the member type * ``offset``: ”h]”(j)�”}”(hŒ``struct btf_member`` encoding:”h]”(jß)�”}”(hŒ``struct btf_member``”h]”hŒstruct btf_member”…”�”}”(hjz h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjv ubhŒ encoding:”…”�”}”(hjv h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kþhjr ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ,``name_off``: offset to a valid C identifier”h]”hÝ)�”}”(hjš h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjŸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjœ ubhŒ : offset to a valid C identifier”…”�”}”(hjœ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kühj˜ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj• ubj )�”}”(hŒ``type``: the member type”h]”hÝ)�”}”(hj¿ h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hjÄ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÁ ubhŒ: the member type”…”�”}”(hjÁ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kýhj½ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj• ubj )�”}”(hŒ``offset``: ”h]”hÝ)�”}”(hŒ``offset``: ”h]”(jß)�”}”(hŒ ``offset``”h]”hŒoffset”…”�”}”(hjê h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjæ ubhŒ : ”…”�”}”(hjæ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kþhjâ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj• ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´Kühj’ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjr ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´Kþhjo ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj h²hh³Nh´NubhÝ)�”}”(hXcIf the type info ``kind_flag`` is not set, the offset contains only bit offset of the member. Note that the base type of the bitfield can only be int or enum type. If the bitfield size is 32, the base type can be either int or enum type. If the bitfield size is not 32, the base type must be int, and int type ``BTF_INT_BITS()`` encodes the bitfield size.”h]”(hŒIf the type info ”…”�”}”(hj h²hh³Nh´Nubjß)�”}”(hŒ ``kind_flag``”h]”hŒ kind_flag”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj ubhX is not set, the offset contains only bit offset of the member. Note that the base type of the bitfield can only be int or enum type. If the bitfield size is 32, the base type can be either int or enum type. If the bitfield size is not 32, the base type must be int, and int type ”…”�”}”(hj h²hh³Nh´Nubjß)�”}”(hŒ``BTF_INT_BITS()``”h]”hŒBTF_INT_BITS()”…”�”}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj ubhŒ encodes the bitfield size.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj h²hubhÝ)�”}”(hŒ¥If the ``kind_flag`` is set, the ``btf_member.offset`` contains both member bitfield size and bit offset. The bitfield size and bit offset are calculated as below.::”h]”(hŒIf the ”…”�”}”(hjRh²hh³Nh´Nubjß)�”}”(hŒ ``kind_flag``”h]”hŒ kind_flag”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjRubhŒ is set, the ”…”�”}”(hjRh²hh³Nh´Nubjß)�”}”(hŒ``btf_member.offset``”h]”hŒbtf_member.offset”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjRubhŒn contains both member bitfield size and bit offset. The bitfield size and bit offset are calculated as below.:”…”�”}”(hjRh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj h²hubj)�”}”(hŒp#define BTF_MEMBER_BITFIELD_SIZE(val) ((val) >> 24) #define BTF_MEMBER_BIT_OFFSET(val) ((val) & 0xffffff)”h]”hŒp#define BTF_MEMBER_BITFIELD_SIZE(val) ((val) >> 24) #define BTF_MEMBER_BIT_OFFSET(val) ((val) & 0xffffff)”…”�”}”hj„sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M hj h²hubhÝ)�”}”(hŒMIn this case, if the base type is an int type, it must be a regular int type:”h]”hŒMIn this case, if the base type is an int type, it must be a regular int type:”…”�”}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hj h²hubj…)�”}”(hŒ^* ``BTF_INT_OFFSET()`` must be 0. * ``BTF_INT_BITS()`` must be equal to ``{1,2,4,8,16} * 8``. ”h]”j)�”}”(hhh]”(j )�”}”(hŒ``BTF_INT_OFFSET()`` must be 0.”h]”hÝ)�”}”(hj©h]”(jß)�”}”(hŒ``BTF_INT_OFFSET()``”h]”hŒBTF_INT_OFFSET()”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj«ubhŒ must be 0.”…”�”}”(hj«h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj§ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj¤ubj )�”}”(hŒ:``BTF_INT_BITS()`` must be equal to ``{1,2,4,8,16} * 8``. ”h]”hÝ)�”}”(hŒ9``BTF_INT_BITS()`` must be equal to ``{1,2,4,8,16} * 8``.”h]”(jß)�”}”(hŒ``BTF_INT_BITS()``”h]”hŒBTF_INT_BITS()”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÐubhŒ must be equal to ”…”�”}”(hjÐh²hh³Nh´Nubjß)�”}”(hŒ``{1,2,4,8,16} * 8``”h]”hŒ{1,2,4,8,16} * 8”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÐubhŒ.”…”�”}”(hjÐh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjÌubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj¤ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÊh´Mhj h²hubhÝ)�”}”(hŒOCommit 9d5f9f701b18 introduced ``kind_flag`` and explains why both modes exist.”h]”(hŒCommit 9d5f9f701b18 introduced ”…”�”}”(hjh²hh³Nh´Nubjß)�”}”(hŒ ``kind_flag``”h]”hŒ kind_flag”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ# and explains why both modes exist.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj h²hubeh}”(h]”Œbtf-kind-union”ah ]”h"]”Œ2.2.5 btf_kind_union”ah$]”h&]”uh1hµhj•h²hh³hÊh´Kêubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.6 BTF_KIND_ENUM”h]”hŒ2.2.6 BTF_KIND_ENUM”…”�”}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj8h²hh³hÊh´Mubhû)�”}”(hhh]”j)�”}”(hŒë``struct btf_type`` encoding requirement: * ``name_off``: 0 or offset to a valid C identifier * ``info.kind_flag``: 0 for unsigned, 1 for signed * ``info.kind``: BTF_KIND_ENUM * ``info.vlen``: number of enum values * ``size``: 1/2/4/8 ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjPubhŒ encoding requirement:”…”�”}”(hjPh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MhjLubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ1``name_off``: 0 or offset to a valid C identifier”h]”hÝ)�”}”(hjth]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjvubhŒ%: 0 or offset to a valid C identifier”…”�”}”(hjvh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhjrubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjoubj )�”}”(hŒ0``info.kind_flag``: 0 for unsigned, 1 for signed”h]”hÝ)�”}”(hj™h]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj›ubhŒ: 0 for unsigned, 1 for signed”…”�”}”(hj›h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj—ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjoubj )�”}”(hŒ``info.kind``: BTF_KIND_ENUM”h]”hÝ)�”}”(hj¾h]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÀubhŒ: BTF_KIND_ENUM”…”�”}”(hjÀh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj¼ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjoubj )�”}”(hŒ$``info.vlen``: number of enum values”h]”hÝ)�”}”(hjãh]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjåubhŒ: number of enum values”…”�”}”(hjåh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhjáubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjoubj )�”}”(hŒ``size``: 1/2/4/8 ”h]”hÝ)�”}”(hŒ``size``: 1/2/4/8”h]”(jß)�”}”(hŒ``size``”h]”hŒsize”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj ubhŒ : 1/2/4/8”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjoubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´Mhjlubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjLubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MhjIubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj8h²hh³Nh´NubhÝ)�”}”(hŒJ``btf_type`` is followed by ``info.vlen`` number of ``struct btf_enum``.::”h]”(jß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjDubhŒ is followed by ”…”�”}”(hjDh²hh³Nh´Nubjß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjDubhŒ number of ”…”�”}”(hjDh²hh³Nh´Nubjß)�”}”(hŒ``struct btf_enum``”h]”hŒstruct btf_enum”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjDubhŒ.:”…”�”}”(hjDh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj8h²hubj)�”}”(hŒ;struct btf_enum { __u32 name_off; __s32 val; };”h]”hŒ;struct btf_enum { __u32 name_off; __s32 val; };”…”�”}”hj„sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M!hj8h²hubhû)�”}”(hhh]”j)�”}”(hŒ_The ``btf_enum`` encoding: * ``name_off``: offset to a valid C identifier * ``val``: any value ”h]”(j)�”}”(hŒThe ``btf_enum`` encoding:”h]”(hŒThe ”…”�”}”(hj™h²hh³Nh´Nubjß)�”}”(hŒ ``btf_enum``”h]”hŒbtf_enum”…”�”}”(hj¡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj™ubhŒ encoding:”…”�”}”(hj™h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M(hj•ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ,``name_off``: offset to a valid C identifier”h]”hÝ)�”}”(hjÁh]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÃubhŒ : offset to a valid C identifier”…”�”}”(hjÃh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M'hj¿ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj¼ubj )�”}”(hŒ``val``: any value ”h]”hÝ)�”}”(hŒ``val``: any value”h]”(jß)�”}”(hŒ``val``”h]”hŒval”…”�”}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjèubhŒ : any value”…”�”}”(hjèh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M(hjäubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj¼ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´M'hj¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj•ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´M(hj’ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj8h²hh³Nh´NubhÝ)�”}”(hŒ¬If the original enum value is signed and the size is less than 4, that value will be sign extended into 4 bytes. If the size is 8, the value will be truncated into 4 bytes.”h]”hŒ¬If the original enum value is signed and the size is less than 4, that value will be sign extended into 4 bytes. If the size is 8, the value will be truncated into 4 bytes.”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M*hj8h²hubeh}”(h]”Œ btf-kind-enum”ah ]”h"]”Œ2.2.6 btf_kind_enum”ah$]”h&]”uh1hµhj•h²hh³hÊh´Mubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.7 BTF_KIND_FWD”h]”hŒ2.2.7 BTF_KIND_FWD”…”�”}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj8h²hh³hÊh´M/ubhû)�”}”(hhh]”j)�”}”(hŒÈ``struct btf_type`` encoding requirement: * ``name_off``: offset to a valid C identifier * ``info.kind_flag``: 0 for struct, 1 for union * ``info.kind``: BTF_KIND_FWD * ``info.vlen``: 0 * ``type``: 0 ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjPubhŒ encoding requirement:”…”�”}”(hjPh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M6hjLubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ,``name_off``: offset to a valid C identifier”h]”hÝ)�”}”(hjth]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjvubhŒ : offset to a valid C identifier”…”�”}”(hjvh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M2hjrubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjoubj )�”}”(hŒ-``info.kind_flag``: 0 for struct, 1 for union”h]”hÝ)�”}”(hj™h]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj›ubhŒ: 0 for struct, 1 for union”…”�”}”(hj›h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M3hj—ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjoubj )�”}”(hŒ``info.kind``: BTF_KIND_FWD”h]”hÝ)�”}”(hj¾h]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÀubhŒ: BTF_KIND_FWD”…”�”}”(hjÀh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M4hj¼ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjoubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hjãh]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjåubhŒ: 0”…”�”}”(hjåh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M5hjáubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjoubj )�”}”(hŒ ``type``: 0 ”h]”hÝ)�”}”(hŒ ``type``: 0”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj ubhŒ: 0”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M6hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjoubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´M2hjlubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjLubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´M6hjIubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj8h²hh³Nh´NubhÝ)�”}”(hŒ,No additional type data follow ``btf_type``.”h]”(hŒNo additional type data follow ”…”�”}”(hjDh²hh³Nh´Nubjß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjDubhŒ.”…”�”}”(hjDh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M8hj8h²hubeh}”(h]”Œ btf-kind-fwd”ah ]”h"]”Œ2.2.7 btf_kind_fwd”ah$]”h&]”uh1hµhj•h²hh³hÊh´M/ubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.8 BTF_KIND_TYPEDEF”h]”hŒ2.2.8 BTF_KIND_TYPEDEF”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjlh²hh³hÊh´M;ubhû)�”}”(hhh]”j)�”}”(hŒé``struct btf_type`` encoding requirement: * ``name_off``: offset to a valid C identifier * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_TYPEDEF * ``info.vlen``: 0 * ``type``: the type which can be referred by name at ``name_off`` ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj„ubhŒ encoding requirement:”…”�”}”(hj„h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MBhj€ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ,``name_off``: offset to a valid C identifier”h]”hÝ)�”}”(hj¨h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjªubhŒ : offset to a valid C identifier”…”�”}”(hjªh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M>hj¦ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj£ubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hjÍh]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÏubhŒ: 0”…”�”}”(hjÏh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M?hjËubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj£ubj )�”}”(hŒ``info.kind``: BTF_KIND_TYPEDEF”h]”hÝ)�”}”(hjòh]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjôubhŒ: BTF_KIND_TYPEDEF”…”�”}”(hjôh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M@hjðubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj£ubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hjh]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ: 0”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MAhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj£ubj )�”}”(hŒA``type``: the type which can be referred by name at ``name_off`` ”h]”hÝ)�”}”(hŒ@``type``: the type which can be referred by name at ``name_off``”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj>ubhŒ,: the type which can be referred by name at ”…”�”}”(hj>h²hh³Nh´Nubjß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj>ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MBhj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj£ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´M>hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj€ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MBhj}ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhjlh²hh³Nh´NubhÝ)�”}”(hŒ,No additional type data follow ``btf_type``.”h]”(hŒNo additional type data follow ”…”�”}”(hj†h²hh³Nh´Nubjß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj†ubhŒ.”…”�”}”(hj†h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MDhjlh²hubeh}”(h]”Œbtf-kind-typedef”ah ]”h"]”Œ2.2.8 btf_kind_typedef”ah$]”h&]”uh1hµhj•h²hh³hÊh´M;ubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.9 BTF_KIND_VOLATILE”h]”hŒ2.2.9 BTF_KIND_VOLATILE”…”�”}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj®h²hh³hÊh´MGubhû)�”}”(hhh]”j)�”}”(hŒ»``struct btf_type`` encoding requirement: * ``name_off``: 0 * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_VOLATILE * ``info.vlen``: 0 * ``type``: the type with ``volatile`` qualifier ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÆubhŒ encoding requirement:”…”�”}”(hjÆh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MNhjÂubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ``name_off``: 0”h]”hÝ)�”}”(hjêh]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjìubhŒ: 0”…”�”}”(hjìh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MJhjèubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjåubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hjh]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ: 0”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MKhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjåubj )�”}”(hŒ ``info.kind``: BTF_KIND_VOLATILE”h]”hÝ)�”}”(hj4h]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj6ubhŒ: BTF_KIND_VOLATILE”…”�”}”(hj6h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MLhj2ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjåubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hjYh]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj[ubhŒ: 0”…”�”}”(hj[h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MMhjWubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjåubj )�”}”(hŒ/``type``: the type with ``volatile`` qualifier ”h]”hÝ)�”}”(hŒ.``type``: the type with ``volatile`` qualifier”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj€ubhŒ: the type with ”…”�”}”(hj€h²hh³Nh´Nubjß)�”}”(hŒ ``volatile``”h]”hŒvolatile”…”�”}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj€ubhŒ qualifier”…”�”}”(hj€h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MNhj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjåubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´MJhjâubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÂubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MNhj¿ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj®h²hh³Nh´NubhÝ)�”}”(hŒ,No additional type data follow ``btf_type``.”h]”(hŒNo additional type data follow ”…”�”}”(hjÌh²hh³Nh´Nubjß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÌubhŒ.”…”�”}”(hjÌh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MPhj®h²hubeh}”(h]”Œbtf-kind-volatile”ah ]”h"]”Œ2.2.9 btf_kind_volatile”a• h$]”h&]”uh1hµhj•h²hh³hÊh´MGubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.10 BTF_KIND_CONST”h]”hŒ2.2.10 BTF_KIND_CONST”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjôh²hh³hÊh´MSubhû)�”}”(hhh]”j)�”}”(hŒµ``struct btf_type`` encoding requirement: * ``name_off``: 0 * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_CONST * ``info.vlen``: 0 * ``type``: the type with ``const`` qualifier ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj ubhŒ encoding requirement:”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MZhjubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ``name_off``: 0”h]”hÝ)�”}”(hj0h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj2ubhŒ: 0”…”�”}”(hj2h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MVhj.ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj+ubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hjUh]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjWubhŒ: 0”…”�”}”(hjWh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MWhjSubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj+ubj )�”}”(hŒ``info.kind``: BTF_KIND_CONST”h]”hÝ)�”}”(hjzh]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj|ubhŒ: BTF_KIND_CONST”…”�”}”(hj|h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MXhjxubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj+ubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hjŸh]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¡ubhŒ: 0”…”�”}”(hj¡h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MYhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj+ubj )�”}”(hŒ,``type``: the type with ``const`` qualifier ”h]”hÝ)�”}”(hŒ+``type``: the type with ``const`` qualifier”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÆubhŒ: the type with ”…”�”}”(hjÆh²hh³Nh´Nubjß)�”}”(hŒ ``const``”h]”hŒconst”…”�”}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÆubhŒ qualifier”…”�”}”(hjÆh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MZhjÂubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj+ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´MVhj(ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MZhjubah}”(h]”h ]”h"]”h$]”h&]”uh1húhjôh²hh³Nh´NubhÝ)�”}”(hŒ,No additional type data follow ``btf_type``.”h]”(hŒNo additional type data follow ”…”�”}”(hjh²hh³Nh´Nubjß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M\hjôh²hubeh}”(h]”Œbtf-kind-const”ah ]”h"]”Œ2.2.10 btf_kind_const”ah$]”h&]”uh1hµhj•h²hh³hÊh´MSubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.11 BTF_KIND_RESTRICT”h]”hŒ2.2.11 BTF_KIND_RESTRICT”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj:h²hh³hÊh´M_ubhû)�”}”(hhh]”j)�”}”(hŒ»``struct btf_type`` encoding requirement: * ``name_off``: 0 * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_RESTRICT * ``info.vlen``: 0 * ``type``: the type with ``restrict`` qualifier ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjRubhŒ encoding requirement:”…”�”}”(hjRh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MfhjNubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ``name_off``: 0”h]”hÝ)�”}”(hjvh]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hj{h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjxubhŒ: 0”…”�”}”(hjxh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mbhjtubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjqubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hj›h]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj�ubhŒ: 0”…”�”}”(hj�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mchj™ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjqubj )�”}”(hŒ ``info.kind``: BTF_KIND_RESTRICT”h]”hÝ)�”}”(hjÀh]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÂubhŒ: BTF_KIND_RESTRICT”…”�”}”(hjÂh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mdhj¾ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjqubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hjåh]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjçubhŒ: 0”…”�”}”(hjçh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mehjãubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjqubj )�”}”(hŒ/``type``: the type with ``restrict`` qualifier ”h]”hÝ)�”}”(hŒ.``type``: the type with ``restrict`` qualifier”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj ubhŒ: the type with ”…”�”}”(hj h²hh³Nh´Nubjß)�”}”(hŒ ``restrict``”h]”hŒrestrict”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj ubhŒ qualifier”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mfhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjqubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´Mbhjnubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjNubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MfhjKubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj:h²hh³Nh´NubhÝ)�”}”(hŒ,No additional type data follow ``btf_type``.”h]”(hŒNo additional type data follow ”…”�”}”(hjXh²hh³Nh´Nubjß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjXubhŒ.”…”�”}”(hjXh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhhj:h²hubeh}”(h]”Œbtf-kind-restrict”ah ]”h"]”Œ2.2.11 btf_kind_restrict”ah$]”h&]”uh1hµhj•h²hh³hÊh´M_ubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.12 BTF_KIND_FUNC”h]”hŒ2.2.12 BTF_KIND_FUNC”…”�”}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj€h²hh³hÊh´Mkubhû)�”}”(hhh]”j)�”}”(hXO``struct btf_type`` encoding requirement: * ``name_off``: offset to a valid C identifier * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_FUNC * ``info.vlen``: linkage information (BTF_FUNC_STATIC, BTF_FUNC_GLOBAL or BTF_FUNC_EXTERN - see :ref:`BTF_Function_Linkage_Constants`) * ``type``: a BTF_KIND_FUNC_PROTO type ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj˜ubhŒ encoding requirement:”…”�”}”(hj˜h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mshj”ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ,``name_off``: offset to a valid C identifier”h]”hÝ)�”}”(hj¼h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¾ubhŒ : offset to a valid C identifier”…”�”}”(hj¾h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mnhjºubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj·ubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hjáh]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjãubhŒ: 0”…”�”}”(hjãh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mohjßubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj·ubj )�”}”(hŒ``info.kind``: BTF_KIND_FUNC”h]”hÝ)�”}”(hjh]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ: BTF_KIND_FUNC”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mphjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj·ubj )�”}”(hŒ“``info.vlen``: linkage information (BTF_FUNC_STATIC, BTF_FUNC_GLOBAL or BTF_FUNC_EXTERN - see :ref:`BTF_Function_Linkage_Constants`)”h]”hû)�”}”(hhh]”j)�”}”(hŒ„``info.vlen``: linkage information (BTF_FUNC_STATIC, BTF_FUNC_GLOBAL or BTF_FUNC_EXTERN - see :ref:`BTF_Function_Linkage_Constants`)”h]”(j)�”}”(hŒD``info.vlen``: linkage information (BTF_FUNC_STATIC, BTF_FUNC_GLOBAL”h]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj4ubhŒ7: linkage information (BTF_FUNC_STATIC, BTF_FUNC_GLOBAL”…”�”}”(hj4h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mqhj0ubj)�”}”(hhh]”hÝ)�”}”(hŒ?or BTF_FUNC_EXTERN - see :ref:`BTF_Function_Linkage_Constants`)”h]”(hŒor BTF_FUNC_EXTERN - see ”…”�”}”(hjSh²hh³Nh´Nubh)�”}”(hŒ%:ref:`BTF_Function_Linkage_Constants`”h]”j…)�”}”(hj]h]”hŒBTF_Function_Linkage_Constants”…”�”}”(hj_h²hh³Nh´Nubah}”(h]”h ]”(j�Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j„hj[ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j�Œ refdomain”jiŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj£Œbtf_function_linkage_constants”uh1hh³hÊh´MrhjSubhŒ)”…”�”}”(hjSh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MrhjPubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj0ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´Mqhj-ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj)ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj·ubj )�”}”(hŒ%``type``: a BTF_KIND_FUNC_PROTO type ”h]”hÝ)�”}”(hŒ$``type``: a BTF_KIND_FUNC_PROTO type”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¡ubhŒ: a BTF_KIND_FUNC_PROTO type”…”�”}”(hj¡h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mshj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj·ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´Mnhj´ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj”ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´Mshj‘ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj€h²hh³Nh´NubhÝ)�”}”(hŒ,No additional type data follow ``btf_type``.”h]”(hŒNo additional type data follow ”…”�”}”(hjÛh²hh³Nh´Nubjß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÛubhŒ.”…”�”}”(hjÛh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Muhj€h²hubhÝ)�”}”(hX*A BTF_KIND_FUNC defines not a type, but a subprogram (function) whose signature is defined by ``type``. The subprogram is thus an instance of that type. The BTF_KIND_FUNC may in turn be referenced by a func_info in the :ref:`BTF_Ext_Section` (ELF) or in the arguments to :ref:`BPF_Prog_Load` (ABI).”h]”(hŒ^A BTF_KIND_FUNC defines not a type, but a subprogram (function) whose signature is defined by ”…”�”}”(hjûh²hh³Nh´Nubjß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjûubhŒu. The subprogram is thus an instance of that type. The BTF_KIND_FUNC may in turn be referenced by a func_info in the ”…”�”}”(hjûh²hh³Nh´Nubh)�”}”(hŒ:ref:`BTF_Ext_Section`”h]”j…)�”}”(hjh]”hŒBTF_Ext_Section”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”(j�Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j„hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j�Œ refdomain”j#Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj£Œbtf_ext_section”uh1hh³hÊh´MwhjûubhŒ (ELF) or in the arguments to ”…”�”}”(hjûh²hh³Nh´Nubh)�”}”(hŒ:ref:`BPF_Prog_Load`”h]”j…)�”}”(hj;h]”hŒ BPF_Prog_Load”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”(j�Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j„hj9ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j�Œ refdomain”jGŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj£Œ bpf_prog_load”uh1hh³hÊh´MwhjûubhŒ (ABI).”…”�”}”(hjûh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mwhj€h²hubhÝ)�”}”(hŒbCurrently, only linkage values of BTF_FUNC_STATIC and BTF_FUNC_GLOBAL are supported in the kernel.”h]”hŒbCurrently, only linkage values of BTF_FUNC_STATIC and BTF_FUNC_GLOBAL are supported in the kernel.”…”�”}”(hjch²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M}hj€h²hubeh}”(h]”Œ btf-kind-func”ah ]”h"]”Œ2.2.12 btf_kind_func”ah$]”h&]”uh1hµhj•h²hh³hÊh´Mkubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.13 BTF_KIND_FUNC_PROTO”h]”hŒ2.2.13 BTF_KIND_FUNC_PROTO”…”�”}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjyh²hh³hÊh´M�ubhû)�”}”(hhh]”j)�”}”(hŒ¶``struct btf_type`` encoding requirement: * ``name_off``: 0 * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_FUNC_PROTO * ``info.vlen``: # of parameters * ``type``: the return type ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj‘ubhŒ encoding requirement:”…”�”}”(hj‘h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mˆhj�ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ``name_off``: 0”h]”hÝ)�”}”(hjµh]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj·ubhŒ: 0”…”�”}”(hj·h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M„hj³ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj°ubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hjÚh]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÜubhŒ: 0”…”�”}”(hjÜh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M…hjØubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj°ubj )�”}”(hŒ"``info.kind``: BTF_KIND_FUNC_PROTO”h]”hÝ)�”}”(hjÿh]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ: BTF_KIND_FUNC_PROTO”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M†hjýubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj°ubj )�”}”(hŒ``info.vlen``: # of parameters”h]”hÝ)�”}”(hj$h]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj&ubhŒ: # of parameters”…”�”}”(hj&h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M‡hj"ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj°ubj )�”}”(hŒ``type``: the return type ”h]”hÝ)�”}”(hŒ``type``: the return type”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjKubhŒ: the return type”…”�”}”(hjKh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MˆhjGubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj°ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´M„hj­ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj�ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MˆhjŠubah}”(h]”h ]”h"]”h$]”h&]”uh1húhjyh²hh³Nh´NubhÝ)�”}”(hŒK``btf_type`` is followed by ``info.vlen`` number of ``struct btf_param``.::”h]”(jß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj…ubhŒ is followed by ”…”�”}”(hj…h²hh³Nh´Nubjß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj…ubhŒ number of ”…”�”}”(hj…h²hh³Nh´Nubjß)�”}”(hŒ``struct btf_param``”h]”hŒstruct btf_param”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj…ubhŒ.:”…”�”}”(hj…h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MŠhjyh²hubj)�”}”(hŒ=struct btf_param { __u32 name_off; __u32 type; };”h]”hŒ=struct btf_param { __u32 name_off; __u32 type; };”…”�”}”hjÅsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MŒhjyh²hubhÝ)�”}”(hŒøIf a BTF_KIND_FUNC_PROTO type is referred by a BTF_KIND_FUNC type, then ``btf_param.name_off`` must point to a valid C identifier except for the possible last argument representing the variable argument. The btf_param.type refers to parameter type.”h]”(hŒHIf a BTF_KIND_FUNC_PROTO type is referred by a BTF_KIND_FUNC type, then ”…”�”}”(hjÓh²hh³Nh´Nubjß)�”}”(hŒ``btf_param.name_off``”h]”hŒbtf_param.name_off”…”�”}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÓubhŒš must point to a valid C identifier except for the possible last argument representing the variable argument. The btf_param.type refers to parameter type.”…”�”}”(hjÓh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M‘hjyh²hubhÝ)�”}”(hŒmIf the function has variable arguments, the last parameter is encoded with ``name_off = 0`` and ``type = 0``.”h]”(hŒKIf the function has variable arguments, the last parameter is encoded with ”…”�”}”(hjóh²hh³Nh´Nubjß)�”}”(hŒ``name_off = 0``”h]”hŒ name_off = 0”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjóubhŒ and ”…”�”}”(hjóh²hh³Nh´Nubjß)�”}”(hŒ ``type = 0``”h]”hŒtype = 0”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjóubhŒ.”…”�”}”(hjóh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M–hjyh²hubeh}”(h]”Œbtf-kind-func-proto”ah ]”h"]”Œ2.2.13 btf_kind_func_proto”ah$]”h&]”uh1hµhj•h²hh³hÊh´M�ubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.14 BTF_KIND_VAR”h]”hŒ2.2.14 BTF_KIND_VAR”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj-h²hh³hÊh´Mšubhû)�”}”(hhh]”j)�”}”(hŒÇ``struct btf_type`` encoding requirement: * ``name_off``: offset to a valid C identifier * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_VAR * ``info.vlen``: 0 * ``type``: the type of the variable ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjEubhŒ encoding requirement:”…”�”}”(hjEh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M¡hjAubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ,``name_off``: offset to a valid C identifier”h]”hÝ)�”}”(hjih]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjkubhŒ : offset to a valid C identifier”…”�”}”(hjkh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M�hjgubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjdubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hjŽh]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hj“h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj�ubhŒ: 0”…”�”}”(hj�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MžhjŒubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjdubj )�”}”(hŒ``info.kind``: BTF_KIND_VAR”h]”hÝ)�”}”(hj³h]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjµubhŒ: BTF_KIND_VAR”…”�”}”(hjµh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MŸhj±ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjdubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hjØh]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÚubhŒ: 0”…”�”}”(hjÚh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hjÖubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjdubj )�”}”(hŒ#``type``: the type of the variable ”h]”hÝ)�”}”(hŒ"``type``: the type of the variable”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÿubhŒ: the type of the variable”…”�”}”(hjÿh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M¡hjûubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjdubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´M�hjaubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjAubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´M¡hj>ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj-h²hh³Nh´NubhÝ)�”}”(hŒV``btf_type`` is followed by a single ``struct btf_variable`` with the following data::”h]”(jß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj9ubhŒ is followed by a single ”…”�”}”(hj9h²hh³Nh´Nubjß)�”}”(hŒ``struct btf_variable``”h]”hŒstruct btf_variable”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj9ubhŒ with the following data:”…”�”}”(hj9h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M£hj-h²hubj)�”}”(hŒ(struct btf_var { __u32 linkage; };”h]”hŒ(struct btf_var { __u32 linkage; };”…”�”}”hjgsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M¦hj-h²hubhÝ)�”}”(hŒ’``btf_var.linkage`` may take the values: BTF_VAR_STATIC, BTF_VAR_GLOBAL_ALLOCATED or BTF_VAR_GLOBAL_EXTERN - see :ref:`BTF_Var_Linkage_Constants`.”h]”(jß)�”}”(hŒ``btf_var.linkage``”h]”hŒbtf_var.linkage”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjuubhŒ^ may take the values: BTF_VAR_STATIC, BTF_VAR_GLOBAL_ALLOCATED or BTF_VAR_GLOBAL_EXTERN - see ”…”�”}”(hjuh²hh³Nh´Nubh)�”}”(hŒ :ref:`BTF_Var_Linkage_Constants`”h]”j…)�”}”(hj�h]”hŒBTF_Var_Linkage_Constants”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”(j�Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j„hj‹ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j�Œ refdomain”j™Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj£Œbtf_var_linkage_constants”uh1hh³hÊh´MªhjuubhŒ.”…”�”}”(hjuh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mªhj-h²hubhÝ)�”}”(hŒkNot all type of global variables are supported by LLVM at this point. The following is currently available:”h]”hŒkNot all type of global variables are supported by LLVM at this point. The following is currently available:”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M­hj-h²hubj…)�”}”(hŒa* static variables with or without section attributes * global variables with section attributes ”h]”j)�”}”(hhh]”(j )�”}”(hŒ3static variables with or without section attributes”h]”hÝ)�”}”(hjÌh]”hŒ3static variables with or without section attributes”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M°hjÊubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÇubj )�”}”(hŒ)global variables with section attributes ”h]”hÝ)�”}”(hŒ(global variables with section attributes”h]”hŒ(global variables with section attributes”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M±hjáubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÇubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´M°hjÃubah}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÊh´M°hj-h²hubhÝ)�”}”(hŒUThe latter is for future extraction of map key/value type id's from a map definition.”h]”hŒWThe latter is for future extraction of map key/value type id’s from a map definition.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M³hj-h²hubeh}”(h]”Œ btf-kind-var”ah ]”h"]”Œ2.2.14 btf_kind_var”ah$]”h&]”uh1hµhj•h²hh³hÊh´Mšubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.15 BTF_KIND_DATASEC”h]”hŒ2.2.15 BTF_KIND_DATASEC”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´M·ubhû)�”}”(hhh]”j)�”}”(hXu``struct btf_type`` encoding requirement: * ``name_off``: offset to a valid name associated with a variable or one of .data/.bss/.rodata * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_DATASEC * ``info.vlen``: # of variables * ``size``: total section size in bytes (0 at compilation time, patched to actual size by BPF loaders such as libbpf) ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj3ubhŒ encoding requirement:”…”�”}”(hj3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MÀhj/ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒj``name_off``: offset to a valid name associated with a variable or one of .data/.bss/.rodata”h]”hû)�”}”(hhh]”j)�”}”(hŒ\``name_off``: offset to a valid name associated with a variable or one of .data/.bss/.rodata”h]”(j)�”}”(hŒB``name_off``: offset to a valid name associated with a variable or”h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj`ubhŒ6: offset to a valid name associated with a variable or”…”�”}”(hj`h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mºhj\ubj)�”}”(hhh]”hÝ)�”}”(hŒone of .data/.bss/.rodata”h]”hŒone of .data/.bss/.rodata”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M»hj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj\ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MºhjYubah}”(h]”h ]”h"]”h$]”h&]”uh1húhjUubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjRubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hj§h]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj©ubhŒ: 0”…”�”}”(hj©h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M¼hj¥ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjRubj )�”}”(hŒ``info.kind``: BTF_KIND_DATASEC”h]”hÝ)�”}”(hjÌh]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hjÑh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÎubhŒ: BTF_KIND_DATASEC”…”�”}”(hjÎh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M½hjÊubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjRubj )�”}”(hŒ``info.vlen``: # of variables”h]”hÝ)�”}”(hjñh]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjóubhŒ: # of variables”…”�”}”(hjóh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M¾hjïubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjRubj )�”}”(hŒ~``size``: total section size in bytes (0 at compilation time, patched to actual size by BPF loaders such as libbpf) ”h]”hû)�”}”(hhh]”j)�”}”(hŒt``size``: total section size in bytes (0 at compilation time, patched to actual size by BPF loaders such as libbpf) ”h]”(j)�”}”(hŒE``size``: total section size in bytes (0 at compilation time, patched”h]”(jß)�”}”(hŒ``size``”h]”hŒsize”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ=: total section size in bytes (0 at compilation time, patched”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MÀhjubj)�”}”(hhh]”hÝ)�”}”(hŒ-to actual size by BPF loaders such as libbpf)”h]”hŒ-to actual size by BPF loaders such as libbpf)”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÀhj;ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MÀhjubah}”(h]”h ]”h"]”h$]”h&]”uh1húhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjRubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´MºhjOubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj/ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MÀhj,ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhjh²hh³Nh´NubhÝ)�”}”(hŒQ``btf_type`` is followed by ``info.vlen`` number of ``struct btf_var_secinfo``.::”h]”(jß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj|ubhŒ is followed by ”…”�”}”(hj|h²hh³Nh´Nubjß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj|ubhŒ number of ”…”�”}”(hj|h²hh³Nh´Nubjß)�”}”(hŒ``struct btf_var_secinfo``”h]”hŒstruct btf_var_secinfo”…”�”}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj|ubhŒ.:”…”�”}”(hj|h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÂhjh²hubj)�”}”(hŒSstruct btf_var_secinfo { __u32 type; __u32 offset; __u32 size; };”h]”hŒSstruct btf_var_secinfo { __u32 type; __u32 offset; __u32 size; };”…”�”}”hj¼sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MÄhjh²hubhû)�”}”(hhh]”j)�”}”(hŒ¹``struct btf_var_secinfo`` encoding: * ``type``: the type of the BTF_KIND_VAR variable * ``offset``: the in-section offset of the variable * ``size``: the size of the variable in bytes ”h]”(j)�”}”(hŒ$``struct btf_var_secinfo`` encoding:”h]”(jß)�”}”(hŒ``struct btf_var_secinfo``”h]”hŒstruct btf_var_secinfo”…”�”}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÑubhŒ encoding:”…”�”}”(hjÑh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MÍhjÍubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ/``type``: the type of the BTF_KIND_VAR variable”h]”hÝ)�”}”(hjõh]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj÷ubhŒ': the type of the BTF_KIND_VAR variable”…”�”}”(hj÷h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MËhjóubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjðubj )�”}”(hŒ1``offset``: the in-section offset of the variable”h]”hÝ)�”}”(hjh]”(jß)�”}”(hŒ ``offset``”h]”hŒoffset”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjubhŒ': the in-section offset of the variable”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÌhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjðubj )�”}”(hŒ,``size``: the size of the variable in bytes ”h]”hÝ)�”}”(hŒ+``size``: the size of the variable in bytes”h]”(jß)�”}”(hŒ``size``”h]”hŒsize”…”�”}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjAubhŒ#: the size of the variable in bytes”…”�”}”(hjAh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÍhj=ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjðubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´MËhjíubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÍubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MÍhjÊubah}”(h]”h ]”h"]”h$]”h&]”uh1húhjh²hh³Nh´Nubeh}”(h]”Œbtf-kind-datasec”ah ]”h"]”Œ2.2.15 btf_kind_datasec”ah$]”h&]”uh1hµhj•h²hh³hÊh´M·ubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.16 BTF_KIND_FLOAT”h]”hŒ2.2.16 BTF_KIND_FLOAT”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjƒh²hh³hÊh´MÐubhû)�”}”(hhh]”j)�”}”(hŒÚ``struct btf_type`` encoding requirement: * ``name_off``: any valid offset * ``info.kind_flag``: 0 * ``info.kind``: BTF_KIND_FLOAT * ``info.vlen``: 0 * ``size``: the size of the float type in bytes: 2, 4, 8, 12 or 16. ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj›ubhŒ encoding requirement:”…”�”}”(hj›h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M×hj—ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ``name_off``: any valid offset”h]”hÝ)�”}”(hj¿h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÁubhŒ: any valid offset”…”�”}”(hjÁh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÓhj½ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjºubj )�”}”(hŒ``info.kind_flag``: 0”h]”hÝ)�”}”(hjäh]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjæubhŒ: 0”…”�”}”(hjæh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÔhjâubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjºubj )�”}”(hŒ``info.kind``: BTF_KIND_FLOAT”h]”hÝ)�”}”(hj h]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj ubhŒ: BTF_KIND_FLOAT”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÕhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjºubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hj. h]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj3 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj0 ubhŒ: 0”…”�”}”(hj0 h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÖhj, ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjºubj )�”}”(hŒB``size``: the size of the float type in bytes: 2, 4, 8, 12 or 16. ”h]”hÝ)�”}”(hŒA``size``: the size of the float type in bytes: 2, 4, 8, 12 or 16.”h]”(jß)�”}”(hŒ``size``”h]”hŒsize”…”�”}”(hjY h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU ubhŒ9: the size of the float type in bytes: 2, 4, 8, 12 or 16.”…”�”}”(hjU h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M×hjQ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjºubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´MÓhj·ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj—ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´M×hj”ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhjƒh²hh³Nh´NubhÝ)�”}”(hŒ,No additional type data follow ``btf_type``.”h]”(hŒNo additional type data follow ”…”�”}”(hj� h²hh³Nh´Nubjß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hj— h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj� ubhŒ.”…”�”}”(hj� h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÙhjƒh²hubeh}”(h]”Œbtf-kind-float”ah ]”h"]”Œ2.2.16 btf_kind_float”ah$]”h&]”uh1hµhj•h²hh³hÊh´MÐubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.17 BTF_KIND_DECL_TAG”h]”hŒ2.2.17 BTF_KIND_DECL_TAG”…”�”}”(hjº h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj· h²hh³hÊh´MÜubhû)�”}”(hhh]”j)�”}”(hŒî``struct btf_type`` encoding requirement: * ``name_off``: offset to a non-empty string * ``info.kind_flag``: 0 or 1 * ``info.kind``: BTF_KIND_DECL_TAG * ``info.vlen``: 0 * ``type``: ``struct``, ``union``, ``func``, ``var`` or ``typedef`` ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hjÓ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÏ ubhŒ encoding requirement:”…”�”}”(hjÏ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MãhjË ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ*``name_off``: offset to a non-empty string”h]”hÝ)�”}”(hjó h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjø h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjõ ubhŒ: offset to a non-empty string”…”�”}”(hjõ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mßhjñ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjî ubj )�”}”(hŒ``info.kind_flag``: 0 or 1”h]”hÝ)�”}”(hj!h]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj!ubhŒ: 0 or 1”…”�”}”(hj!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Màhj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjî ubj )�”}”(hŒ ``info.kind``: BTF_KIND_DECL_TAG”h]”hÝ)�”}”(hj=!h]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hjB!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj?!ubhŒ: BTF_KIND_DECL_TAG”…”�”}”(hj?!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Máhj;!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjî ubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hjb!h]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjg!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjd!ubhŒ: 0”…”�”}”(hjd!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mâhj`!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjî ubj )�”}”(hŒB``type``: ``struct``, ``union``, ``func``, ``var`` or ``typedef`` ”h]”hÝ)�”}”(hŒA``type``: ``struct``, ``union``, ``func``, ``var`` or ``typedef``”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hj�!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj‰!ubhŒ: ”…”�”}”(hj‰!h²hh³Nh´Nubjß)�”}”(hŒ ``struct``”h]”hŒstruct”…”�”}”(hjŸ!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj‰!ubhŒ, ”…”�”}”(hj‰!h²hh³Nh´Nubjß)�”}”(hŒ ``union``”h]”hŒunion”…”�”}”(hj±!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj‰!ubhŒ, ”…”�”}”hj‰!sbjß)�”}”(hŒ``func``”h]”hŒfunc”…”�”}”(hjÃ!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj‰!ubhŒ, ”…”�”}”hj‰!sbjß)�”}”(hŒ``var``”h]”hŒvar”…”�”}”(hjÕ!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj‰!ubhŒ or ”…”�”}”(hj‰!h²hh³Nh´Nubjß)�”}”(hŒ ``typedef``”h]”hŒtypedef”…”�”}”(hjç!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj‰!ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mãhj…!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjî ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´Mßhjë ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjË ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MãhjÈ ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj· h²hh³Nh´NubhÝ)�”}”(hŒ6``btf_type`` is followed by ``struct btf_decl_tag``.::”h]”(jß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj"ubhŒ is followed by ”…”�”}”(hj"h²hh³Nh´Nubjß)�”}”(hŒ``struct btf_decl_tag``”h]”hŒstruct btf_decl_tag”…”�”}”(hj/"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj"ubhŒ.:”…”�”}”(hj"h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Måhj· h²hubj)�”}”(hŒ3struct btf_decl_tag { __u32 component_idx; };”h]”hŒ3struct btf_decl_tag { __u32 component_idx; };”…”�”}”hjG"sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´Mçhj· h²hubhÝ)�”}”(hXThe ``type`` should be ``struct``, ``union``, ``func``, ``var`` or ``typedef``. For ``var`` or ``typedef`` type, ``btf_decl_tag.component_idx`` must be ``-1``. For the other three types, if the btf_decl_tag attribute is applied to the ``struct``, ``union`` or ``func`` itself, ``btf_decl_tag.component_idx`` must be ``-1``. Otherwise, the attribute is applied to a ``struct``/``union`` member or a ``func`` argument, and ``btf_decl_tag.component_idx`` should be a valid index (starting from 0) pointing to a member or an argument.”h]”(hŒThe ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hj]"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ should be ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ ``struct``”h]”hŒstruct”…”�”}”(hjo"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ, ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ ``union``”h]”hŒunion”…”�”}”(hj�"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ, ”…”�”}”hjU"sbjß)�”}”(hŒ``func``”h]”hŒfunc”…”�”}”(hj“"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ, ”…”�”}”hjU"sbjß)�”}”(hŒ``var``”h]”hŒvar”…”�”}”(hj¥"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ or ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ ``typedef``”h]”hŒtypedef”…”�”}”(hj·"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ. For ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ``var``”h]”hŒvar”…”�”}”(hjÉ"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ or ”…”�”}”hjU"sbjß)�”}”(hŒ ``typedef``”h]”hŒtypedef”…”�”}”(hjÛ"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ type, ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ``btf_decl_tag.component_idx``”h]”hŒbtf_decl_tag.component_idx”…”�”}”(hjí"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ must be ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ``-1``”h]”hŒ-1”…”�”}”(hjÿ"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒM. For the other three types, if the btf_decl_tag attribute is applied to the ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ ``struct``”h]”hŒstruct”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ, ”…”�”}”hjU"sbjß)�”}”(hŒ ``union``”h]”hŒunion”…”�”}”(hj##h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ or ”…”�”}”hjU"sbjß)�”}”(hŒ``func``”h]”hŒfunc”…”�”}”(hj5#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ itself, ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ``btf_decl_tag.component_idx``”h]”hŒbtf_decl_tag.component_idx”…”�”}”(hjG#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ must be ”…”�”}”hjU"sbjß)�”}”(hŒ``-1``”h]”hŒ-1”…”�”}”(hjY#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ+. Otherwise, the attribute is applied to a ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ ``struct``”h]”hŒstruct”…”�”}”(hjk#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ/”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ ``union``”h]”hŒunion”…”�”}”(hj}#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ member or a ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ``func``”h]”hŒfunc”…”�”}”(hj�#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒ argument, and ”…”�”}”(hjU"h²hh³Nh´Nubjß)�”}”(hŒ``btf_decl_tag.component_idx``”h]”hŒbtf_decl_tag.component_idx”…”�”}”(hj¡#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjU"ubhŒO should be a valid index (starting from 0) pointing to a member or an argument.”…”�”}”(hjU"h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mëhj· h²hubhÝ)�”}”(hŒwIf ``info.kind_flag`` is 0, then this is a normal decl tag, and the ``name_off`` encodes btf_decl_tag attribute string.”h]”(hŒIf ”…”�”}”(hj¹#h²hh³Nh´Nubjß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjÁ#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¹#ubhŒ/ is 0, then this is a normal decl tag, and the ”…”�”}”(hj¹#h²hh³Nh´Nubjß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjÓ#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¹#ubhŒ' encodes btf_decl_tag attribute string.”…”�”}”(hj¹#h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Môhj· h²hubhÝ)�”}”(hXIf ``info.kind_flag`` is 1, then the decl tag represents an arbitrary __attribute__. In this case, ``name_off`` encodes a string representing the attribute-list of the attribute specifier. For example, for an ``__attribute__((aligned(4)))`` the string's contents is ``aligned(4)``.”h]”(hŒIf ”…”�”}”(hjë#h²hh³Nh´Nubjß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjó#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjë#ubhŒN is 1, then the decl tag represents an arbitrary __attribute__. In this case, ”…”�”}”(hjë#h²hh³Nh´Nubjß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjë#ubhŒb encodes a string representing the attribute-list of the attribute specifier. For example, for an ”…”�”}”(hjë#h²hh³Nh´Nubjß)�”}”(hŒ``__attribute__((aligned(4)))``”h]”hŒ__attribute__((aligned(4)))”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjë#ubhŒ the string’s contents is ”…”�”}”(hjë#h²hh³Nh´Nubjß)�”}”(hŒ``aligned(4)``”h]”hŒ aligned(4)”…”�”}”(hj)$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjë#ubhŒ.”…”�”}”(hjë#h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M÷hj· h²hubeh}”(h]”Œbtf-kind-decl-tag”ah ]”h"]”Œ2.2.17 btf_kind_decl_tag”ah$]”h&]”uh1hµhj•h²hh³hÊh´MÜubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.18 BTF_KIND_TYPE_TAG”h]”hŒ2.2.18 BTF_KIND_TYPE_TAG”…”�”}”(hjL$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjI$h²hh³hÊh´Mþubhû)�”}”(hhh]”j)�”}”(hŒß``struct btf_type`` encoding requirement: * ``name_off``: offset to a non-empty string * ``info.kind_flag``: 0 or 1 * ``info.kind``: BTF_KIND_TYPE_TAG * ``info.vlen``: 0 * ``type``: the type with ``btf_type_tag`` attribute ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hje$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhja$ubhŒ encoding requirement:”…”�”}”(hja$h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mhj]$ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ*``name_off``: offset to a non-empty string”h]”hÝ)�”}”(hj…$h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjŠ$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj‡$ubhŒ: offset to a non-empty string”…”�”}”(hj‡$h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhjƒ$ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj€$ubj )�”}”(hŒ``info.kind_flag``: 0 or 1”h]”hÝ)�”}”(hjª$h]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hj¯$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¬$ubhŒ: 0 or 1”…”�”}”(hj¬$h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj¨$ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj€$ubj )�”}”(hŒ ``info.kind``: BTF_KIND_TYPE_TAG”h]”hÝ)�”}”(hjÏ$h]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hjÔ$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÑ$ubhŒ: BTF_KIND_TYPE_TAG”…”�”}”(hjÑ$h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjÍ$ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj€$ubj )�”}”(hŒ``info.vlen``: 0”h]”hÝ)�”}”(hjô$h]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hjù$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjö$ubhŒ: 0”…”�”}”(hjö$h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhjò$ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj€$ubj )�”}”(hŒ3``type``: the type with ``btf_type_tag`` attribute ”h]”hÝ)�”}”(hŒ2``type``: the type with ``btf_type_tag`` attribute”h]”(jß)�”}”(hŒ``type``”h]”hŒtype”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj%ubhŒ: the type with ”…”�”}”(hj%h²hh³Nh´Nubjß)�”}”(hŒ``btf_type_tag``”h]”hŒ btf_type_tag”…”�”}”(hj1%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj%ubhŒ attribute”…”�”}”(hj%h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj%ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj€$ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´Mhj}$ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj]$ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MhjZ$ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhjI$h²hh³Nh´NubhÝ)�”}”(hŒkCurrently, ``BTF_KIND_TYPE_TAG`` is only emitted for pointer types. It has the following btf type chain: ::”h]”(hŒ Currently, ”…”�”}”(hjg%h²hh³Nh´Nubjß)�”}”(hŒ``BTF_KIND_TYPE_TAG``”h]”hŒBTF_KIND_TYPE_TAG”…”�”}”(hjo%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjg%ubhŒH is only emitted for pointer types. It has the following btf type chain:”…”�”}”(hjg%h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjI$h²hubj)�”}”(hŒSptr -> [type_tag]* -> [const | volatile | restrict | typedef]* -> base_type”h]”hŒSptr -> [type_tag]* -> [const | volatile | restrict | typedef]* -> base_type”…”�”}”hj‡%sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M hjI$h²hubhÝ)�”}”(hŒáBasically, a pointer type points to zero or more type_tag, then zero or more const/volatile/restrict/typedef and finally the base type. The base type is one of int, ptr, array, struct, union, enum, func_proto and float types.”h]”hŒáBasically, a pointer type points to zero or more type_tag, then zero or more const/volatile/restrict/typedef and finally the base type. The base type is one of int, ptr, array, struct, union, enum, func_proto and float types.”…”�”}”(hj•%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjI$h²hubhÝ)�”}”(hŒ“Similarly to decl tags, if the ``info.kind_flag`` is 0, then this is a normal type tag, and the ``name_off`` encodes btf_type_tag attribute string.”h]”(hŒSimilarly to decl tags, if the ”…”�”}”(hj£%h²hh³Nh´Nubjß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hj«%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj£%ubhŒ/ is 0, then this is a normal type tag, and the ”…”�”}”(hj£%h²hh³Nh´Nubjß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hj½%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj£%ubhŒ' encodes btf_type_tag attribute string.”…”�”}”(hj£%h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjI$h²hubhÝ)�”}”(hŒ¶If ``info.kind_flag`` is 1, then the type tag represents an arbitrary __attribute__, and the ``name_off`` encodes a string representing the attribute-list of the attribute specifier.”h]”(hŒIf ”…”�”}”(hjÕ%h²hh³Nh´Nubjß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hjÝ%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÕ%ubhŒH is 1, then the type tag represents an arbitrary __attribute__, and the ”…”�”}”(hjÕ%h²hh³Nh´Nubjß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjï%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÕ%ubhŒM encodes a string representing the attribute-list of the attribute specifier.”…”�”}”(hjÕ%h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjI$h²hubeh}”(h]”Œbtf-kind-type-tag”ah ]”h"]”Œ2.2.18 btf_kind_type_tag”ah$]”h&]”uh1hµhj•h²hh³hÊh´Mþubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.2.19 BTF_KIND_ENUM64”h]”hŒ2.2.19 BTF_KIND_ENUM64”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj&h²hh³hÊh´Mubhû)�”}”(hhh]”j)�”}”(hŒí``struct btf_type`` encoding requirement: * ``name_off``: 0 or offset to a valid C identifier * ``info.kind_flag``: 0 for unsigned, 1 for signed * ``info.kind``: BTF_KIND_ENUM64 * ``info.vlen``: number of enum values * ``size``: 1/2/4/8 ”h]”(j)�”}”(hŒ)``struct btf_type`` encoding requirement:”h]”(jß)�”}”(hŒ``struct btf_type``”h]”hŒstruct btf_type”…”�”}”(hj+&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj'&ubhŒ encoding requirement:”…”�”}”(hj'&h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M$hj#&ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ1``name_off``: 0 or offset to a valid C identifier”h]”hÝ)�”}”(hjK&h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hjP&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjM&ubhŒ%: 0 or offset to a valid C identifier”…”�”}”(hjM&h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hjI&ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjF&ubj )�”}”(hŒ0``info.kind_flag``: 0 for unsigned, 1 for signed”h]”hÝ)�”}”(hjp&h]”(jß)�”}”(hŒ``info.kind_flag``”h]”hŒinfo.kind_flag”…”�”}”(hju&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjr&ubhŒ: 0 for unsigned, 1 for signed”…”�”}”(hjr&h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M!hjn&ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjF&ubj )�”}”(hŒ``info.kind``: BTF_KIND_ENUM64”h]”hÝ)�”}”(hj•&h]”(jß)�”}”(hŒ ``info.kind``”h]”hŒ info.kind”…”�”}”(hjš&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj—&ubhŒ: BTF_KIND_ENUM64”…”�”}”(hj—&h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M"hj“&ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjF&ubj )�”}”(hŒ$``info.vlen``: number of enum values”h]”hÝ)�”}”(hjº&h]”(jß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj¿&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¼&ubhŒ: number of enum values”…”�”}”(hj¼&h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M#hj¸&ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjF&ubj )�”}”(hŒ``size``: 1/2/4/8 ”h]”hÝ)�”}”(hŒ``size``: 1/2/4/8”h]”(jß)�”}”(hŒ``size``”h]”hŒsize”…”�”}”(hjå&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjá&ubhŒ : 1/2/4/8”…”�”}”(hjá&h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M$hjÝ&ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjF&ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´M hjC&ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj#&ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´M$hj &ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj&h²hh³Nh´NubhÝ)�”}”(hŒL``btf_type`` is followed by ``info.vlen`` number of ``struct btf_enum64``.::”h]”(jß)�”}”(hŒ ``btf_type``”h]”hŒbtf_type”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj'ubhŒ is followed by ”…”�”}”(hj'h²hh³Nh´Nubjß)�”}”(hŒ ``info.vlen``”h]”hŒ info.vlen”…”�”}”(hj1'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj'ubhŒ number of ”…”�”}”(hj'h²hh³Nh´Nubjß)�”}”(hŒ``struct btf_enum64``”h]”hŒstruct btf_enum64”…”�”}”(hjC'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj'ubhŒ.:”…”�”}”(hj'h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M&hj&h²hubj)�”}”(hŒXstruct btf_enum64 { __u32 name_off; __u32 val_lo32; __u32 val_hi32; };”h]”hŒXstruct btf_enum64 { __u32 name_off; __u32 val_lo32; __u32 val_hi32; };”…”�”}”hj['sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M(hj&h²hubhû)�”}”(hhh]”j)�”}”(hŒ·The ``btf_enum64`` encoding: * ``name_off``: offset to a valid C identifier * ``val_lo32``: lower 32-bit value for a 64-bit value * ``val_hi32``: high 32-bit value for a 64-bit value ”h]”(j)�”}”(hŒThe ``btf_enum64`` encoding:”h]”(hŒThe ”…”�”}”(hjp'h²hh³Nh´Nubjß)�”}”(hŒ``btf_enum64``”h]”hŒ btf_enum64”…”�”}”(hjx'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjp'ubhŒ encoding:”…”�”}”(hjp'h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M1hjl'ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ,``name_off``: offset to a valid C identifier”h]”hÝ)�”}”(hj˜'h]”(jß)�”}”(hŒ ``name_off``”h]”hŒname_off”…”�”}”(hj�'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjš'ubhŒ : offset to a valid C identifier”…”�”}”(hjš'h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M/hj–'ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj“'ubj )�”}”(hŒ3``val_lo32``: lower 32-bit value for a 64-bit value”h]”hÝ)�”}”(hj½'h]”(jß)�”}”(hŒ ``val_lo32``”h]”hŒval_lo32”…”�”}”(hjÂ'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¿'ubhŒ': lower 32-bit value for a 64-bit value”…”�”}”(hj¿'h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M0hj»'ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj“'ubj )�”}”(hŒ3``val_hi32``: high 32-bit value for a 64-bit value ”h]”hÝ)�”}”(hŒ2``val_hi32``: high 32-bit value for a 64-bit value”h]”(jß)�”}”(hŒ ``val_hi32``”h]”hŒval_hi32”…”�”}”(hjè'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjä'ubhŒ&: high 32-bit value for a 64-bit value”…”�”}”(hjä'h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M1hjà'ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj“'ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´M/hj�'ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjl'ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´M1hji'ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj&h²hh³Nh´NubhÝ)�”}”(hŒpIf the original enum value is signed and the size is less than 8, that value will be sign extended into 8 bytes.”h]”hŒpIf the original enum value is signed and the size is less than 8, that value will be sign extended into 8 bytes.”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M3hj&h²hubeh}”(h]”Œbtf-kind-enum64”ah ]”h"]”Œ2.2.19 btf_kind_enum64”ah$]”h&]”uh1hµhj•h²hh³hÊh´Mubeh}”(h]”Œ type-encoding”ah ]”h"]”Œ2.2 type encoding”ah$]”h&]”uh1hµhjÅh²hh³hÊh´KBubh¶)�”}”(hhh]”(h»)�”}”(hŒ2.3 Constant Values”h]”hŒ2.3 Constant Values”…”�”}”(hj?(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj<(h²hh³hÊh´M7ubj°)�”}”(hŒ#.. _BTF_Function_Linkage_Constants:”h]”h}”(h]”h ]”h"]”h$]”h&]”j»Œbtf-function-linkage-constants”uh1j¯h´M9hj<(h²hh³hÊubh¶)�”}”(hhh]”(h»)�”}”(hŒ&2.3.1 Function Linkage Constant Values”h]”hŒ&2.3.1 Function Linkage Constant Values”…”�”}”(hj[(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjX(h²hh³hÊh´M<ubhŒtable”“”)�”}”(hhh]”(h»)�”}”(hŒ$Function Linkage Values and Meanings”h]”hŒ$Function Linkage Values and Meanings”…”�”}”(hjn(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºh³hÊh´M=hjk(ubhŒtgroup”“”)�”}”(hhh]”(hŒcolspec”“”)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1j�(hj~(ubj‚()�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1j�(hj~(ubj‚()�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”KWuh1j�(hj~(ubhŒthead”“”)�”}”(hhh]”hŒrow”“”)�”}”(hhh]”(hŒentry”“”)�”}”(hhh]”hÝ)�”}”(hŒkind”h]”hŒkind”…”�”}”(hj°(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M@hj­(ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj¨(ubj¬()�”}”(hhh]”hÝ)�”}”(hŒvalue”h]”hŒvalue”…”�”}”(hjÇ(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M@hjÄ(ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj¨(ubj¬()�”}”(hhh]”hÝ)�”}”(hŒ description”h]”hŒ description”…”�”}”(hjÞ(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M@hjÛ(ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj¨(ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¦(hj£(ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¡(hj~(ubhŒtbody”“”)�”}”(hhh]”(j§()�”}”(hhh]”(j¬()�”}”(hhh]”hÝ)�”}”(hŒ``BTF_FUNC_STATIC``”h]”jß)�”}”(hj )h]”hŒBTF_FUNC_STATIC”…”�”}”(hj )h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj )ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MBhj)ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj)ubj¬()�”}”(hhh]”hÝ)�”}”(hŒ0x0”h]”hŒ0x0”…”�”}”(hj))h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MBhj&)ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj)ubj¬()�”}”(hhh]”hÝ)�”}”(hŒHdefinition of subprogram not visible outside containing compilation unit”h]”hŒHdefinition of subprogram not visible outside containing compilation unit”…”�”}”(hj@)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MBhj=)ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj)ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¦(hj)ubj§()�”}”(hhh]”(j¬()�”}”(hhh]”hÝ)�”}”(hŒ``BTF_FUNC_GLOBAL``”h]”jß)�”}”(hjb)h]”hŒBTF_FUNC_GLOBAL”…”�”}”(hjd)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj`)ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MChj])ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hjZ)ubj¬()�”}”(hhh]”hÝ)�”}”(hŒ0x1”h]”hŒ0x1”…”�”}”(hj€)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MChj})ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hjZ)ubj¬()�”}”(hhh]”hÝ)�”}”(hŒDdefinition of subprogram visible outside containing compilation unit”h]”hŒDdefinition of subprogram visible outside containing compilation unit”…”�”}”(hj—)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MChj”)ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hjZ)ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¦(hj)ubj§()�”}”(hhh]”(j¬()�”}”(hhh]”hÝ)�”}”(hŒ``BTF_FUNC_EXTERN``”h]”jß)�”}”(hj¹)h]”hŒBTF_FUNC_EXTERN”…”�”}”(hj»)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj·)ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MDhj´)ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj±)ubj¬()�”}”(hhh]”hÝ)�”}”(hŒ0x2”h]”hŒ0x2”…”�”}”(hj×)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MDhjÔ)ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj±)ubj¬()�”}”(hhh]”hÝ)�”}”(hŒWdeclaration of a subprogram whose definition is outside the containing compilation unit”h]”hŒWdeclaration of a subprogram whose definition is outside the containing compilation unit”…”�”}”(hjî)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MDhjë)ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj±)ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¦(hj)ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jþ(hj~(ubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1j|(hjk(ubeh}”(h]”Œid3”ah ]”h"]”h$]”h&]”uh1ji(hjX(h²hh³hÊh´Nubj°)�”}”(hŒ.. _BTF_Var_Linkage_Constants:”h]”h}”(h]”h ]”h"]”h$]”h&]”j»Œbtf-var-linkage-constants”uh1j¯h´MHhjX(h²hh³hÊubeh}”(h]”(Œ function-linkage-constant-values”jW(eh ]”h"]”(Œ&2.3.1 function linkage constant values”Œbtf_function_linkage_constants”eh$]”h&]”uh1hµhj<(h²hh³hÊh´M<Œexpect_referenced_by_name”}”j-*jM(sŒexpect_referenced_by_id”}”jW(jM(subh¶)�”}”(hhh]”(h»)�”}”(hŒ&2.3.2 Variable Linkage Constant Values”h]”hŒ&2.3.2 Variable Linkage Constant Values”…”�”}”(hj7*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj4*h²hh³hÊh´MKubjj()�”}”(hhh]”(h»)�”}”(hŒ$Variable Linkage Values and Meanings”h]”hŒ$Variable Linkage Values and Meanings”…”�”}”(hjH*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºh³hÊh´MLhjE*ubj}()�”}”(hhh]”(j‚()�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1j�(hjV*ubj‚()�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1j�(hjV*ubj‚()�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”KZuh1j�(hjV*ubj¢()�”}”(hhh]”j§()�”}”(hhh]”(j¬()�”}”(hhh]”hÝ)�”}”(hŒkind”h]”hŒkind”…”�”}”(hj€*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MOhj}*ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hjz*ubj¬()�”}”(hhh]”hÝ)�”}”(hŒvalue”h]”hŒvalue”…”�”}”(hj—*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MOhj”*ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hjz*ubj¬()�”}”(hhh]”hÝ)�”}”(hŒ description”h]”hŒ description”…”�”}”(hj®*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MOhj«*ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hjz*ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¦(hjw*ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¡(hjV*ubjÿ()�”}”(hhh]”(j§()�”}”(hhh]”(j¬()�”}”(hhh]”hÝ)�”}”(hŒ``BTF_VAR_STATIC``”h]”jß)�”}”(hjÙ*h]”hŒBTF_VAR_STATIC”…”�”}”(hjÛ*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj×*ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MQhjÔ*ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hjÑ*ubj¬()�”}”(hhh]”hÝ)�”}”(hŒ0x0”h]”hŒ0x0”…”�”}”(hj÷*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MQhjô*ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hjÑ*ubj¬()�”}”(hhh]”hÝ)�”}”(hŒMdefinition of global variable not visible outside containing compilation unit”h]”hŒMdefinition of global variable not visible outside containing compilation unit”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MQhj +ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hjÑ*ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¦(hjÎ*ubj§()�”}”(hhh]”(j¬()�”}”(hhh]”hÝ)�”}”(hŒ``BTF_VAR_GLOBAL_ALLOCATED``”h]”jß)�”}”(hj0+h]”hŒBTF_VAR_GLOBAL_ALLOCATED”…”�”}”(hj2+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj.+ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MRhj++ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj(+ubj¬()�”}”(hhh]”hÝ)�”}”(hŒ0x1”h]”hŒ0x1”…”�”}”(hjN+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MRhjK+ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj(+ubj¬()�”}”(hhh]”hÝ)�”}”(hŒIdefinition of global variable visible outside containing compilation unit”h]”hŒIdefinition of global variable visible outside containing compilation unit”…”�”}”(hje+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MRhjb+ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj(+ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¦(hjÎ*ubj§()�”}”(hhh]”(j¬()�”}”(hhh]”hÝ)�”}”(hŒ``BTF_VAR_GLOBAL_EXTERN``”h]”jß)�”}”(hj‡+h]”hŒBTF_VAR_GLOBAL_EXTERN”…”�”}”(hj‰+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj…+ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MShj‚+ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj+ubj¬()�”}”(hhh]”hÝ)�”}”(hŒ0x2”h]”hŒ0x2”…”�”}”(hj¥+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MShj¢+ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj+ubj¬()�”}”(hhh]”hÝ)�”}”(hŒZdeclaration of global variable whose definition is outside the containing compilation unit”h]”hŒZdeclaration of global variable whose definition is outside the containing compilation unit”…”�”}”(hj¼+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MShj¹+ubah}”(h]”h ]”h"]”h$]”h&]”uh1j«(hj+ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¦(hjÎ*ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jþ(hjV*ubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1j|(hjE*ubeh}”(h]”Œid4”ah ]”h"]”h$]”h&]”uh1ji(hj4*h²hh³hÊh´Nubeh}”(h]”(Œ variable-linkage-constant-values”j&*eh ]”h"]”(Œ&2.3.2 variable linkage constant values”Œbtf_var_linkage_constants”eh$]”h&]”uh1hµhj<(h²hh³hÊh´MKj0*}”jð+j*sj2*}”j&*j*subeh}”(h]”Œconstant-values”ah ]”h"]”Œ2.3 constant values”ah$]”h&]”uh1hµhjÅh²hh³hÊh´M7ubeh}”(h]”(Œbtf-type-and-string-encoding”j¼eh ]”h"]”(Œ2. btf type and string encoding”Œbtf_type_string”eh$]”h&]”uh1hµhh·h²hh³hÊh´K!j0*}”j,j±sj2*}”j¼j±subh¶)�”}”(hhh]”(h»)�”}”(hŒ3. BTF Kernel API”h]”hŒ3. BTF Kernel API”…”�”}”(hj ,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj,h²hh³hÊh´MWubhû)�”}”(hhh]”j)�”}”(hXeThe following bpf syscall command involves BTF: * BPF_BTF_LOAD: load a blob of BTF data into kernel * BPF_MAP_CREATE: map creation with btf key and value type info. * BPF_PROG_LOAD: prog load with btf function and line info. * BPF_BTF_GET_FD_BY_ID: get a btf fd * BPF_OBJ_GET_INFO_BY_FD: btf, func_info, line_info and other btf related info are returned. ”h]”(j)�”}”(hŒ/The following bpf syscall command involves BTF:”h]”hŒ/The following bpf syscall command involves BTF:”…”�”}”(hj ,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M_hj,ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ1BPF_BTF_LOAD: load a blob of BTF data into kernel”h]”hÝ)�”}”(hj6,h]”hŒ1BPF_BTF_LOAD: load a blob of BTF data into kernel”…”�”}”(hj8,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MZhj4,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj1,ubj )�”}”(hŒ>BPF_MAP_CREATE: map creation with btf key and value type info.”h]”hÝ)�”}”(hjM,h]”hŒ>BPF_MAP_CREATE: map creation with btf key and value type info.”…”�”}”(hjO,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M[hjK,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj1,ubj )�”}”(hŒ9BPF_PROG_LOAD: prog load with btf function and line info.”h]”hÝ)�”}”(hjd,h]”hŒ9BPF_PROG_LOAD: prog load with btf function and line info.”…”�”}”(hjf,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M\hjb,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj1,ubj )�”}”(hŒ"BPF_BTF_GET_FD_BY_ID: get a btf fd”h]”hÝ)�”}”(hj{,h]”hŒ"BPF_BTF_GET_FD_BY_ID: get a btf fd”…”�”}”(hj},h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M]hjy,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj1,ubj )�”}”(hŒ[BPF_OBJ_GET_INFO_BY_FD: btf, func_info, line_info and other btf related info are returned. ”h]”hÝ)�”}”(hŒZBPF_OBJ_GET_INFO_BY_FD: btf, func_info, line_info and other btf related info are returned.”h]”hŒZBPF_OBJ_GET_INFO_BY_FD: btf, func_info, line_info and other btf related info are returned.”…”�”}”(hj”,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M^hj�,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj1,ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´MZhj.,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj,ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´M_hj,ubah}”(h]”h ]”h"]”h$]”h&]”uh1húhj,h²hh³Nh´NubhÝ)�”}”(hŒ%The workflow typically looks like: ::”h]”hŒ"The workflow typically looks like:”…”�”}”(hjÀ,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mahj,h²hubj)�”}”(hX-Application: BPF_BTF_LOAD | v BPF_MAP_CREATE and BPF_PROG_LOAD | V ...... Introspection tool: ...... BPF_{PROG,MAP}_GET_NEXT_ID (get prog/map id's) | V BPF_{PROG,MAP}_GET_FD_BY_ID (get a prog/map fd) | V BPF_OBJ_GET_INFO_BY_FD (get bpf_prog_info/bpf_map_info with btf_id) | | V | BPF_BTF_GET_FD_BY_ID (get btf_fd) | | | V | BPF_OBJ_GET_INFO_BY_FD (get btf) | | | V V pretty print types, dump func signatures and line info, etc.”•!h]”hX-Application: BPF_BTF_LOAD | v BPF_MAP_CREATE and BPF_PROG_LOAD | V ...... Introspection tool: ...... BPF_{PROG,MAP}_GET_NEXT_ID (get prog/map id's) | V BPF_{PROG,MAP}_GET_FD_BY_ID (get a prog/map fd) | V BPF_OBJ_GET_INFO_BY_FD (get bpf_prog_info/bpf_map_info with btf_id) | | V | BPF_BTF_GET_FD_BY_ID (get btf_fd) | | | V | BPF_OBJ_GET_INFO_BY_FD (get btf) | | | V V pretty print types, dump func signatures and line info, etc.”…”�”}”hjÎ,sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´Mdhj,h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒ3.1 BPF_BTF_LOAD”h]”hŒ3.1 BPF_BTF_LOAD”…”�”}”(hjß,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÜ,h²hh³hÊh´M‚ubhÝ)�”}”(hŒªLoad a blob of BTF data into kernel. A blob of data, described in :ref:`BTF_Type_String`, can be directly loaded into the kernel. A ``btf_fd`` is returned to a userspace.”h]”(hŒBLoad a blob of BTF data into kernel. A blob of data, described in ”…”�”}”(hjí,h²hh³Nh´Nubh)�”}”(hŒ:ref:`BTF_Type_String`”h]”j…)�”}”(hj÷,h]”hŒBTF_Type_String”…”�”}”(hjù,h²hh³Nh´Nubah}”(h]”h ]”(j�Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j„hjõ,ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j�Œ refdomain”j-Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj£Œbtf_type_string”uh1hh³hÊh´M„hjí,ubhŒ,, can be directly loaded into the kernel. A ”…”�”}”(hjí,h²hh³Nh´Nubjß)�”}”(hŒ ``btf_fd``”h]”hŒbtf_fd”…”�”}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjí,ubhŒ is returned to a userspace.”…”�”}”(hjí,h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M„hjÜ,h²hubeh}”(h]”Œ bpf-btf-load”ah ]”h"]”Œ3.1 bpf_btf_load”ah$]”h&]”uh1hµhj,h²hh³hÊh´M‚ubh¶)�”}”(hhh]”(h»)�”}”(hŒ3.2 BPF_MAP_CREATE”h]”hŒ3.2 BPF_MAP_CREATE”…”�”}”(hj<-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj9-h²hh³hÊh´M‰ubhÝ)�”}”(hŒGA map can be created with ``btf_fd`` and specified key/value type id.::”h]”(hŒA map can be created with ”…”�”}”(hjJ-h²hh³Nh´Nubjß)�”}”(hŒ ``btf_fd``”h]”hŒbtf_fd”…”�”}”(hjR-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjJ-ubhŒ" and specified key/value type id.:”…”�”}”(hjJ-h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M‹hj9-h²hubj)�”}”(hŒ¸__u32 btf_fd; /* fd pointing to a BTF type data */ __u32 btf_key_type_id; /* BTF type_id of the key */ __u32 btf_value_type_id; /* BTF type_id of the value */”h]”hŒ¸__u32 btf_fd; /* fd pointing to a BTF type data */ __u32 btf_key_type_id; /* BTF type_id of the key */ __u32 btf_value_type_id; /* BTF type_id of the value */”…”�”}”hjj-sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M�hj9-h²hubhÝ)�”}”(hŒFIn libbpf, the map can be defined with extra annotation like below: ::”h]”hŒCIn libbpf, the map can be defined with extra annotation like below:”…”�”}”(hjx-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M‘hj9-h²hubj)�”}”(hŒžstruct { __uint(type, BPF_MAP_TYPE_ARRAY); __type(key, int); __type(value, struct ipv_counts); __uint(max_entries, 4); } btf_map SEC(".maps");”h]”hŒžstruct { __uint(type, BPF_MAP_TYPE_ARRAY); __type(key, int); __type(value, struct ipv_counts); __uint(max_entries, 4); } btf_map SEC(".maps");”…”�”}”hj†-sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M”hj9-h²hubhÝ)�”}”(hŒ}During ELF parsing, libbpf is able to extract key/value type_id's and assign them to BPF_MAP_CREATE attributes automatically.”h]”hŒDuring ELF parsing, libbpf is able to extract key/value type_id’s and assign them to BPF_MAP_CREATE attributes automatically.”…”�”}”(hj”-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M›hj9-h²hubj°)�”}”(hŒ.. _BPF_Prog_Load:”h]”h}”(h]”h ]”h"]”h$]”h&]”j»Œ bpf-prog-load”uh1j¯h´Mžhj9-h²hh³hÊubeh}”(h]”Œbpf-map-create”ah ]”h"]”Œ3.2 bpf_map_create”ah$]”h&]”uh1hµhj,h²hh³hÊh´M‰ubh¶)�”}”(hhh]”(h»)�”}”(hŒ3.3 BPF_PROG_LOAD”h]”hŒ3.3 BPF_PROG_LOAD”…”�”}”(hj¸-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjµ-h²hh³hÊh´M¡ubhÝ)�”}”(hŒuDuring prog_load, func_info and line_info can be passed to kernel with proper values for the following attributes: ::”h]”hŒrDuring prog_load, func_info and line_info can be passed to kernel with proper values for the following attributes:”…”�”}”(hjÆ-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M£hjµ-h²hubj)�”}”(hXü__u32 insn_cnt; __aligned_u64 insns; ...... __u32 prog_btf_fd; /* fd pointing to BTF type data */ __u32 func_info_rec_size; /* userspace bpf_func_info size */ __aligned_u64 func_info; /* func info */ __u32 func_info_cnt; /* number of bpf_func_info records */ __u32 line_info_rec_size; /* userspace bpf_line_info size */ __aligned_u64 line_info; /* line info */ __u32 line_info_cnt; /* number of bpf_line_info records */”h]”hXü__u32 insn_cnt; __aligned_u64 insns; ...... __u32 prog_btf_fd; /* fd pointing to BTF type data */ __u32 func_info_rec_size; /* userspace bpf_func_info size */ __aligned_u64 func_info; /* func info */ __u32 func_info_cnt; /* number of bpf_func_info records */ __u32 line_info_rec_size; /* userspace bpf_line_info size */ __aligned_u64 line_info; /* line info */ __u32 line_info_cnt; /* number of bpf_line_info records */”…”�”}”hjÔ-sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M§hjµ-h²hubhÝ)�”}”(hŒBThe func_info and line_info are an array of below, respectively.::”h]”hŒAThe func_info and line_info are an array of below, respectively.:”…”�”}”(hjâ-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M²hjµ-h²hubj)�”}”(hX–struct bpf_func_info { __u32 insn_off; /* [0, insn_cnt - 1] */ __u32 type_id; /* pointing to a BTF_KIND_FUNC type */ }; struct bpf_line_info { __u32 insn_off; /* [0, insn_cnt - 1] */ __u32 file_name_off; /* offset to string table for the filename */ __u32 line_off; /* offset to string table for the source line */ __u32 line_col; /* line number and column number */ };”h]”hX–struct bpf_func_info { __u32 insn_off; /* [0, insn_cnt - 1] */ __u32 type_id; /* pointing to a BTF_KIND_FUNC type */ }; struct bpf_line_info { __u32 insn_off; /* [0, insn_cnt - 1] */ __u32 file_name_off; /* offset to string table for the filename */ __u32 line_off; /* offset to string table for the source line */ __u32 line_col; /* line number and column number */ };”…”�”}”hjð-sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M´hjµ-h²hubhÝ)�”}”(hŒÓfunc_info_rec_size is the size of each func_info record, and line_info_rec_size is the size of each line_info record. Passing the record size to kernel make it possible to extend the record itself in the future.”h]”hŒÓfunc_info_rec_size is the size of each func_info record, and line_info_rec_size is the size of each line_info record. Passing the record size to kernel make it possible to extend the record itself in the future.”…”�”}”(hjþ-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M¿hjµ-h²hubhû)�”}”(hhh]”(j)�”}”(hŒ¥Below are requirements for func_info: * func_info[0].insn_off must be 0. * the func_info insn_off is in strictly increasing order and matches bpf func boundaries. ”h]”(j)�”}”(hŒ%Below are requirements for func_info:”h]”hŒ%Below are requirements for func_info:”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MÆhj.ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒ func_info[0].insn_off must be 0.”h]”hÝ)�”}”(hj).h]”hŒ func_info[0].insn_off must be 0.”…”�”}”(hj+.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÄhj'.ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj$.ubj )�”}”(hŒXthe func_info insn_off is in strictly increasing order and matches bpf func boundaries. ”h]”hÝ)�”}”(hŒWthe func_info insn_off is in strictly increasing order and matches bpf func boundaries.”h]”hŒWthe func_info insn_off is in strictly increasing order and matches bpf func boundaries.”…”�”}”(hjB.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÅhj>.ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj$.ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´MÄhj!.ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj.ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MÆhj .ubj)�”}”(hŒ«Below are requirements for line_info: * the first insn in each func must have a line_info record pointing to it. * the line_info insn_off is in strictly increasing order. ”h]”(j)�”}”(hŒ%Below are requirements for line_info:”h]”hŒ%Below are requirements for line_info:”…”�”}”(hjl.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MÊhjh.ubj)�”}”(hhh]”j)�”}”(hhh]”(j )�”}”(hŒHthe first insn in each func must have a line_info record pointing to it.”h]”hÝ)�”}”(hj‚.h]”hŒHthe first insn in each func must have a line_info record pointing to it.”…”�”}”(hj„.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÉhj€.ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj}.ubj )�”}”(hŒ8the line_info insn_off is in strictly increasing order. ”h]”hÝ)�”}”(hŒ7the line_info insn_off is in strictly increasing order.”h]”hŒ7the line_info insn_off is in strictly increasing order.”…”�”}”(hj›.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÊhj—.ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj}.ubeh}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jh³hÊh´MÉhjz.ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh.ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÊh´MÊhj .h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1húhjµ-h²hh³Nh´NubhÝ)�”}”(hŒIFor line_info, the line number and column number are defined as below: ::”h]”hŒFFor line_info, the line number and column number are defined as below:”…”�”}”(hjÇ.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÌhjµ-h²hubj)�”}”(hŒ‡#define BPF_LINE_INFO_LINE_NUM(line_col) ((line_col) >> 10) #define BPF_LINE_INFO_LINE_COL(line_col) ((line_col) & 0x3ff)”h]”hŒ‡#define BPF_LINE_INFO_LINE_NUM(line_col) ((line_col) >> 10) #define BPF_LINE_INFO_LINE_COL(line_col) ((line_col) & 0x3ff)”…”�”}”hjÕ.sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MÏhjµ-h²hubeh}”(h]”(j¬-Œid1”eh ]”h"]”(Œ3.3 bpf_prog_load”Œ bpf_prog_load”eh$]”h&]”uh1hµhj,h²hh³hÊh´M¡j0*}”jé.j¢-sj2*}”j¬-j¢-subh¶)�”}”(hhh]”(h»)�”}”(hŒ3.4 BPF_{PROG,MAP}_GET_NEXT_ID”h]”hŒ3.4 BPF_{PROG,MAP}_GET_NEXT_ID”…”�”}”(hjñ.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjî.h²hh³hÊh´MÓubhÝ)�”}”(hŒIn kernel, every loaded program, map or btf has a unique id. The id won't change during the lifetime of a program, map, or btf.”h]”hŒ�In kernel, every loaded program, map or btf has a unique id. The id won’t change during the lifetime of a program, map, or btf.”…”�”}”(hjÿ.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÕhjî.h²hubhÝ)�”}”(hŒÉThe bpf syscall command BPF_{PROG,MAP}_GET_NEXT_ID returns all id's, one for each command, to user space, for bpf program or maps, respectively, so an inspection tool can inspect all programs and maps.”h]”hŒËThe bpf syscall command BPF_{PROG,MAP}_GET_NEXT_ID returns all id’s, one for each command, to user space, for bpf program or maps, respectively, so an inspection tool can inspect all programs and maps.”…”�”}”(hj /h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MØhjî.h²hubeh}”(h]”Œbpf-prog-map-get-next-id”ah ]”h"]”Œ3.4 bpf_{prog,map}_get_next_id”ah$]”h&]”uh1hµhj,h²hh³hÊh´MÓubh¶)�”}”(hhh]”(h»)�”}”(hŒ3.5 BPF_{PROG,MAP}_GET_FD_BY_ID”h]”hŒ3.5 BPF_{PROG,MAP}_GET_FD_BY_ID”…”�”}”(hj&/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj#/h²hh³hÊh´MÝubhÝ)�”}”(hŒ–An introspection tool cannot use id to get details about program or maps. A file descriptor needs to be obtained first for reference-counting purpose.”h]”hŒ–An introspection tool cannot use id to get details about program or maps. A file descriptor needs to be obtained first for reference-counting purpose.”…”�”}”(hj4/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mßhj#/h²hubeh}”(h]”Œbpf-prog-map-get-fd-by-id”ah ]”h"]”Œ3.5 bpf_{prog,map}_get_fd_by_id”ah$]”h&]”uh1hµhj,h²hh³hÊh´MÝubh¶)�”}”(hhh]”(h»)�”}”(hŒ3.6 BPF_OBJ_GET_INFO_BY_FD”h]”hŒ3.6 BPF_OBJ_GET_INFO_BY_FD”…”�”}”(hjM/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjJ/h²hh³hÊh´MãubhÝ)�”}”(hXOOnce a program/map fd is acquired, an introspection tool can get the detailed information from kernel about this fd, some of which are BTF-related. For example, ``bpf_map_info`` returns ``btf_id`` and key/value type ids. ``bpf_prog_info`` returns ``btf_id``, func_info, and line info for translated bpf byte codes, and jited_line_info.”h]”(hŒ¡Once a program/map fd is acquired, an introspection tool can get the detailed information from kernel about this fd, some of which are BTF-related. For example, ”…”�”}”(hj[/h²hh³Nh´Nubjß)�”}”(hŒ``bpf_map_info``”h]”hŒ bpf_map_info”…”�”}”(hjc/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj[/ubhŒ returns ”…”�”}”(hj[/h²hh³Nh´Nubjß)�”}”(hŒ ``btf_id``”h]”hŒbtf_id”…”�”}”(hju/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj[/ubhŒ and key/value type ids. ”…”�”}”(hj[/h²hh³Nh´Nubjß)�”}”(hŒ``bpf_prog_info``”h]”hŒ bpf_prog_info”…”�”}”(hj‡/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj[/ubhŒ returns ”…”�”}”hj[/sbjß)�”}”(hŒ ``btf_id``”h]”hŒbtf_id”…”�”}”(hj™/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj[/ubhŒN, func_info, and line info for translated bpf byte codes, and jited_line_info.”…”�”}”(hj[/h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MåhjJ/h²hubeh}”(h]”Œbpf-obj-get-info-by-fd”ah ]”h"]”Œ3.6 bpf_obj_get_info_by_fd”ah$]”h&]”uh1hµhj,h²hh³hÊh´Mãubh¶)�”}”(hhh]”(h»)�”}”(hŒ3.7 BPF_BTF_GET_FD_BY_ID”h]”hŒ3.7 BPF_BTF_GET_FD_BY_ID”…”�”}”(hj¼/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¹/h²hh³hÊh´MìubhÝ)�”}”(hXWith ``btf_id`` obtained in ``bpf_map_info`` and ``bpf_prog_info``, bpf syscall command BPF_BTF_GET_FD_BY_ID can retrieve a btf fd. Then, with command BPF_OBJ_GET_INFO_BY_FD, the btf blob, originally loaded into the kernel with BPF_BTF_LOAD, can be retrieved.”h]”(hŒWith ”…”�”}”(hjÊ/h²hh³Nh´Nubjß)�”}”(hŒ ``btf_id``”h]”hŒbtf_id”…”�”}”(hjÒ/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÊ/ubhŒ obtained in ”…”�”}”(hjÊ/h²hh³Nh´Nubjß)�”}”(hŒ``bpf_map_info``”h]”hŒ bpf_map_info”…”�”}”(hjä/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÊ/ubhŒ and ”…”�”}”(hjÊ/h²hh³Nh´Nubjß)�”}”(hŒ``bpf_prog_info``”h]”hŒ bpf_prog_info”…”�”}”(hjö/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÊ/ubhŒÁ, bpf syscall command BPF_BTF_GET_FD_BY_ID can retrieve a btf fd. Then, with command BPF_OBJ_GET_INFO_BY_FD, the btf blob, originally loaded into the kernel with BPF_BTF_LOAD, can be retrieved.”…”�”}”(hjÊ/h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mîhj¹/h²hubhÝ)�”}”(hŒÓWith the btf blob, ``bpf_map_info``, and ``bpf_prog_info``, an introspection tool has full btf knowledge and is able to pretty print map key/values, dump func signatures and line info, along with byte/jit codes.”h]”(hŒWith the btf blob, ”…”�”}”(hj0h²hh³Nh´Nubjß)�”}”(hŒ``bpf_map_info``”h]”hŒ bpf_map_info”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj0ubhŒ, and ”…”�”}”(hj0h²hh³Nh´Nubjß)�”}”(hŒ``bpf_prog_info``”h]”hŒ bpf_prog_info”…”�”}”(hj(0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj0ubhŒ™, an introspection tool has full btf knowledge and is able to pretty print map key/values, dump func signatures and line info, along with byte/jit codes.”…”�”}”(hj0h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Móhj¹/h²hubeh}”(h]”Œbpf-btf-get-fd-by-id”ah ]”h"]”Œ3.7 bpf_btf_get_fd_by_id”ah$]”h&]”uh1hµhj,h²hh³hÊh´Mìubeh}”(h]”Œbtf-kernel-api”ah ]”h"]”Œ3. btf kernel api”ah$]”h&]”uh1hµhh·h²hh³hÊh´MWubh¶)�”}”(hhh]”(h»)�”}”(hŒ4. ELF File Format Interface”h]”hŒ4. ELF File Format Interface”…”�”}”(hjS0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjP0h²hh³hÊh´Møubh¶)�”}”(hhh]”(h»)�”}”(hŒ4.1 .BTF section”h]”hŒ4.1 .BTF section”…”�”}”(hjd0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhja0h²hh³hÊh´MûubhÝ)�”}”(hŒ�The .BTF section contains type and string data. The format of this section is same as the one describe in :ref:`BTF_Type_String`.”h]”(hŒjThe .BTF section contains type and string data. The format of this section is same as the one describe in ”…”�”}”(hjr0h²hh³Nh´Nubh)�”}”(hŒ:ref:`BTF_Type_String`”h]”j…)�”}”(hj|0h]”hŒBTF_Type_String”…”�”}”(hj~0h²hh³Nh´Nubah}”(h]”h ]”(j�Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j„hjz0ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j�Œ refdomain”jˆ0Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj£Œbtf_type_string”uh1hh³hÊh´Mýhjr0ubhŒ.”…”�”}”(hjr0h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mýhja0h²hubj°)�”}”(hŒ.. _BTF_Ext_Section:”h]”h}”(h]”h ]”h"]”h$]”h&]”j»Œbtf-ext-section”uh1j¯h´Mhja0h²hh³hÊubeh}”(h]”Œ btf-section”ah ]”h"]”Œ4.1 .btf section”ah$]”h&]”uh1hµhjP0h²hh³hÊh´Mûubh¶)�”}”(hhh]”(h»)�”}”(hŒ4.2 .BTF.ext section”h]”hŒ4.2 .BTF.ext section”…”�”}”(hjº0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj·0h²hh³hÊh´MubhÝ)�”}”(hŒ‡The .BTF.ext section encodes func_info, line_info and CO-RE relocations which needs loader manipulation before loading into the kernel.”h]”hŒ‡The .BTF.ext section encodes func_info, line_info and CO-RE relocations which needs loader manipulation before loading into the kernel.”…”�”}”(hjÈ0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj·0h²hubhÝ)�”}”(hŒiThe specification for .BTF.ext section is defined at ``tools/lib/bpf/btf.h`` and ``tools/lib/bpf/btf.c``.”h]”(hŒ5The specification for .BTF.ext section is defined at ”…”�”}”(hjÖ0h²hh³Nh´Nubjß)�”}”(hŒ``tools/lib/bpf/btf.h``”h]”hŒtools/lib/bpf/btf.h”…”�”}”(hjÞ0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÖ0ubhŒ and ”…”�”}”(hjÖ0h²hh³Nh´Nubjß)�”}”(hŒ``tools/lib/bpf/btf.c``”h]”hŒtools/lib/bpf/btf.c”…”�”}”(hjð0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÖ0ubhŒ.”…”�”}”(hjÖ0h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj·0h²hubhÝ)�”}”(hŒ(The current header of .BTF.ext section::”h]”hŒ'The current header of .BTF.ext section:”…”�”}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hj·0h²hubj)�”}”(hXstruct btf_ext_header { __u16 magic; __u8 version; __u8 flags; __u32 hdr_len; /* All offsets are in bytes relative to the end of this header */ __u32 func_info_off; __u32 func_info_len; __u32 line_info_off; __u32 line_info_len; /* optional part of .BTF.ext header */ __u32 core_relo_off; __u32 core_relo_len; };”h]”hXstruct btf_ext_header { __u16 magic; __u8 version; __u8 flags; __u32 hdr_len; /* All offsets are in bytes relative to the end of this header */ __u32 func_info_off; __u32 func_info_len; __u32 line_info_off; __u32 line_info_len; /* optional part of .BTF.ext header */ __u32 core_relo_off; __u32 core_relo_len; };”…”�”}”hj1sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M hj·0h²hubhÝ)�”}”(hŒÒIt is very similar to .BTF section. Instead of type/string section, it contains func_info, line_info and core_relo sub-sections. See :ref:`BPF_Prog_Load` for details about func_info and line_info record format.”h]”(hŒ…It is very similar to .BTF section. Instead of type/string section, it contains func_info, line_info and core_relo sub-sections. See ”…”�”}”(hj$1h²hh³Nh´Nubh)�”}”(hŒ:ref:`BPF_Prog_Load`”h]”j…)�”}”(hj.1h]”hŒ BPF_Prog_Load”…”�”}”(hj01h²hh³Nh´Nubah}”(h]”h ]”(j�Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j„hj,1ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j�Œ refdomain”j:1Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj£Œ bpf_prog_load”uh1hh³hÊh´Mhj$1ubhŒ9 for details about func_info and line_info record format.”…”�”}”(hj$1h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj·0h²hubhÝ)�”}”(hŒ&The func_info is organized as below.::”h]”hŒ%The func_info is organized as below.:”…”�”}”(hjV1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M#hj·0h²hubj)�”}”(hŒ³func_info_rec_size /* __u32 value */ btf_ext_info_sec for section #1 /* func_info for section #1 */ btf_ext_info_sec for section #2 /* func_info for section #2 */ ...”h]”hŒ³func_info_rec_size /* __u32 value */ btf_ext_info_sec for section #1 /* func_info for section #1 */ btf_ext_info_sec for section #2 /* func_info for section #2 */ ...”…”�”}”hjd1sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M%hj·0h²hubhÝ)�”}”(hŒÇ``func_info_rec_size`` specifies the size of ``bpf_func_info`` structure when .BTF.ext is generated. ``btf_ext_info_sec``, defined below, is a collection of func_info for each specific ELF section.::”h]”(jß)�”}”(hŒ``func_info_rec_size``”h]”hŒfunc_info_rec_size”…”�”}”(hjv1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjr1ubhŒ specifies the size of ”…”�”}”(hjr1h²hh³Nh´Nubjß)�”}”(hŒ``bpf_func_info``”h]”hŒ bpf_func_info”…”�”}”(hjˆ1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjr1ubhŒ' structure when .BTF.ext is generated. ”…”�”}”(hjr1h²hh³Nh´Nubjß)�”}”(hŒ``btf_ext_info_sec``”h]”hŒbtf_ext_info_sec”…”�”}”(hjš1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjr1ubhŒM, defined below, is a collection of func_info for each specific ELF section.:”…”�”}”(hjr1h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M*hj·0h²hubj)�”}”(hŒ·struct btf_ext_info_sec { __u32 sec_name_off; /* offset to section name */ __u32 num_info; /* Followed by num_info * record_size number of bytes */ __u8 data[0]; };”h]”hŒ·struct btf_ext_info_sec { __u32 sec_name_off; /* offset to section name */ __u32 num_info; /* Followed by num_info * record_size number of bytes */ __u8 data[0]; };”…”�”}”hj²1sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M.hj·0h²hubhÝ)�”}”(hŒ&Here, num_info must be greater than 0.”h]”hŒ&Here, num_info must be greater than 0.”…”�”}”(hjÀ1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M5hj·0h²hubhÝ)�”}”(hŒ&The line_info is organized as below.::”h]”hŒ%The line_info is organized as below.:”…”�”}”(hjÎ1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M7hj·0h²hubj)�”}”(hŒ³line_info_rec_size /* __u32 value */ btf_ext_info_sec for section #1 /* line_info for section #1 */ btf_ext_info_sec for section #2 /* line_info for section #2 */ ...”h]”hŒ³line_info_rec_size /* __u32 value */ btf_ext_info_sec for section #1 /* line_info for section #1 */ btf_ext_info_sec for section #2 /* line_info for section #2 */ ...”…”�”}”hjÜ1sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M9hj·0h²hubhÝ)�”}”(hŒd``line_info_rec_size`` specifies the size of ``bpf_line_info`` structure when .BTF.ext is generated.”h]”(jß)�”}”(hŒ``line_info_rec_size``”h]”hŒline_info_rec_size”…”�”}”(hjî1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjê1ubhŒ specifies the size of ”…”�”}”(hjê1h²hh³Nh´Nubjß)�”}”(hŒ``bpf_line_info``”h]”hŒ bpf_line_info”…”�”}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjê1ubhŒ& structure when .BTF.ext is generated.”…”�”}”(hjê1h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M>hj·0h²hubhÝ)�”}”(hXRThe interpretation of ``bpf_func_info->insn_off`` and ``bpf_line_info->insn_off`` is different between kernel API and ELF API. For kernel API, the ``insn_off`` is the instruction offset in the unit of ``struct bpf_insn``. For ELF API, the ``insn_off`` is the byte offset from the beginning of section (``btf_ext_info_sec->sec_name_off``).”h]”(hŒThe interpretation of ”…”�”}”(hj2h²hh³Nh´Nubjß)�”}”(hŒ``bpf_func_info->insn_off``”h]”hŒbpf_func_info->insn_off”…”�”}”(hj 2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj2ubhŒ and ”…”�”}”(hj2h²hh³Nh´Nubjß)�”}”(hŒ``bpf_line_info->insn_off``”h]”hŒbpf_line_info->insn_off”…”�”}”(hj22h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj2ubhŒB is different between kernel API and ELF API. For kernel API, the ”…”�”}”(hj2h²hh³Nh´Nubjß)�”}”(hŒ ``insn_off``”h]”hŒinsn_off”…”�”}”(hjD2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj2ubhŒ* is the instruction offset in the unit of ”…”�”}”(hj2h²hh³Nh´Nubjß)�”}”(hŒ``struct bpf_insn``”h]”hŒstruct bpf_insn”…”�”}”(hjV2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj2ubhŒ. For ELF API, the ”…”�”}”(hj2h²hh³Nh´Nubjß)�”}”(hŒ ``insn_off``”h]”hŒinsn_off”…”�”}”(hjh2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj2ubhŒ3 is the byte offset from the beginning of section (”…”�”}”(hj2h²hh³Nh´Nubjß)�”}”(hŒ"``btf_ext_info_sec->sec_name_off``”h]”hŒbtf_ext_info_sec->sec_name_off”…”�”}”(hjz2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj2ubhŒ).”…”�”}”(hj2h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MAhj·0h²hubhÝ)�”}”(hŒ&The core_relo is organized as below.::”h]”hŒ%The core_relo is organized as below.:”…”�”}”(hj’2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MGhj·0h²hubj)�”}”(hŒ¯core_relo_rec_size /* __u32 value */ btf_ext_info_sec for section #1 /* core_relo for section #1 */ btf_ext_info_sec for section #2 /* core_relo for section #2 */”h]”hŒ¯core_relo_rec_size /* __u32 value */ btf_ext_info_sec for section #1 /* core_relo for section #1 */ btf_ext_info_sec for section #2 /* core_relo for section #2 */”…”�”}”hj 2sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MIhj·0h²hubhÝ)�”}”(hŒÿ``core_relo_rec_size`` specifies the size of ``bpf_core_relo`` structure when .BTF.ext is generated. All ``bpf_core_relo`` structures within a single ``btf_ext_info_sec`` describe relocations applied to section named by ``btf_ext_info_sec->sec_name_off``.”h]”(jß)�”}”(hŒ``core_relo_rec_size``”h]”hŒcore_relo_rec_size”…”�”}”(hj²2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj®2ubhŒ specifies the size of ”…”�”}”(hj®2h²hh³Nh´Nubjß)�”}”(hŒ``bpf_core_relo``”h]”hŒ bpf_core_relo”…”�”}”(hjÄ2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj®2ubhŒ+ structure when .BTF.ext is generated. All ”…”�”}”(hj®2h²hh³Nh´Nubjß)�”}”(hŒ``bpf_core_relo``”h]”hŒ bpf_core_relo”…”�”}”(hjÖ2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj®2ubhŒ structures within a single ”…”�”}”(hj®2h²hh³Nh´Nubjß)�”}”(hŒ``btf_ext_info_sec``”h]”hŒbtf_ext_info_sec”…”�”}”(hjè2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj®2ubhŒ2 describe relocations applied to section named by ”…”�”}”(hj®2h²hh³Nh´Nubjß)�”}”(hŒ"``btf_ext_info_sec->sec_name_off``”h]”hŒbtf_ext_info_sec->sec_name_off”…”�”}”(hjú2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj®2ubhŒ.”…”�”}”(hj®2h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MMhj·0h²hubhÝ)�”}”(hŒnSee :ref:`Documentation/bpf/llvm_reloc.rst ` for more information on CO-RE relocations.”h]”(hŒSee ”…”�”}”(hj3h²hh³Nh´Nubh)�”}”(hŒ?:ref:`Documentation/bpf/llvm_reloc.rst `”h]”j…)�”}”(hj3h]”hŒ Documentation/bpf/llvm_reloc.rst”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”(j�Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j„hj3ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j�Œ refdomain”j(3Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj£Œbtf-co-re-relocations”uh1hh³hÊh´MRhj3ubhŒ+ for more information on CO-RE relocations.”…”�”}”(hj3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MRhj·0h²hubeh}”(h]”(j®0Œid2”eh ]”h"]”(Œ4.2 .btf.ext section”Œbtf_ext_section”eh$]”h&]”uh1hµhjP0h²hh³hÊh´Mj0*}”jJ3j¤0sj2*}”j®0j¤0subh¶)�”}”(hhh]”(h»)�”}”(hŒ4.3 .BTF_ids section”h]”hŒ4.3 .BTF_ids section”…”�”}”(hjR3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjO3h²hh³hÊh´MVubhÝ)�”}”(hŒKThe .BTF_ids section encodes BTF ID values that are used within the kernel.”h]”hŒKThe .BTF_ids section encodes BTF ID values that are used within the kernel.”…”�”}”(hj`3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MXhjO3h²hubhÝ)�”}”(hŒÔThis section is created during the kernel compilation with the help of macros defined in ``include/linux/btf_ids.h`` header file. Kernel code can use them to create lists and sets (sorted lists) of BTF ID values.”h]”(hŒYThis section is created during the kernel compilation with the help of macros defined in ”…”�”}”(hjn3h²hh³Nh´Nubjß)�”}”(hŒ``include/linux/btf_ids.h``”h]”hŒinclude/linux/btf_ids.h”…”�”}”(hjv3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjn3ubhŒ` header file. Kernel code can use them to create lists and sets (sorted lists) of BTF ID values.”…”�”}”(hjn3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MZhjO3h²hubhÝ)�”}”(hŒhThe ``BTF_ID_LIST`` and ``BTF_ID`` macros define unsorted list of BTF ID values, with following syntax::”h]”(hŒThe ”…”�”}”(hjŽ3h²hh³Nh´Nubjß)�”}”(hŒ``BTF_ID_LIST``”h]”hŒ BTF_ID_LIST”…”�”}”(hj–3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjŽ3ubhŒ and ”…”�”}”(hjŽ3h²hh³Nh´Nubjß)�”}”(hŒ ``BTF_ID``”h]”hŒBTF_ID”…”�”}”(hj¨3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjŽ3ubhŒE macros define unsorted list of BTF ID values, with following syntax:”…”�”}”(hjŽ3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M^hjO3h²hubj)�”}”(hŒ;BTF_ID_LIST(list) BTF_ID(type1, name1) BTF_ID(type2, name2)”h]”hŒ;BTF_ID_LIST(list) BTF_ID(type1, name1) BTF_ID(type2, name2)”…”�”}”hjÀ3sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MahjO3h²hubhÝ)�”}”(hŒ3resulting in following layout in .BTF_ids section::”h]”hŒ2resulting in following layout in .BTF_ids section:”…”�”}”(hjÎ3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MehjO3h²hubj)�”}”(hŒE__BTF_ID__type1__name1__1: .zero 4 __BTF_ID__type2__name2__2: .zero 4”h]”hŒE__BTF_ID__type1__name1__1: .zero 4 __BTF_ID__type2__name2__2: .zero 4”…”�”}”hjÜ3sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MghjO3h²hubhÝ)�”}”(hŒ;The ``u32 list[];`` variable is defined to access the list.”h]”(hŒThe ”…”�”}”(hjê3h²hh³Nh´Nubjß)�”}”(hŒ``u32 list[];``”h]”hŒ u32 list[];”…”�”}”(hjò3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjê3ubhŒ( variable is defined to access the list.”…”�”}”(hjê3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MlhjO3h²hubhÝ)�”}”(hŒvThe ``BTF_ID_UNUSED`` macro defines 4 zero bytes. It's used when we want to define unused entry in BTF_ID_LIST, like::”h]”(hŒThe ”…”�”}”(hj 4h²hh³Nh´Nubjß)�”}”(hŒ``BTF_ID_UNUSED``”h]”hŒ BTF_ID_UNUSED”…”�”}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj 4ubhŒb macro defines 4 zero bytes. It’s used when we want to define unused entry in BTF_ID_LIST, like:”…”�”}”(hj 4h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MnhjO3h²hubj)�”}”(hŒeBTF_ID_LIST(bpf_skb_output_btf_ids) BTF_ID(struct, sk_buff) BTF_ID_UNUSED BTF_ID(struct, task_struct)”h]”hŒeBTF_ID_LIST(bpf_skb_output_btf_ids) BTF_ID(struct, sk_buff) BTF_ID_UNUSED BTF_ID(struct, task_struct)”…”�”}”hj*4sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MqhjO3h²hubhÝ)�”}”(hŒsThe ``BTF_SET_START/END`` macros pair defines sorted list of BTF ID values and their count, with following syntax::”h]”(hŒThe ”…”�”}”(hj84h²hh³Nh´Nubjß)�”}”(hŒ``BTF_SET_START/END``”h]”hŒBTF_SET_START/END”…”�”}”(hj@4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj84ubhŒY macros pair defines sorted list of BTF ID values and their count, with following syntax:”…”�”}”(hj84h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MvhjO3h²hubj)�”}”(hŒMBTF_SET_START(set) BTF_ID(type1, name1) BTF_ID(type2, name2) BTF_SET_END(set)”h]”hŒMBTF_SET_START(set) BTF_ID(type1, name1) BTF_ID(type2, name2) BTF_SET_END(set)”…”�”}”hjX4sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MyhjO3h²hubhÝ)�”}”(hŒ3resulting in following layout in .BTF_ids section::”h]”hŒ2resulting in following layout in .BTF_ids section:”…”�”}”(hjf4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M~hjO3h²hubj)�”}”(hŒa__BTF_ID__set__set: .zero 4 __BTF_ID__type1__name1__3: .zero 4 __BTF_ID__type2__name2__4: .zero 4”h]”hŒa__BTF_ID__set__set: .zero 4 __BTF_ID__type1__name1__3: .zero 4 __BTF_ID__type2__name2__4: .zero 4”…”�”}”hjt4sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M€hjO3h²hubhÝ)�”}”(hŒFThe ``struct btf_id_set set;`` variable is defined to access the list.”h]”(hŒThe ”…”�”}”(hj‚4h²hh³Nh´Nubjß)�”}”(hŒ``struct btf_id_set set;``”h]”hŒstruct btf_id_set set;”…”�”}”(hjŠ4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj‚4ubhŒ( variable is defined to access the list.”…”�”}”(hj‚4h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M‡hjO3h²hubhÝ)�”}”(hŒ,The ``typeX`` name can be one of following::”h]”(hŒThe ”…”�”}”(hj¢4h²hh³Nh´Nubjß)�”}”(hŒ ``typeX``”h]”hŒtypeX”…”�”}”(hjª4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhj¢4ubhŒ name can be one of following:”…”�”}”(hj¢4h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M‰hjO3h²hubj)�”}”(hŒstruct, union, typedef, func”h]”hŒstruct, union, typedef, func”…”�”}”hjÂ4sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M‹hjO3h²hubhÝ)�”}”(hŒ8and is used as a filter when resolving the BTF ID value.”h]”hŒ8and is used as a filter when resolving the BTF ID value.”…”�”}”(hjÐ4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M�hjO3h²hubhÝ)�”}”(hŒ”All the BTF ID lists and sets are compiled in the .BTF_ids section and resolved during the linking phase of kernel build by ``resolve_btfids`` tool.”h]”(hŒ|All the BTF ID lists and sets are compiled in the .BTF_ids section and resolved during the linking phase of kernel build by ”…”�”}”(hjÞ4h²hh³Nh´Nubjß)�”}”(hŒ``resolve_btfids``”h]”hŒresolve_btfids”…”�”}”(hjæ4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÞhjÞ4ubhŒ tool.”…”�”}”(hjÞ4h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M�hjO3h²hubeh}”(h]”Œbtf-ids-section”ah ]”h"]”Œ4.3 .btf_ids section”ah$]”h&]”uh1hµhjP0h²hh³hÊh´MVubh¶)�”}”(hhh]”(h»)�”}”(hŒ4.4 .BTF.base section”h]”hŒ4.4 .BTF.base section”…”�”}”(hj 5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj5h²hh³hÊh´M“ubhÝ)�”}”(hXSplit BTF - where the .BTF section only contains types not in the associated base .BTF section - is an extremely efficient way to encode type information for kernel modules, since they generally consist of a few module-specific types along with a large set of shared kernel types. The former are encoded in split BTF, while the latter are encoded in base BTF, resulting in more compact representations. A type in split BTF that refers to a type in base BTF refers to it using its base BTF ID, and split BTF IDs start at last_base_BTF_ID + 1.”h]”hXSplit BTF - where the .BTF section only contains types not in the associated base .BTF section - is an extremely efficient way to encode type information for kernel modules, since they generally consist of a few module-specific types along with a large set of shared kernel types. The former are encoded in split BTF, while the latter are encoded in base BTF, resulting in more compact representations. A type in split BTF that refers to a type in base BTF refers to it using its base BTF ID, and split BTF IDs start at last_base_BTF_ID + 1.”…”�”}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M”hj5h²hubhÝ)�”}”(hXþThe downside of this approach however is that this makes the split BTF somewhat brittle - when the base BTF changes, base BTF ID references are no longer valid and the split BTF itself becomes useless. The role of the .BTF.base section is to make split BTF more resilient for cases where the base BTF may change, as is the case for kernel modules not built every time the kernel is for example. .BTF.base contains named base types; INTs, FLOATs, STRUCTs, UNIONs, ENUM[64]s and FWDs. INTs and FLOATs are fully described in .BTF.base sections, while composite types like structs and unions are not fully defined - the .BTF.base type simply serves as a description of the type the split BTF referred to, so structs/unions have 0 members in the .BTF.base section. ENUM[64]s are similarly recorded with 0 members. Any other types are added to the split BTF. This distillation process then leaves us with a .BTF.base section with such minimal descriptions of base types and .BTF split section which refers to those base types. Later, we can relocate the split BTF using both the information stored in the .BTF.base section and the new .BTF base; the type information in the .BTF.base section allows us to update the split BTF references to point at the corresponding new base BTF IDs.”h]”hXþThe downside of this approach however is that this makes the split BTF somewhat brittle - when the base BTF changes, base BTF ID references are no longer valid and the split BTF itself becomes useless. The role of the .BTF.base section is to make split BTF more resilient for cases where the base BTF may change, as is the case for kernel modules not built every time the kernel is for example. .BTF.base contains named base types; INTs, FLOATs, STRUCTs, UNIONs, ENUM[64]s and FWDs. INTs and FLOATs are fully described in .BTF.base sections, while composite types like structs and unions are not fully defined - the .BTF.base type simply serves as a description of the type the split BTF referred to, so structs/unions have 0 members in the .BTF.base section. ENUM[64]s are similarly recorded with 0 members. Any other types are added to the split BTF. This distillation process then leaves us with a .BTF.base section with such minimal descriptions of base types and .BTF split section which refers to those base types. Later, we can relocate the split BTF using both the information stored in the .BTF.base section and the new .BTF base; the type information in the .BTF.base section allows us to update the split BTF references to point at the corresponding new base BTF IDs.”…”�”}”(hj%5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M�hj5h²hubhÝ)�”}”(hŒ�BTF relocation happens on kernel module load when a kernel module has a .BTF.base section, and libbpf also provides a btf__relocate() API to accomplish this.”h]”hŒ�BTF relocation happens on kernel module load when a kernel module has a .BTF.base section, and libbpf also provides a btf__relocate() API to accomplish this.”…”�”}”(hj35h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M°hj5h²hubhÝ)�”}”(hŒ/As an example consider the following base BTF::”h]”hŒ.As an example consider the following base BTF:”…”�”}”(hjA5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M´hj5h²hubj)�”}”(hŒ§[1] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED [2] STRUCT 'foo' size=8 vlen=2 'f1' type_id=1 bits_offset=0 'f2' type_id=1 bits_offset=32”h]”hŒ§[1] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED [2] STRUCT 'foo' size=8 vlen=2 'f1' type_id=1 bits_offset=0 'f2' type_id=1 bits_offset=32”…”�”}”hjO5sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M¶hj5h²hubhÝ)�”}”(hŒ...and associated split BTF::”h]”hŒ...and associated split BTF:”…”�”}”(hj]5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M»hj5h²hubj)�”}”(hŒ[3] PTR '(anon)' type_id=2”h]”hŒ[3] PTR '(anon)' type_id=2”…”�”}”hjk5sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M½hj5h²hubhÝ)�”}”(hŒDi.e. split BTF describes a pointer to struct foo { int f1; int f2 };”h]”hŒDi.e. split BTF describes a pointer to struct foo { int f1; int f2 };”…”�”}”(hjy5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M¿hj5h²hubhÝ)�”}”(hŒ.BTF.base will consist of::”h]”hŒ.BTF.base will consist of:”…”�”}”(hj‡5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÁhj5h²hubj)�”}”(hŒ\[1] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED [2] STRUCT 'foo' size=8 vlen=0”h]”hŒ\[1] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED [2] STRUCT 'foo' size=8 vlen=0”…”�”}”hj•5sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MÃhj5h²hubhÝ)�”}”(hŒEIf we relocate the split BTF later using the following new base BTF::”h]”hŒDIf we relocate the split BTF later using the following new base BTF:”…”�”}”(hj£5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÆhj5h²hubj)�”}”(hŒó[1] INT 'long unsigned int' size=8 bits_offset=0 nr_bits=64 encoding=(none) [2] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED [3] STRUCT 'foo' size=8 vlen=2 'f1' type_id=2 bits_offset=0 'f2' type_id=2 bits_offset=32”h]”hŒó[1] INT 'long unsigned int' size=8 bits_offset=0 nr_bits=64 encoding=(none) [2] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED [3] STRUCT 'foo' size=8 vlen=2 'f1' type_id=2 bits_offset=0 'f2' type_id=2 bits_offset=32”…”�”}”hj±5sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MÈhj5h²hubhÝ)�”}”(hŒˆ...we can use our .BTF.base description to know that the split BTF reference is to struct foo, and relocation results in new split BTF::”h]”hŒ‡...we can use our .BTF.base description to know that the split BTF reference is to struct foo, and relocation results in new split BTF:”…”�”}”(hj¿5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÎhj5h²hubj)�”}”(hŒ[4] PTR '(anon)' type_id=3”h]”hŒ[4] PTR '(anon)' type_id=3”…”�”}”hjÍ5sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MÑhj5h²hubhÝ)�”}”(hŒENote that we had to update BTF ID and start BTF ID for the split BTF.”h]”hŒENote that we had to update BTF ID and start BTF ID for the split BTF.”…”�”}”(hjÛ5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÓhj5h²hubhÝ)�”}”(hŒmSo we see how .BTF.base plays the role of facilitating later relocation, leading to more resilient split BTF.”h]”hŒmSo we see how .BTF.base plays the role of facilitating later relocation, leading to more resilient split BTF.”…”�”}”(hjé5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÕhj5h²hubhÝ)�”}”(hX).BTF.base sections will be generated automatically for out-of-tree kernel module builds - i.e. where KBUILD_EXTMOD is set (as it would be for "make M=path/2/mod" cases). .BTF.base generation requires pahole support for the "distilled_base" BTF feature; this is available in pahole v1.28 and later.”h]”hX1.BTF.base sections will be generated automatically for out-of-tree kernel module builds - i.e. where KBUILD_EXTMOD is set (as it would be for “make M=path/2/modâ€� cases). .BTF.base generation requires pahole support for the “distilled_baseâ€� BTF feature; this is available in pahole v1.28 and later.”…”�”}”(hj÷5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MØhj5h²hubeh}”(h]”Œbtf-base-section”ah ]”h"]”Œ4.4 .btf.base section”ah$]”h&]”uh1hµhjP0h²hh³hÊh´M“ubeh}”(h]”Œelf-file-format-interface”ah ]”h"]”Œ4. elf file format interface”ah$]”h&]”uh1hµhh·h²hh³hÊh´Møubh¶)�”}”(hhh]”(h»)�”}”(hŒ 5. Using BTF”h]”hŒ 5. Using BTF”…”�”}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj6h²hh³hÊh´MÞubh¶)�”}”(hhh]”(h»)�”}”(hŒ5.1 bpftool map pretty print”h]”hŒ5.1 bpftool map pretty print”…”�”}”(hj)6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj&6h²hh³hÊh´MáubhÝ)�”}”(hŒ×With BTF, the map key/value can be printed based on fields rather than simply raw bytes. This is especially valuable for large structure or if your data structure has bitfields. For example, for the following map,::”h]”hŒÖWith BTF, the map key/value can be printed based on fields rather than simply raw bytes. This is especially valuable for large structure or if your data structure has bitfields. For example, for the following map,:”…”�”}”(hj76h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mãhj&6h²hubj)�”}”(hXOenum A { A1, A2, A3, A4, A5 }; typedef enum A ___A; struct tmp_t { char a1:4; int a2:4; int :4; __u32 a3:4; int b; ___A b1:4; enum A b2:4; }; struct { __uint(type, BPF_MAP_TYPE_ARRAY); __type(key, int); __type(value, struct tmp_t); __uint(max_entries, 1); } tmpmap SEC(".maps");”h]”hXOenum A { A1, A2, A3, A4, A5 }; typedef enum A ___A; struct tmp_t { char a1:4; int a2:4; int :4; __u32 a3:4; int b; ___A b1:4; enum A b2:4; }; struct { __uint(type, BPF_MAP_TYPE_ARRAY); __type(key, int); __type(value, struct tmp_t); __uint(max_entries, 1); } tmpmap SEC(".maps");”…”�”}”hjE6sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´Mçhj&6h²hubhÝ)�”}”(hŒ.bpftool is able to pretty print like below: ::”h]”hŒ+bpftool is able to pretty print like below:”…”�”}”(hjS6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mùhj&6h²hubj)�”}”(hŒ«[{ "key": 0, "value": { "a1": 0x2, "a2": 0x4, "a3": 0x6, "b": 7, "b1": 0x8, "b2": 0xa } } ]”h]”hŒ«[{ "key": 0, "value": { "a1": 0x2, "a2": 0x4, "a3": 0x6, "b": 7, "b1": 0x8, "b2": 0xa } } ]”…”�”}”hja6sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´Mühj&6h²hubeh}”(h]”Œbpftool-map-pretty-print”ah ]”h"]”Œ5.1 bpftool map pretty print”ah$]”h&]”uh1hµhj6h²hh³hÊh´Máubh¶)�”}”(hhh]”(h»)�”}”(hŒ5.2 bpftool prog dump”h]”hŒ5.2 bpftool prog dump”…”�”}”(hjz6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjw6h²hh³hÊh´M ubhÝ)�”}”(hŒŸThe following is an example showing how func_info and line_info can help prog dump with better kernel symbol names, function prototypes and line information.::”h]”hŒžThe following is an example showing how func_info and line_info can help prog dump with better kernel symbol names, function prototypes and line information.:”…”�”}”(hjˆ6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hjw6h²hubj)�”}”(hX$ bpftool prog dump jited pinned /sys/fs/bpf/test_btf_haskv [...] int test_long_fname_2(struct dummy_tracepoint_args * arg): bpf_prog_44a040bf25481309_test_long_fname_2: ; static int test_long_fname_2(struct dummy_tracepoint_args *arg) 0: push %rbp 1: mov %rsp,%rbp 4: sub $0x30,%rsp b: sub $0x28,%rbp f: mov %rbx,0x0(%rbp) 13: mov %r13,0x8(%rbp) 17: mov %r14,0x10(%rbp) 1b: mov %r15,0x18(%rbp) 1f: xor %eax,%eax 21: mov %rax,0x20(%rbp) 25: xor %esi,%esi ; int key = 0; 27: mov %esi,-0x4(%rbp) ; if (!arg->sock) 2a: mov 0x8(%rdi),%rdi ; if (!arg->sock) 2e: cmp $0x0,%rdi 32: je 0x0000000000000070 34: mov %rbp,%rsi ; counts = bpf_map_lookup_elem(&btf_map, &key); [...]”h]”hX$ bpftool prog dump jited pinned /sys/fs/bpf/test_btf_haskv [...] int test_long_fname_2(struct dummy_tracepoint_args * arg): bpf_prog_44a040bf25481309_test_long_fname_2: ; static int test_long_fname_2(struct dummy_tracepoint_args *arg) 0: push %rbp 1: mov %rsp,%rbp 4: sub $0x30,%rsp b: sub $0x28,%rbp f: mov %rbx,0x0(%rbp) 13: mov %r13,0x8(%rbp) 17: mov %r14,0x10(%rbp) 1b: mov %r15,0x18(%rbp) 1f: xor %eax,%eax 21: mov %rax,0x20(%rbp) 25: xor %esi,%esi ; int key = 0; 27: mov %esi,-0x4(%rbp) ; if (!arg->sock) 2a: mov 0x8(%rdi),%rdi ; if (!arg->sock) 2e: cmp $0x0,%rdi 32: je 0x0000000000000070 34: mov %rbp,%rsi ; counts = bpf_map_lookup_elem(&btf_map, &key); [...]”…”�”}”hj–6sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´Mhjw6h²hubeh}”(h]”Œbpftool-prog-dump”ah ]”h"]”Œ5.2 bpftool prog dump”ah$]”h&]”uh1hµhj6h²hh³hÊh´M ubh¶)�”}”(hhh]”(h»)�”}”(hŒ5.3 Verifier Log”h]”hŒ5.3 Verifier Log”…”�”}”(hj¯6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¬6h²hh³hÊh´M,ubhÝ)�”}”(hŒWThe following is an example of how line_info can help debugging verification failure.::”h]”hŒVThe following is an example of how line_info can help debugging verification failure.:”…”�”}”(hj½6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M.hj¬6h²hubj)�”}”(hX{ /* The code at tools/testing/selftests/bpf/test_xdp_noinline.c * is modified as below. */ data = (void *)(long)xdp->data; data_end = (void *)(long)xdp->data_end; /* if (data + 4 > data_end) return XDP_DROP; */ *(u32 *)data = dst->dst; $ bpftool prog load ./test_xdp_noinline.o /sys/fs/bpf/test_xdp_noinline type xdp ; data = (void *)(long)xdp->data; 224: (79) r2 = *(u64 *)(r10 -112) 225: (61) r2 = *(u32 *)(r2 +0) ; *(u32 *)data = dst->dst; 226: (63) *(u32 *)(r2 +0) = r1 invalid access to packet, off=0 size=4, R2(id=0,off=0,r=0) R2 offset is outside of the packet”h]”hX{ /* The code at tools/testing/selftests/bpf/test_xdp_noinline.c * is modified as below. */ data = (void *)(long)xdp->data; data_end = (void *)(long)xdp->data_end; /* if (data + 4 > data_end) return XDP_DROP; */ *(u32 *)data = dst->dst; $ bpftool prog load ./test_xdp_noinline.o /sys/fs/bpf/test_xdp_noinline type xdp ; data = (void *)(long)xdp->data; 224: (79) r2 = *(u64 *)(r10 -112) 225: (61) r2 = *(u32 *)(r2 +0) ; *(u32 *)data = dst->dst; 226: (63) *(u32 *)(r2 +0) = r1 invalid access to packet, off=0 size=4, R2(id=0,off=0,r=0) R2 offset is outside of the packet”…”�”}”hjË6sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´M1hj¬6h²hubeh}”(h]”Œ verifier-log”ah ]”h"]”Œ5.3 verifier log”ah$]”h&]”uh1hµhj6h²hh³hÊh´M,ubeh}”(h]”Œ using-btf”ah ]”h"]”Œ 5. using btf”ah$]”h&]”uh1hµhh·h²hh³hÊh´MÞubh¶)�”}”(hhh]”(h»)�”}”(hŒ6. BTF Generation”h]”hŒ6. BTF Generation”…”�”}”(hjì6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjé6h²hh³hÊh´MFubhÝ)�”}”(hŒYou need latest pahole”h]”hŒYou need latest pahole”…”�”}”(hjú6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MHhjé6h²hubj…)�”}”(hŒ8https://git.kernel.org/pub/scm/devel/pahole/pahole.git/ ”h]”hÝ)�”}”(hŒ7https://git.kernel.org/pub/scm/devel/pahole/pahole.git/”h]”hŒ reference”“”)�”}”(hj7h]”hŒ7https://git.kernel.org/pub/scm/devel/pahole/pahole.git/”…”�”}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j7uh1j7hj 7ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MJhj7ubah}”(h]”h ]”h"]”h$]”h&]”uh1j„h³hÊh´MJhjé6h²hubhÝ)�”}”(hŒŒor llvm (8.0 or later). The pahole acts as a dwarf2btf converter. It doesn't support .BTF.ext and btf BTF_KIND_FUNC type yet. For example,::”h]”hŒ�or llvm (8.0 or later). The pahole acts as a dwarf2btf converter. It doesn’t support .BTF.ext and btf BTF_KIND_FUNC type yet. For example,:”…”�”}”(hj,7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MLhjé6h²hubj)�”}”(hX|-bash-4.4$ cat t.c struct t { int a:2; int b:3; int c:2; } g; -bash-4.4$ gcc -c -O2 -g t.c -bash-4.4$ pahole -JV t.o File t.o: [1] STRUCT t kind_flag=1 size=4 vlen=3 a type_id=2 bitfield_size=2 bits_offset=0 b type_id=2 bitfield_size=3 bits_offset=2 c type_id=2 bitfield_size=2 bits_offset=5 [2] INT int size=4 bit_offset=0 nr_bits=32 encoding=SIGNED”h]”hX|-bash-4.4$ cat t.c struct t { int a:2; int b:3; int c:2; } g; -bash-4.4$ gcc -c -O2 -g t.c -bash-4.4$ pahole -JV t.o File t.o: [1] STRUCT t kind_flag=1 size=4 vlen=3 a type_id=2 bitfield_size=2 bits_offset=0 b type_id=2 bitfield_size=3 bits_offset=2 c type_id=2 bitfield_size=2 bits_offset=5 [2] INT int size=4 bit_offset=0 nr_bits=32 encoding=SIGNED”…”�”}”hj:7sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´MOhjé6h²hubhÝ)�”}”(hŒ¢The llvm is able to generate .BTF and .BTF.ext directly with -g for bpf target only. The assembly code (-S) is able to show the BTF encoding in assembly format.::”h]”hŒ¡The llvm is able to generate .BTF and .BTF.ext directly with -g for bpf target only. The assembly code (-S) is able to show the BTF encoding in assembly format.:”…”�”}”(hjH7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M^hjé6h²hubj)�”}”(hX -bash-4.4$ cat t2.c typedef int __int32; struct t2 { int a2; int (*f2)(char q1, __int32 q2, ...); int (*f3)(); } g2; int main() { return 0; } int test() { return 0; } -bash-4.4$ clang -c -g -O2 --target=bpf t2.c -bash-4.4$ readelf -S t2.o ...... [ 8] .BTF PROGBITS 0000000000000000 00000247 000000000000016e 0000000000000000 0 0 1 [ 9] .BTF.ext PROGBITS 0000000000000000 000003b5 0000000000000060 0000000000000000 0 0 1 [10] .rel.BTF.ext REL 0000000000000000 000007e0 0000000000000040 0000000000000010 16 9 8 ...... -bash-4.4$ clang -S -g -O2 --target=bpf t2.c -bash-4.4$ cat t2.s ...... .section .BTF,"",@progbits .short 60319 # 0xeb9f .byte 1 .byte 0 .long 24 .long 0 .long 220 .long 220 .long 122 .long 0 # BTF_KIND_FUNC_PROTO(id = 1) .long 218103808 # 0xd000000 .long 2 .long 83 # BTF_KIND_INT(id = 2) .long 16777216 # 0x1000000 .long 4 .long 16777248 # 0x1000020 ...... .byte 0 # string offset=0 .ascii ".text" # string offset=1 .byte 0 .ascii "/home/yhs/tmp-pahole/t2.c" # string offset=7 .byte 0 .ascii "int main() { return 0; }" # string offset=33 .byte 0 .ascii "int test() { return 0; }" # string offset=58 .byte 0 .ascii "int" # string offset=83 ...... .section .BTF.ext,"",@progbits .short 60319 # 0xeb9f .byte 1 .byte 0 .long 24 .long 0 .long 28 .long 28 .long 44 .long 8 # FuncInfo .long 1 # FuncInfo section string offset=1 .long 2 .long .Lfunc_begin0 .long 3 .long .Lfunc_begin1 .long 5 .long 16 # LineInfo .long 1 # LineInfo section string offset=1 .long 2 .long .Ltmp0 .long 7 .long 33 .long 7182 # Line 7 Col 14 .long .Ltmp3 .long 7 .long 58 .long 8206 # Line 8 Col 14”h]”hX -bash-4.4$ cat t2.c typedef int __int32; struct t2 { int a2; int (*f2)(char q1, __int32 q2, ...); int (*f3)(); } g2; int main() { return 0; } int test() { return 0; } -bash-4.4$ clang -c -g -O2 --target=bpf t2.c -bash-4.4$ readelf -S t2.o ...... [ 8] .BTF PROGBITS 0000000000000000 00000247 000000000000016e 0000000000000000 0 0 1 [ 9] .BTF.ext PROGBITS 0000000000000000 000003b5 0000000000000060 0000000000000000 0 0 1 [10] .rel.BTF.ext REL 0000000000000000 000007e0 0000000000000040 0000000000000010 16 9 8 ...... -bash-4.4$ clang -S -g -O2 --target=bpf t2.c -bash-4.4$ cat t2.s ...... .section .BTF,"",@progbits .short 60319 # 0xeb9f .byte 1 .byte 0 .long 24 .long 0 .long 220 .long 220 .long 122 .long 0 # BTF_KIND_FUNC_PROTO(id = 1) .long 218103808 # 0xd000000 .long 2 .long 83 # BTF_KIND_INT(id = 2) .long 16777216 # 0x1000000 .long 4 .long 16777248 # 0x1000020 ...... .byte 0 # string offset=0 .ascii ".text" # string offset=1 .byte 0 .ascii "/home/yhs/tmp-pahole/t2.c" # string offset=7 .byte 0 .ascii "int main() { return 0; }" # string offset=33 .byte 0 .ascii "int test() { return 0; }" # string offset=58 .byte 0 .ascii "int" # string offset=83 ...... .section .BTF.ext,"",@progbits .short 60319 # 0xeb9f .byte 1 .byte 0 .long 24 .long 0 .long 28 .long 28 .long 44 .long 8 # FuncInfo .long 1 # FuncInfo section string offset=1 .long 2 .long .Lfunc_begin0 .long 3 .long .Lfunc_begin1 .long 5 .long 16 # LineInfo .long 1 # LineInfo section string offset=1 .long 2 .long .Ltmp0 .long 7 .long 33 .long 7182 # Line 7 Col 14 .long .Ltmp3 .long 7 .long 58 .long 8206 # Line 8 Col 14”…”�”}”hjV7sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´Mbhjé6h²hubeh}”(h]”Œbtf-generation”ah ]”h"]”Œ6. btf generation”ah$]”h&]”uh1hµhh·h²hh³hÊh´MFubh¶)�”}”(hhh]”(h»)�”}”(hŒ 7. Testing”h]”hŒ 7. Testing”…”�”}”(hjo7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjl7h²hh³hÊh´M±ubhÝ)�”}”(hŒwThe kernel BPF selftest `tools/testing/selftests/bpf/prog_tests/btf.c`_ provides an extensive set of BTF-related tests.”h]”(hŒThe kernel BPF selftest ”…”�”}”(hj}7h²hh³Nh´Nubj7)�”}”(hŒ/`tools/testing/selftests/bpf/prog_tests/btf.c`_”h]”hŒ,tools/testing/selftests/bpf/prog_tests/btf.c”…”�”}”(hj…7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ,tools/testing/selftests/bpf/prog_tests/btf.c”Œrefuri”Œrhttps://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/testing/selftests/bpf/prog_tests/btf.c”uh1j7hj}7Œresolved”KubhŒ0 provides an extensive set of BTF-related tests.”…”�”}”(hj}7h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M³hjl7h²hubhŒcomment”“”)�”}”(hŒLinks”h]”hŒLinks”…”�”}”hj¤7sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1j¢7hjl7h²hh³hÊh´M¶ubj°)�”}”(hŒ§.. _tools/testing/selftests/bpf/prog_tests/btf.c: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/testing/selftests/bpf/prog_tests/btf.c”h]”h}”(h]”Œ,tools-testing-selftests-bpf-prog-tests-btf-c”ah ]”h"]”Œ,tools/testing/selftests/bpf/prog_tests/btf.c”ah$]”h&]”j•7j–7uh1j¯h´M·hjl7h²hh³hÊŒ referenced”Kubeh}”(h]”Œtesting”ah ]”h"]”Œ 7. testing”ah$]”h&]”uh1hµhh·h²hh³hÊh´M±ubeh}”(h]”Œbpf-type-format-btf”ah ]”h"]”Œbpf type format (btf)”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”j«(Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jñ7Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œ,tools/testing/selftests/bpf/prog_tests/btf.c”]”j…7asŒrefids”}”(j¼]”j±ajW(]”jM(aj&*]”j*aj¬-]”j¢-aj®0]”j¤0auŒnameids”}”(jÌ7jÉ7jÂj¿j,j¼j,jÿ+j’j�j9(j6(jïjìj#j jù jö j j j5j2j5j2jijfj«j¨jñjîj7j4j}jzjvjsj*j'jjj€j}j´ j± jF$jC$j &j &j1(j.(jú+j÷+j-*jW(j,*j)*jð+j&*jï+jì+jM0jJ0j6-j3-j²-j¯-jé.j¬-jè.jå.j /j/jG/jD/j¶/j³/jE0jB0j6j6j´0j±0jJ3j®0jI3jF3j5j5j 6j6jæ6jã6jt6jq6j©6j¦6jÞ6jÛ6ji7jf7jÄ7jÁ7j»7j¸7uŒ nametypes”}”(jÌ7‰j‰j,ˆj,‰j’‰j9(‰jï‰j#‰jù ‰j ‰j5‰j5‰ji‰j«‰jñ‰j7‰j}‰jv‰j*‰j‰j€‰j´ ‰jF$‰j &‰j1(‰jú+‰j-*ˆj,*‰jð+ˆjï+‰jM0‰j6-‰j²-‰jé.ˆjè.‰j /‰jG/‰j¶/‰jE0‰j6‰j´0‰jJ3ˆjI3‰j5‰j 6‰jæ6‰jt6‰j©6‰jÞ6‰ji7‰jÄ7‰j»7ˆuh}”(jÉ7h·j¿hËj¼jÅjÿ+jÅj�jnj6(j•jìjfj jòjö j&j jü j2j j2j8jfj8j¨jljîj®j4jôjzj:jsj€j'jyjj-j}jj± jƒjC$j· j &jI$j.(j&j÷+j<(jW(jX(j)*jX(j&*j4*jì+j4*jJ0j,j3-jÜ,j¯-j9-j¬-jµ-jå.jµ-j/jî.jD/j#/j³/jJ/jB0j¹/j6jP0j±0ja0j®0j·0jF3j·0j5jO3j6j5jã6j6jq6j&6j¦6jw6jÛ6j¬6jf7jé6jÁ7jl7j¸7j²7j*jk(jå+jE*uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”jÿ7Ks…”R”Œparse_messages”]”(hŒsystem_message”“”)�”}”(hhh]”hÝ)�”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…”�”}”(hj_8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhj\8ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œline”MbŒsource”hÊuh1jZ8hj,h²hh³hÊh´Mbubj[8)�”}”(hhh]”hÝ)�”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…”�”}”(hj{8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhjx8ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ju8Œline”M’Œsource”hÊuh1jZ8hj9-h²hh³hÊh´M’ubj[8)�”}”(hhh]”hÝ)�”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…”�”}”(hj–8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhj“8ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ju8Œline”MÍŒsource”hÊuh1jZ8hjµ-h²hh³hÊh´MÍubj[8)�”}”(hhh]”hÝ)�”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…”�”}”(hj±8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhj®8ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ju8Œline”MúŒsource”hÊuh1jZ8hj&6h²hh³hÊh´MúubeŒtransform_messages”]”(j[8)�”}”(hhh]”hÝ)�”}”(hhh]”hŒ5Hyperlink target "btf-type-string" is not referenced.”…”�”}”hjÎ8sbah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhjË8ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ju8Œsource”hÊŒline”Kuh1jZ8ubj[8)�”}”(hhh]”hÝ)�”}”(hhh]”hŒDHyperlink target "btf-function-linkage-constants" is not referenced.”…”�”}”hjè8sbah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhjå8ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ju8Œsource”hÊŒline”M9uh1jZ8ubj[8)�”}”(hhh]”hÝ)�”}”(hhh]”hŒ?Hyperlink target "btf-var-linkage-constants" is not referenced.”…”�”}”hj9sbah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhjÿ8ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ju8Œsource”hÊŒline”MHuh1jZ8ubj[8)�”}”(hhh]”hÝ)�”}”(hhh]”hŒ3Hyperlink target "bpf-prog-load" is not referenced.”…”�”•š}”hj9sbah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhj9ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ju8Œsource”hÊŒline”Mžuh1jZ8ubj[8)�”}”(hhh]”hÝ)�”}”(hhh]”hŒ5Hyperlink target "btf-ext-section" is not referenced.”…”�”}”hj69sbah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhj39ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ju8Œsource”hÊŒline”Muh1jZ8ubeŒ transformer”NŒ include_log”]”Œ decoration”Nh²hub.