8 BTF (BPF Type Format) is the metadata format which encodes the debug info
9 related to BPF program/map. The name BTF was used initially to describe data
10 types. The BTF was later extended to include function info for defined
11 subroutines, and line info for source/line information.
13 The debug info is used for map pretty print, function signature, etc. The
14 function signature enables better bpf program/function kernel symbol. The line
15 info helps generate source annotated translated byte code, jited code and
18 The BTF specification contains two parts,
22 The kernel API is the contract between user space and kernel. The kernel
23 verifies the BTF info before using it. The ELF file format is a user space
24 contract between ELF file and libbpf loader.
26 The type and string sections are part of the BTF kernel API, describing the
27 debug info (mostly types related) referenced by the bpf program. These two
28 sections are discussed in details in :ref:`BTF_Type_String`.
32 2. BTF Type and String Encoding
33 *******************************
35 The file ``include/uapi/linux/btf.h`` provides high-level definition of how
36 types/strings are encoded.
38 The beginning of data blob must be::
46 /* All offsets are in bytes relative to the end of this header */
47 __u32 type_off; /* offset of type section */
48 __u32 type_len; /* length of type section */
49 __u32 str_off; /* offset of string section */
50 __u32 str_len; /* length of string section */
53 The magic is ``0xeB9F``, which has different encoding for big and little
54 endian systems, and can be used to test whether BTF is generated for big- or
55 little-endian target. The ``btf_header`` is designed to be extensible with
56 ``hdr_len`` equal to ``sizeof(struct btf_header)`` when a data blob is
62 The first string in the string section must be a null string. The rest of
63 string table is a concatenation of other null-terminated strings.
68 The type id ``0`` is reserved for ``void`` type. The type section is parsed
69 sequentially and type id is assigned to each recognized type starting from id
70 ``1``. Currently, the following types are supported::
72 #define BTF_KIND_INT 1 /* Integer */
73 #define BTF_KIND_PTR 2 /* Pointer */
74 #define BTF_KIND_ARRAY 3 /* Array */
75 #define BTF_KIND_STRUCT 4 /* Struct */
76 #define BTF_KIND_UNION 5 /* Union */
77 #define BTF_KIND_ENUM 6 /* Enumeration */
78 #define BTF_KIND_FWD 7 /* Forward */
79 #define BTF_KIND_TYPEDEF 8 /* Typedef */
80 #define BTF_KIND_VOLATILE 9 /* Volatile */
81 #define BTF_KIND_CONST 10 /* Const */
82 #define BTF_KIND_RESTRICT 11 /* Restrict */
83 #define BTF_KIND_FUNC 12 /* Function */
84 #define BTF_KIND_FUNC_PROTO 13 /* Function Proto */
86 Note that the type section encodes debug info, not just pure types.
87 ``BTF_KIND_FUNC`` is not a type, and it represents a defined subprogram.
89 Each type contains the following common data::
93 /* "info" bits arrangement
94 * bits 0-15: vlen (e.g. # of struct's members)
96 * bits 24-27: kind (e.g. int, ptr, array...etc)
98 * bit 31: kind_flag, currently used by
99 * struct, union and fwd
102 /* "size" is used by INT, ENUM, STRUCT and UNION.
103 * "size" tells the size of the type it is describing.
105 * "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT,
106 * FUNC and FUNC_PROTO.
107 * "type" is a type_id referring to another type.
115 For certain kinds, the common data are followed by kind-specific data. The
116 ``name_off`` in ``struct btf_type`` specifies the offset in the string table.
117 The following sections detail encoding of each kind.
122 ``struct btf_type`` encoding requirement:
123 * ``name_off``: any valid offset
124 * ``info.kind_flag``: 0
125 * ``info.kind``: BTF_KIND_INT
127 * ``size``: the size of the int type in bytes.
129 ``btf_type`` is followed by a ``u32`` with the following bits arrangement::
131 #define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24)
132 #define BTF_INT_OFFSET(VAL) (((VAL & 0x00ff0000)) >> 16)
133 #define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff)
135 The ``BTF_INT_ENCODING`` has the following attributes::
137 #define BTF_INT_SIGNED (1 << 0)
138 #define BTF_INT_CHAR (1 << 1)
139 #define BTF_INT_BOOL (1 << 2)
141 The ``BTF_INT_ENCODING()`` provides extra information: signedness, char, or
142 bool, for the int type. The char and bool encoding are mostly useful for
143 pretty print. At most one encoding can be specified for the int type.
145 The ``BTF_INT_BITS()`` specifies the number of actual bits held by this int
146 type. For example, a 4-bit bitfield encodes ``BTF_INT_BITS()`` equals to 4.
147 The ``btf_type.size * 8`` must be equal to or greater than ``BTF_INT_BITS()``
148 for the type. The maximum value of ``BTF_INT_BITS()`` is 128.
150 The ``BTF_INT_OFFSET()`` specifies the starting bit offset to calculate values
151 for this int. For example, a bitfield struct member has: * btf member bit
152 offset 100 from the start of the structure, * btf member pointing to an int
153 type, * the int type has ``BTF_INT_OFFSET() = 2`` and ``BTF_INT_BITS() = 4``
155 Then in the struct memory layout, this member will occupy ``4`` bits starting
156 from bits ``100 + 2 = 102``.
158 Alternatively, the bitfield struct member can be the following to access the
159 same bits as the above:
161 * btf member bit offset 102,
162 * btf member pointing to an int type,
163 * the int type has ``BTF_INT_OFFSET() = 0`` and ``BTF_INT_BITS() = 4``
165 The original intention of ``BTF_INT_OFFSET()`` is to provide flexibility of
166 bitfield encoding. Currently, both llvm and pahole generate
167 ``BTF_INT_OFFSET() = 0`` for all int types.
172 ``struct btf_type`` encoding requirement:
174 * ``info.kind_flag``: 0
175 * ``info.kind``: BTF_KIND_PTR
177 * ``type``: the pointee type of the pointer
179 No additional type data follow ``btf_type``.
184 ``struct btf_type`` encoding requirement:
186 * ``info.kind_flag``: 0
187 * ``info.kind``: BTF_KIND_ARRAY
189 * ``size/type``: 0, not used
191 ``btf_type`` is followed by one ``struct btf_array``::
199 The ``struct btf_array`` encoding:
200 * ``type``: the element type
201 * ``index_type``: the index type
202 * ``nelems``: the number of elements for this array (``0`` is also allowed).
204 The ``index_type`` can be any regular int type (``u8``, ``u16``, ``u32``,
205 ``u64``, ``unsigned __int128``). The original design of including
206 ``index_type`` follows DWARF, which has an ``index_type`` for its array type.
207 Currently in BTF, beyond type verification, the ``index_type`` is not used.
209 The ``struct btf_array`` allows chaining through element type to represent
210 multidimensional arrays. For example, for ``int a[5][6]``, the following type
211 information illustrates the chaining:
214 * [2]: array, ``btf_array.type = [1]``, ``btf_array.nelems = 6``
215 * [3]: array, ``btf_array.type = [2]``, ``btf_array.nelems = 5``
217 Currently, both pahole and llvm collapse multidimensional array into
218 one-dimensional array, e.g., for ``a[5][6]``, the ``btf_array.nelems`` is
219 equal to ``30``. This is because the original use case is map pretty print
220 where the whole array is dumped out so one-dimensional array is enough. As
221 more BTF usage is explored, pahole and llvm can be changed to generate proper
222 chained representation for multidimensional arrays.
224 2.2.4 BTF_KIND_STRUCT
225 ~~~~~~~~~~~~~~~~~~~~~
229 ``struct btf_type`` encoding requirement:
230 * ``name_off``: 0 or offset to a valid C identifier
231 * ``info.kind_flag``: 0 or 1
232 * ``info.kind``: BTF_KIND_STRUCT or BTF_KIND_UNION
233 * ``info.vlen``: the number of struct/union members
234 * ``info.size``: the size of the struct/union in bytes
236 ``btf_type`` is followed by ``info.vlen`` number of ``struct btf_member``.::
244 ``struct btf_member`` encoding:
245 * ``name_off``: offset to a valid C identifier
246 * ``type``: the member type
247 * ``offset``: <see below>
249 If the type info ``kind_flag`` is not set, the offset contains only bit offset
250 of the member. Note that the base type of the bitfield can only be int or enum
251 type. If the bitfield size is 32, the base type can be either int or enum
252 type. If the bitfield size is not 32, the base type must be int, and int type
253 ``BTF_INT_BITS()`` encodes the bitfield size.
255 If the ``kind_flag`` is set, the ``btf_member.offset`` contains both member
256 bitfield size and bit offset. The bitfield size and bit offset are calculated
259 #define BTF_MEMBER_BITFIELD_SIZE(val) ((val) >> 24)
260 #define BTF_MEMBER_BIT_OFFSET(val) ((val) & 0xffffff)
262 In this case, if the base type is an int type, it must be a regular int type:
264 * ``BTF_INT_OFFSET()`` must be 0.
265 * ``BTF_INT_BITS()`` must be equal to ``{1,2,4,8,16} * 8``.
267 The following kernel patch introduced ``kind_flag`` and explained why both
270 https://github.com/torvalds/linux/commit/9d5f9f701b1891466fb3dbb1806ad97716f95cc3#diff-fa650a64fdd3968396883d2fe8215ff3
275 ``struct btf_type`` encoding requirement:
276 * ``name_off``: 0 or offset to a valid C identifier
277 * ``info.kind_flag``: 0
278 * ``info.kind``: BTF_KIND_ENUM
279 * ``info.vlen``: number of enum values
282 ``btf_type`` is followed by ``info.vlen`` number of ``struct btf_enum``.::
289 The ``btf_enum`` encoding:
290 * ``name_off``: offset to a valid C identifier
296 ``struct btf_type`` encoding requirement:
297 * ``name_off``: offset to a valid C identifier
298 * ``info.kind_flag``: 0 for struct, 1 for union
299 * ``info.kind``: BTF_KIND_FWD
303 No additional type data follow ``btf_type``.
305 2.2.8 BTF_KIND_TYPEDEF
306 ~~~~~~~~~~~~~~~~~~~~~~
308 ``struct btf_type`` encoding requirement:
309 * ``name_off``: offset to a valid C identifier
310 * ``info.kind_flag``: 0
311 * ``info.kind``: BTF_KIND_TYPEDEF
313 * ``type``: the type which can be referred by name at ``name_off``
315 No additional type data follow ``btf_type``.
317 2.2.9 BTF_KIND_VOLATILE
318 ~~~~~~~~~~~~~~~~~~~~~~~
320 ``struct btf_type`` encoding requirement:
322 * ``info.kind_flag``: 0
323 * ``info.kind``: BTF_KIND_VOLATILE
325 * ``type``: the type with ``volatile`` qualifier
327 No additional type data follow ``btf_type``.
329 2.2.10 BTF_KIND_CONST
330 ~~~~~~~~~~~~~~~~~~~~~
332 ``struct btf_type`` encoding requirement:
334 * ``info.kind_flag``: 0
335 * ``info.kind``: BTF_KIND_CONST
337 * ``type``: the type with ``const`` qualifier
339 No additional type data follow ``btf_type``.
341 2.2.11 BTF_KIND_RESTRICT
342 ~~~~~~~~~~~~~~~~~~~~~~~~
344 ``struct btf_type`` encoding requirement:
346 * ``info.kind_flag``: 0
347 * ``info.kind``: BTF_KIND_RESTRICT
349 * ``type``: the type with ``restrict`` qualifier
351 No additional type data follow ``btf_type``.
356 ``struct btf_type`` encoding requirement:
357 * ``name_off``: offset to a valid C identifier
358 * ``info.kind_flag``: 0
359 * ``info.kind``: BTF_KIND_FUNC
361 * ``type``: a BTF_KIND_FUNC_PROTO type
363 No additional type data follow ``btf_type``.
365 A BTF_KIND_FUNC defines not a type, but a subprogram (function) whose
366 signature is defined by ``type``. The subprogram is thus an instance of that
367 type. The BTF_KIND_FUNC may in turn be referenced by a func_info in the
368 :ref:`BTF_Ext_Section` (ELF) or in the arguments to :ref:`BPF_Prog_Load`
371 2.2.13 BTF_KIND_FUNC_PROTO
372 ~~~~~~~~~~~~~~~~~~~~~~~~~~
374 ``struct btf_type`` encoding requirement:
376 * ``info.kind_flag``: 0
377 * ``info.kind``: BTF_KIND_FUNC_PROTO
378 * ``info.vlen``: # of parameters
379 * ``type``: the return type
381 ``btf_type`` is followed by ``info.vlen`` number of ``struct btf_param``.::
388 If a BTF_KIND_FUNC_PROTO type is referred by a BTF_KIND_FUNC type, then
389 ``btf_param.name_off`` must point to a valid C identifier except for the
390 possible last argument representing the variable argument. The btf_param.type
391 refers to parameter type.
393 If the function has variable arguments, the last parameter is encoded with
394 ``name_off = 0`` and ``type = 0``.
399 The following bpf syscall command involves BTF:
400 * BPF_BTF_LOAD: load a blob of BTF data into kernel
401 * BPF_MAP_CREATE: map creation with btf key and value type info.
402 * BPF_PROG_LOAD: prog load with btf function and line info.
403 * BPF_BTF_GET_FD_BY_ID: get a btf fd
404 * BPF_OBJ_GET_INFO_BY_FD: btf, func_info, line_info
405 and other btf related info are returned.
407 The workflow typically looks like:
414 BPF_MAP_CREATE and BPF_PROG_LOAD
421 BPF_{PROG,MAP}_GET_NEXT_ID (get prog/map id's)
424 BPF_{PROG,MAP}_GET_FD_BY_ID (get a prog/map fd)
427 BPF_OBJ_GET_INFO_BY_FD (get bpf_prog_info/bpf_map_info with btf_id)
430 BPF_BTF_GET_FD_BY_ID (get btf_fd) |
433 BPF_OBJ_GET_INFO_BY_FD (get btf) |
436 pretty print types, dump func signatures and line info, etc.
442 Load a blob of BTF data into kernel. A blob of data, described in
443 :ref:`BTF_Type_String`, can be directly loaded into the kernel. A ``btf_fd``
444 is returned to a userspace.
449 A map can be created with ``btf_fd`` and specified key/value type id.::
451 __u32 btf_fd; /* fd pointing to a BTF type data */
452 __u32 btf_key_type_id; /* BTF type_id of the key */
453 __u32 btf_value_type_id; /* BTF type_id of the value */
455 In libbpf, the map can be defined with extra annotation like below:
458 struct bpf_map_def SEC("maps") btf_map = {
459 .type = BPF_MAP_TYPE_ARRAY,
460 .key_size = sizeof(int),
461 .value_size = sizeof(struct ipv_counts),
464 BPF_ANNOTATE_KV_PAIR(btf_map, int, struct ipv_counts);
466 Here, the parameters for macro BPF_ANNOTATE_KV_PAIR are map name, key and
467 value types for the map. During ELF parsing, libbpf is able to extract
468 key/value type_id's and assign them to BPF_MAP_CREATE attributes
476 During prog_load, func_info and line_info can be passed to kernel with proper
477 values for the following attributes:
483 __u32 prog_btf_fd; /* fd pointing to BTF type data */
484 __u32 func_info_rec_size; /* userspace bpf_func_info size */
485 __aligned_u64 func_info; /* func info */
486 __u32 func_info_cnt; /* number of bpf_func_info records */
487 __u32 line_info_rec_size; /* userspace bpf_line_info size */
488 __aligned_u64 line_info; /* line info */
489 __u32 line_info_cnt; /* number of bpf_line_info records */
491 The func_info and line_info are an array of below, respectively.::
493 struct bpf_func_info {
494 __u32 insn_off; /* [0, insn_cnt - 1] */
495 __u32 type_id; /* pointing to a BTF_KIND_FUNC type */
497 struct bpf_line_info {
498 __u32 insn_off; /* [0, insn_cnt - 1] */
499 __u32 file_name_off; /* offset to string table for the filename */
500 __u32 line_off; /* offset to string table for the source line */
501 __u32 line_col; /* line number and column number */
504 func_info_rec_size is the size of each func_info record, and
505 line_info_rec_size is the size of each line_info record. Passing the record
506 size to kernel make it possible to extend the record itself in the future.
508 Below are requirements for func_info:
509 * func_info[0].insn_off must be 0.
510 * the func_info insn_off is in strictly increasing order and matches
513 Below are requirements for line_info:
514 * the first insn in each func must have a line_info record pointing to it.
515 * the line_info insn_off is in strictly increasing order.
517 For line_info, the line number and column number are defined as below:
520 #define BPF_LINE_INFO_LINE_NUM(line_col) ((line_col) >> 10)
521 #define BPF_LINE_INFO_LINE_COL(line_col) ((line_col) & 0x3ff)
523 3.4 BPF_{PROG,MAP}_GET_NEXT_ID
525 In kernel, every loaded program, map or btf has a unique id. The id won't
526 change during the lifetime of a program, map, or btf.
528 The bpf syscall command BPF_{PROG,MAP}_GET_NEXT_ID returns all id's, one for
529 each command, to user space, for bpf program or maps, respectively, so an
530 inspection tool can inspect all programs and maps.
532 3.5 BPF_{PROG,MAP}_GET_FD_BY_ID
534 An introspection tool cannot use id to get details about program or maps.
535 A file descriptor needs to be obtained first for reference-counting purpose.
537 3.6 BPF_OBJ_GET_INFO_BY_FD
538 ==========================
540 Once a program/map fd is acquired, an introspection tool can get the detailed
541 information from kernel about this fd, some of which are BTF-related. For
542 example, ``bpf_map_info`` returns ``btf_id`` and key/value type ids.
543 ``bpf_prog_info`` returns ``btf_id``, func_info, and line info for translated
544 bpf byte codes, and jited_line_info.
546 3.7 BPF_BTF_GET_FD_BY_ID
547 ========================
549 With ``btf_id`` obtained in ``bpf_map_info`` and ``bpf_prog_info``, bpf
550 syscall command BPF_BTF_GET_FD_BY_ID can retrieve a btf fd. Then, with
551 command BPF_OBJ_GET_INFO_BY_FD, the btf blob, originally loaded into the
552 kernel with BPF_BTF_LOAD, can be retrieved.
554 With the btf blob, ``bpf_map_info``, and ``bpf_prog_info``, an introspection
555 tool has full btf knowledge and is able to pretty print map key/values, dump
556 func signatures and line info, along with byte/jit codes.
558 4. ELF File Format Interface
559 ****************************
564 The .BTF section contains type and string data. The format of this section is
565 same as the one describe in :ref:`BTF_Type_String`.
572 The .BTF.ext section encodes func_info and line_info which needs loader
573 manipulation before loading into the kernel.
575 The specification for .BTF.ext section is defined at ``tools/lib/bpf/btf.h``
576 and ``tools/lib/bpf/btf.c``.
578 The current header of .BTF.ext section::
580 struct btf_ext_header {
586 /* All offsets are in bytes relative to the end of this header */
593 It is very similar to .BTF section. Instead of type/string section, it
594 contains func_info and line_info section. See :ref:`BPF_Prog_Load` for details
595 about func_info and line_info record format.
597 The func_info is organized as below.::
600 btf_ext_info_sec for section #1 /* func_info for section #1 */
601 btf_ext_info_sec for section #2 /* func_info for section #2 */
604 ``func_info_rec_size`` specifies the size of ``bpf_func_info`` structure when
605 .BTF.ext is generated. ``btf_ext_info_sec``, defined below, is a collection of
606 func_info for each specific ELF section.::
608 struct btf_ext_info_sec {
609 __u32 sec_name_off; /* offset to section name */
611 /* Followed by num_info * record_size number of bytes */
615 Here, num_info must be greater than 0.
617 The line_info is organized as below.::
620 btf_ext_info_sec for section #1 /* line_info for section #1 */
621 btf_ext_info_sec for section #2 /* line_info for section #2 */
624 ``line_info_rec_size`` specifies the size of ``bpf_line_info`` structure when
625 .BTF.ext is generated.
627 The interpretation of ``bpf_func_info->insn_off`` and
628 ``bpf_line_info->insn_off`` is different between kernel API and ELF API. For
629 kernel API, the ``insn_off`` is the instruction offset in the unit of ``struct
630 bpf_insn``. For ELF API, the ``insn_off`` is the byte offset from the
631 beginning of section (``btf_ext_info_sec->sec_name_off``).
636 5.1 bpftool map pretty print
637 ============================
639 With BTF, the map key/value can be printed based on fields rather than simply
640 raw bytes. This is especially valuable for large structure or if your data
641 structure has bitfields. For example, for the following map,::
643 enum A { A1, A2, A3, A4, A5 };
654 struct bpf_map_def SEC("maps") tmpmap = {
655 .type = BPF_MAP_TYPE_ARRAY,
656 .key_size = sizeof(__u32),
657 .value_size = sizeof(struct tmp_t),
660 BPF_ANNOTATE_KV_PAIR(tmpmap, int, struct tmp_t);
662 bpftool is able to pretty print like below:
678 5.2 bpftool prog dump
679 =====================
681 The following is an example showing how func_info and line_info can help prog
682 dump with better kernel symbol names, function prototypes and line
685 $ bpftool prog dump jited pinned /sys/fs/bpf/test_btf_haskv
687 int test_long_fname_2(struct dummy_tracepoint_args * arg):
688 bpf_prog_44a040bf25481309_test_long_fname_2:
689 ; static int test_long_fname_2(struct dummy_tracepoint_args *arg)
694 f: mov %rbx,0x0(%rbp)
695 13: mov %r13,0x8(%rbp)
696 17: mov %r14,0x10(%rbp)
697 1b: mov %r15,0x18(%rbp)
699 21: mov %rax,0x20(%rbp)
702 27: mov %esi,-0x4(%rbp)
704 2a: mov 0x8(%rdi),%rdi
707 32: je 0x0000000000000070
709 ; counts = bpf_map_lookup_elem(&btf_map, &key);
715 The following is an example of how line_info can help debugging verification
718 /* The code at tools/testing/selftests/bpf/test_xdp_noinline.c
719 * is modified as below.
721 data = (void *)(long)xdp->data;
722 data_end = (void *)(long)xdp->data_end;
724 if (data + 4 > data_end)
727 *(u32 *)data = dst->dst;
729 $ bpftool prog load ./test_xdp_noinline.o /sys/fs/bpf/test_xdp_noinline type xdp
730 ; data = (void *)(long)xdp->data;
731 224: (79) r2 = *(u64 *)(r10 -112)
732 225: (61) r2 = *(u32 *)(r2 +0)
733 ; *(u32 *)data = dst->dst;
734 226: (63) *(u32 *)(r2 +0) = r1
735 invalid access to packet, off=0 size=4, R2(id=0,off=0,r=0)
736 R2 offset is outside of the packet
741 You need latest pahole
743 https://git.kernel.org/pub/scm/devel/pahole/pahole.git/
745 or llvm (8.0 or later). The pahole acts as a dwarf2btf converter. It doesn't
746 support .BTF.ext and btf BTF_KIND_FUNC type yet. For example,::
754 -bash-4.4$ gcc -c -O2 -g t.c
755 -bash-4.4$ pahole -JV t.o
757 [1] STRUCT t kind_flag=1 size=4 vlen=3
758 a type_id=2 bitfield_size=2 bits_offset=0
759 b type_id=2 bitfield_size=3 bits_offset=2
760 c type_id=2 bitfield_size=2 bits_offset=5
761 [2] INT int size=4 bit_offset=0 nr_bits=32 encoding=SIGNED
763 The llvm is able to generate .BTF and .BTF.ext directly with -g for bpf target
764 only. The assembly code (-S) is able to show the BTF encoding in assembly
771 int (*f2)(char q1, __int32 q2, ...);
774 int main() { return 0; }
775 int test() { return 0; }
776 -bash-4.4$ clang -c -g -O2 -target bpf t2.c
777 -bash-4.4$ readelf -S t2.o
779 [ 8] .BTF PROGBITS 0000000000000000 00000247
780 000000000000016e 0000000000000000 0 0 1
781 [ 9] .BTF.ext PROGBITS 0000000000000000 000003b5
782 0000000000000060 0000000000000000 0 0 1
783 [10] .rel.BTF.ext REL 0000000000000000 000007e0
784 0000000000000040 0000000000000010 16 9 8
786 -bash-4.4$ clang -S -g -O2 -target bpf t2.c
789 .section .BTF,"",@progbits
790 .short 60319 # 0xeb9f
798 .long 0 # BTF_KIND_FUNC_PROTO(id = 1)
799 .long 218103808 # 0xd000000
801 .long 83 # BTF_KIND_INT(id = 2)
802 .long 16777216 # 0x1000000
804 .long 16777248 # 0x1000020
806 .byte 0 # string offset=0
807 .ascii ".text" # string offset=1
809 .ascii "/home/yhs/tmp-pahole/t2.c" # string offset=7
811 .ascii "int main() { return 0; }" # string offset=33
813 .ascii "int test() { return 0; }" # string offset=58
815 .ascii "int" # string offset=83
817 .section .BTF.ext,"",@progbits
818 .short 60319 # 0xeb9f
827 .long 1 # FuncInfo section string offset=1
834 .long 1 # LineInfo section string offset=1
839 .long 7182 # Line 7 Col 14
843 .long 8206 # Line 8 Col 14
848 Kernel bpf selftest `test_btf.c` provides extensive set of BTF-related tests.