Lines Matching defs:btf
30 struct btf { struct
32 void *raw_data;
34 void *raw_data_swapped;
35 __u32 raw_size;
59 * and cached again if user calls btf__get_raw_data(), at which point argument
76 struct btf_header *hdr; argument
81 /* type ID to `struct btf_type *` lookup index */ argument
82 __u32 *type_offs;
83 size_t type_offs_cap;
84 __u32 nr_types;
86 void *strs_data;
87 size_t strs_data_cap; /* used size stored in hdr->str_len */
90 struct hashmap *strs_hash;
115 void *btf_add_mem(void **data, size_t *cap_cnt, size_t elem_sz, in btf_add_mem() argument
166 static int btf_add_type_idx_entry(struct btf *btf, __u32 type_off) in btf_add_type_idx_entry()
189 static int btf_parse_hdr(struct btf *btf) in btf_parse_hdr()
238 static int btf_parse_str_sec(struct btf *btf) in btf_parse_str_sec()
359 static int btf_parse_type_sec(struct btf *btf) in btf_parse_type_sec()
407 __u32 btf__get_nr_types(const struct btf *btf) in btf__get_nr_types()
413 static struct btf_type *btf_type_by_id(struct btf *btf, __u32 type_id) in btf_type_by_id()
421 const struct btf_type *btf__type_by_id(const struct btf *btf, __u32 type_id) in btf__type_by_id()
428 static int determine_ptr_size(const struct btf *btf) in determine_ptr_size()
454 static size_t btf_ptr_sz(const struct btf *btf) in btf_ptr_sz()
469 size_t btf__pointer_size(const struct btf *btf) in btf__pointer_size()
484 int btf__set_pointer_size(struct btf *btf, size_t ptr_sz) in btf__set_pointer_size()
503 enum btf_endianness btf__endianness(const struct btf *btf) in btf__endianness()
511 int btf__set_endianness(struct btf *btf, enum btf_endianness endian) in btf__set_endianness()
536 __s64 btf__resolve_size(const struct btf *btf, __u32 type_id) in btf__resolve_size()
588 int btf__align_of(const struct btf *btf, __u32 id) in btf__align_of()
627 int btf__resolve_type(const struct btf *btf, __u32 type_id) in btf__resolve_type()
647 __s32 btf__find_by_name(const struct btf *btf, const char *type_name) in btf__find_by_name()
665 __s32 btf__find_by_name_kind(const struct btf *btf, const char *type_name, in btf__find_by_name_kind()
687 static bool btf_is_modifiable(const struct btf *btf) in btf_is_modifiable()
692 void btf__free(struct btf *btf) in btf__free()
719 struct btf *btf; in btf__new_empty() local
751 struct btf *btf; in btf__new() local
794 struct btf *btf = NULL; in btf__parse_elf() local
915 struct btf *btf = NULL; in btf__parse_raw() local
978 struct btf *btf; in btf__parse() local
998 static int btf_fixup_datasec(struct bpf_object *obj, struct btf *btf, in btf_fixup_datasec()
1060 int btf__finalize_data(struct bpf_object *obj, struct btf *btf) in btf__finalize_data()
1085 int btf__load(struct btf *btf) in btf__load()
1134 int btf__fd(const struct btf *btf) in btf__fd()
1139 void btf__set_fd(struct btf *btf, int fd) in btf__set_fd()
1144 static void *btf_get_raw_data(const struct btf *btf, __u32 *size, bool swap_endian) in btf_get_raw_data()
1196 struct btf *btf = (struct btf *)btf_ro; in btf__get_raw_data() local
1213 const char *btf__str_by_offset(const struct btf *btf, __u32 offset) in btf__str_by_offset()
1221 const char *btf__name_by_offset(const struct btf *btf, __u32 offset) in btf__name_by_offset()
1226 int btf__get_from_id(__u32 id, struct btf **btf) in btf__get_from_id()
1290 int btf__get_map_kv_tids(const struct btf *btf, const char *map_name, in btf__get_map_kv_tids()
1363 struct btf *btf = ctx; in strs_hash_fn() local
1371 struct btf *btf = ctx; in strs_hash_equal_fn() local
1378 static void btf_invalidate_raw_data(struct btf *btf) in btf_invalidate_raw_data()
1394 static int btf_ensure_modifiable(struct btf *btf) in btf_ensure_modifiable()
1463 static void *btf_add_str_mem(struct btf *btf, size_t add_sz) in btf_add_str_mem()
1475 int btf__find_str(struct btf *btf, const char *s) in btf__find_str()
1504 int btf__add_str(struct btf *btf, const char *s) in btf__add_str()
1544 static void *btf_add_type_mem(struct btf *btf, size_t add_sz) in btf_add_type_mem()
1569 int btf__add_int(struct btf *btf, const char *name, size_t byte_sz, int encoding) in btf__add_int()
1628 static int btf_add_ref_kind(struct btf *btf, int kind, const char *name, int ref_type_id) in btf_add_ref_kind()
1671 int btf__add_ptr(struct btf *btf, int ref_type_id) in btf__add_ptr()
1685 int btf__add_array(struct btf *btf, int index_type_id, int elem_type_id, __u32 nr_elems) in btf__add_array()
1722 static int btf_add_composite(struct btf *btf, int kind, const char *name, __u32 bytes_sz) in btf_add_composite()
1770 int btf__add_struct(struct btf *btf, const char *name, __u32 byte_sz) in btf__add_struct()
1788 int btf__add_union(struct btf *btf, const char *name, __u32 byte_sz) in btf__add_union()
1803 int btf__add_field(struct btf *btf, const char *name, int type_id, in btf__add_field()
1871 int btf__add_enum(struct btf *btf, const char *name, __u32 byte_sz) in btf__add_enum()
1917 int btf__add_enum_value(struct btf *btf, const char *name, __s64 value) in btf__add_enum_value()
1970 int btf__add_fwd(struct btf *btf, const char *name, enum btf_fwd_kind fwd_kind) in btf__add_fwd()
2006 int btf__add_typedef(struct btf *btf, const char *name, int ref_type_id) in btf__add_typedef()
2021 int btf__add_volatile(struct btf *btf, int ref_type_id) in btf__add_volatile()
2033 int btf__add_const(struct btf *btf, int ref_type_id) in btf__add_const()
2045 int btf__add_restrict(struct btf *btf, int ref_type_id) in btf__add_restrict()
2058 int btf__add_func(struct btf *btf, const char *name, in btf__add_func()
2090 int btf__add_func_proto(struct btf *btf, int ret_type_id) in btf__add_func_proto()
2131 int btf__add_func_param(struct btf *btf, const char *name, int type_id) in btf__add_func_param()
2184 int btf__add_var(struct btf *btf, const char *name, int linkage, int type_id) in btf__add_var()
2241 int btf__add_datasec(struct btf *btf, const char *name, __u32 byte_sz) in btf__add_datasec()
2287 int btf__add_datasec_var_info(struct btf *btf, int var_type_id, __u32 offset, __u32 byte_sz) in btf__add_datasec_var_info()
2558 static int btf_ext_reloc_info(const struct btf *btf, in btf_ext_reloc_info()
2606 int btf_ext__reloc_func_info(const struct btf *btf, in btf_ext__reloc_func_info()
2615 int btf_ext__reloc_line_info(const struct btf *btf, in btf_ext__reloc_line_info()
2783 int btf__dedup(struct btf *btf, struct btf_ext *btf_ext, in btf__dedup()
2838 struct btf *btf; member
2948 static struct btf_dedup *btf_dedup_new(struct btf *btf, struct btf_ext *btf_ext, in btf_dedup_new()
4445 struct btf *btf; in libbpf_find_kernel_btf() local