/external/libbpf/src/ |
D | btf.h | 23 struct btf; 38 LIBBPF_API void btf__free(struct btf *btf); 54 LIBBPF_API struct btf *btf__new(const void *data, __u32 size); 76 LIBBPF_API struct btf *btf__new_split(const void *data, __u32 size, struct btf *base_btf); 90 LIBBPF_API struct btf *btf__new_empty(void); 108 LIBBPF_API struct btf *btf__new_empty_split(struct btf *base_btf); 110 LIBBPF_API struct btf *btf__parse(const char *path, struct btf_ext **btf_ext); 111 LIBBPF_API struct btf *btf__parse_split(const char *path, struct btf *base_btf); 112 LIBBPF_API struct btf *btf__parse_elf(const char *path, struct btf_ext **btf_ext); 113 LIBBPF_API struct btf *btf__parse_elf_split(const char *path, struct btf *base_btf); [all …]
|
D | btf.c | 31 struct btf { struct 97 struct btf *base_btf; argument 192 static void *btf_add_type_offs_mem(struct btf *btf, size_t add_cnt) in btf_add_type_offs_mem() argument 194 return libbpf_add_mem((void **)&btf->type_offs, &btf->type_offs_cap, sizeof(__u32), in btf_add_type_offs_mem() 195 btf->nr_types, BTF_MAX_NR_TYPES, add_cnt); in btf_add_type_offs_mem() 198 static int btf_add_type_idx_entry(struct btf *btf, __u32 type_off) in btf_add_type_idx_entry() argument 202 p = btf_add_type_offs_mem(btf, 1); in btf_add_type_idx_entry() 220 static int btf_parse_hdr(struct btf *btf) in btf_parse_hdr() argument 222 struct btf_header *hdr = btf->hdr; in btf_parse_hdr() 225 if (btf->raw_size < sizeof(struct btf_header)) { in btf_parse_hdr() [all …]
|
D | relo_core.c | 22 skip_mods_and_typedefs(const struct btf *btf, u32 id, u32 *res_id) in skip_mods_and_typedefs() argument 24 return btf_type_skip_modifiers(btf, id, res_id); in skip_mods_and_typedefs() 27 static const char *btf__name_by_offset(const struct btf *btf, u32 offset) in btf__name_by_offset() argument 29 return btf_name_by_offset(btf, offset); in btf__name_by_offset() 32 static s64 btf__resolve_size(const struct btf *btf, u32 type_id) in btf__resolve_size() argument 37 t = btf_type_by_id(btf, type_id); in btf__resolve_size() 38 t = btf_resolve_size(btf, t, &size); in btf__resolve_size() 71 static bool is_flex_arr(const struct btf *btf, in is_flex_arr() argument 82 t = btf_type_by_id(btf, acc->type_id); in is_flex_arr() 181 static int bpf_core_parse_spec(const char *prog_name, const struct btf *btf, in bpf_core_parse_spec() argument [all …]
|
D | relo_core.h | 10 const struct btf *btf; member 30 const struct btf *btf; member 50 const struct btf *local_btf, 53 int bpf_core_types_are_compat(const struct btf *local_btf, __u32 local_id, 54 const struct btf *targ_btf, __u32 targ_id);
|
D | linker.c | 58 struct btf *btf; member 147 struct btf *btf; member 197 btf__free(linker->btf); in bpf_linker__free() 420 linker->btf = btf__new_empty(); in init_output_elf() 421 err = libbpf_get_error(linker->btf); in init_output_elf() 461 btf__free(obj.btf); in bpf_linker__add_file() 656 obj->btf = btf__new(data->d_buf, shdr->sh_size); in linker_load_obj_file() 657 err = libbpf_get_error(obj->btf); in linker_load_obj_file() 922 struct btf *btf = ctx; in check_btf_type_id() local 924 if (*type_id >= btf__type_cnt(btf)) in check_btf_type_id() [all …]
|
D | btf_dump.c | 79 const struct btf *btf; member 132 return btf__name_by_offset(d->btf, name_off); in btf_name_of() 148 struct btf_dump *btf_dump__new_v0_6_0(const struct btf *btf, in btf_dump__new_v0_6_0() argument 163 d->btf = btf; in btf_dump__new_v0_6_0() 166 d->ptr_sz = btf__pointer_size(btf) ? : sizeof(void *); in btf_dump__new_v0_6_0() 192 struct btf_dump *btf_dump__new_deprecated(const struct btf *btf, in btf_dump__new_deprecated() argument 199 return btf_dump__new_v0_6_0(btf, printf_fn, opts ? opts->ctx : NULL, opts); in btf_dump__new_deprecated() 204 int err, last_id = btf__type_cnt(d->btf) - 1; in btf_dump_resize() 278 if (id >= btf__type_cnt(d->btf)) in btf_dump__dump_type() 310 int i, j, n = btf__type_cnt(d->btf); in btf_dump_mark_referenced() [all …]
|
D | libbpf_internal.h | 196 struct btf; 199 struct btf_type *btf_type_by_id(const struct btf *btf, __u32 type_id); 201 const struct btf_type *skip_mods_and_typedefs(const struct btf *btf, __u32 id, __u32 *res_id); 243 int parse_btf_map_def(const char *map_name, struct btf *btf, 343 int btf_load_into_kernel(struct btf *btf, char *log_buf, size_t log_sz, __u32 log_level); 345 struct btf *btf_get_from_fd(int btf_fd, struct btf *base_btf); 447 __s32 btf__find_by_name_kind_own(const struct btf *btf, const char *type_name,
|
D | libbpf.c | 450 struct btf *btf; member 522 struct btf *btf; member 528 struct btf *btf_vmlinux; 534 struct btf *btf_vmlinux_override; 845 find_member_by_name(const struct btf *btf, const struct btf_type *t, in find_member_by_name() argument 852 if (!strcmp(btf__name_by_offset(btf, m->name_off), name)) in find_member_by_name() 860 static int find_btf_by_prefix_kind(const struct btf *btf, const char *prefix, 864 find_struct_ops_kern_types(const struct btf *btf, const char *tname, in find_struct_ops_kern_types() argument 874 kern_type_id = btf__find_by_name_kind(btf, tname, BTF_KIND_STRUCT); in find_struct_ops_kern_types() 880 kern_type = btf__type_by_id(btf, kern_type_id); in find_struct_ops_kern_types() [all …]
|
D | libbpf_legacy.h | 97 struct btf; 103 LIBBPF_API const void *btf__get_raw_data(const struct btf *btf, __u32 *size);
|
/external/bpftool/src/ |
D | btf_dumper.c | 27 static int btf_dump_func(const struct btf *btf, char *func_sig, 40 struct btf *prog_btf = NULL; in dump_prog_id_as_func_ptr() 47 func_sig_len = btf_dump_func(d->btf, prog_str, func_proto, NULL, 0, in dump_prog_id_as_func_ptr() 118 ptr_type_id = btf__resolve_type(d->btf, t->type); in btf_dumper_ptr() 121 ptr_type = btf__type_by_id(d->btf, ptr_type_id); in btf_dumper_ptr() 140 actual_type_id = btf__resolve_type(d->btf, type_id); in btf_dumper_modifier() 175 btf__name_by_offset(d->btf, in btf_dumper_enum() 185 static bool is_str_array(const struct btf *btf, const struct btf_array *arr, in is_str_array() argument 194 elem_type = btf__type_by_id(btf, arr->type); in is_str_array() 199 elem_type = btf__type_by_id(btf, elem_type->type); in is_str_array() [all …]
|
D | btf.c | 94 static const char *btf_str(const struct btf *btf, __u32 off) in btf_str() argument 98 return btf__name_by_offset(btf, off) ? : "(invalid)"; in btf_str() 106 static int dump_btf_type(const struct btf *btf, __u32 id, in dump_btf_type() argument 116 jsonw_string_field(w, "name", btf_str(btf, t->name_off)); in dump_btf_type() 119 btf_str(btf, t->name_off)); in dump_btf_type() 180 const char *name = btf_str(btf, m->name_off); in dump_btf_type() 226 const char *name = btf_str(btf, v->name_off); in dump_btf_type() 276 const char *name = btf_str(btf, p->name_off); in dump_btf_type() 330 if (v->type < btf__type_cnt(btf)) { in dump_btf_type() 331 vt = btf__type_by_id(btf, v->type); in dump_btf_type() [all …]
|
D | main.h | 94 extern struct btf *base_btf; 119 struct btf; 184 const struct btf *btf, 193 const struct btf *btf, in disasm_print_insn() argument 215 const struct btf *btf; member 230 void btf_dumper_type_only(const struct btf *btf, __u32 func_type_id, 233 void btf_dump_linfo_plain(const struct btf *btf, 236 void btf_dump_linfo_json(const struct btf *btf,
|
D | map.c | 164 unsigned char *value, struct btf *btf) in print_entry_json() argument 173 if (btf) { in print_entry_json() 175 .btf = btf, in print_entry_json() 206 if (btf) { in print_entry_json() 208 .btf = btf, in print_entry_json() 761 struct bpf_map_info *map_info, struct btf *btf, in dump_map_elem() argument 770 print_entry_json(map_info, key, value, btf); in dump_map_elem() 771 } else if (btf) { in dump_map_elem() 773 .btf = btf, in dump_map_elem() 806 static struct btf *btf_vmlinux; [all …]
|
D | xlated_dumper.c | 223 struct btf *btf = dd->btf; in dump_xlated_json() local 240 if (btf && record) { in dump_xlated_json() 242 btf_dumper_type_only(btf, record->type_id, in dump_xlated_json() 258 btf_dump_linfo_json(btf, linfo, linum); in dump_xlated_json() 308 struct btf *btf = dd->btf; in dump_xlated_plain() local 321 if (btf && record) { in dump_xlated_plain() 323 btf_dumper_type_only(btf, record->type_id, in dump_xlated_plain() 337 btf_dump_linfo_plain(btf, linfo, "; ", in dump_xlated_plain()
|
D | gen.c | 124 struct btf *btf, in codegen_datasec_def() argument 129 const char *sec_name = btf__name_by_offset(btf, sec->name_off); in codegen_datasec_def() 143 const struct btf_type *var = btf__type_by_id(btf, sec_var->type); in codegen_datasec_def() 144 const char *var_name = btf__name_by_offset(btf, var->name_off); in codegen_datasec_def() 163 align = btf__align_of(btf, var->type); in codegen_datasec_def() 213 struct btf *btf = bpf_object__btf(obj); in codegen_datasecs() local 214 int n = btf__type_cnt(btf); in codegen_datasecs() 221 d = btf_dump__new(btf, codegen_btf_dump_printf, NULL, NULL); in codegen_datasecs() 238 const struct btf_type *t = btf__type_by_id(btf, i); in codegen_datasecs() 244 name = btf__str_by_offset(btf, t->name_off); in codegen_datasecs() [all …]
|
D | struct_ops.c | 21 static struct btf *btf_vmlinux; 29 static const struct btf *get_btf_vmlinux(void) in get_btf_vmlinux() 43 const struct btf *kern_btf; in get_kern_struct_ops_name() 60 const struct btf *kern_btf; in get_map_info_type_id() 357 const struct btf *kern_btf = d->btf; in __do_dump() 364 kern_btf = d->btf; in __do_dump() 405 const struct btf *kern_btf; in do_dump() 430 d.btf = kern_btf; in do_dump()
|
D | prog.c | 327 struct btf *btf; in show_prog_metadata() local 338 btf = btf__load_from_kernel_by_id(map_info.btf_id); in show_prog_metadata() 339 if (libbpf_get_error(btf)) in show_prog_metadata() 342 t_datasec = btf__type_by_id(btf, map_info.btf_value_type_id); in show_prog_metadata() 355 .btf = btf, in show_prog_metadata() 361 t_var = btf__type_by_id(btf, vsi->type); in show_prog_metadata() 362 name = btf__name_by_offset(btf, t_var->name_off); in show_prog_metadata() 385 .btf = btf, in show_prog_metadata() 390 t_var = btf__type_by_id(btf, vsi->type); in show_prog_metadata() 391 name = btf__name_by_offset(btf, t_var->name_off); in show_prog_metadata() [all …]
|
D | jit_disasm.c | 78 const struct btf *btf, in disasm_print_insn() argument 155 btf_dump_linfo_json(btf, linfo, linum); in disasm_print_insn() 160 btf_dump_linfo_plain(btf, linfo, "; ", in disasm_print_insn()
|
/external/linux-kselftest/tools/testing/selftests/bpf/prog_tests/ |
D | btf_dump.c | 26 static int btf_dump_all_types(const struct btf *btf, in btf_dump_all_types() argument 29 size_t type_cnt = btf__get_nr_types(btf); in btf_dump_all_types() 33 d = btf_dump__new(btf, NULL, opts, btf_dump_printf); in btf_dump_all_types() 51 struct btf *btf = NULL; in test_btf_dump_case() local 57 btf = btf__parse_elf(test_file, NULL); in test_btf_dump_case() 58 if (CHECK(IS_ERR(btf), "btf_parse_elf", in test_btf_dump_case() 59 "failed to load test BTF: %ld\n", PTR_ERR(btf))) { in test_btf_dump_case() 60 err = -PTR_ERR(btf); in test_btf_dump_case() 61 btf = NULL; in test_btf_dump_case() 79 err = btf_dump_all_types(btf, &t->opts); in test_btf_dump_case() [all …]
|
/external/bcc/libbpf-tools/ |
D | ksnoop.c | 25 static struct btf *vmlinux_btf; 97 static void type_to_value(struct btf *btf, char *name, __u32 type_id, in type_to_value() argument 111 type = btf__type_by_id(btf, id); in type_to_value() 132 val->size = btf__resolve_size(btf, val->type_id); in type_to_value() 135 static int member_to_value(struct btf *btf, const char *name, __u32 type_id, in member_to_value() argument 151 type = btf__type_by_id(btf, id); in member_to_value() 152 pname = btf__str_by_offset(btf, type->name_off); in member_to_value() 168 type = btf__type_by_id(btf, member->type); in member_to_value() 169 mname = btf__str_by_offset(btf, member->name_off); in member_to_value() 183 if (!member_to_value(btf, name, member->type, in member_to_value() [all …]
|
D | trace_helpers.c | 217 struct btf *btf; member 336 dso->btf = btf__new_empty(); in syms__add_dso() 406 off = btf__add_str(dso->btf, name); in dso__add_sym() 483 btf__free(dso->btf); in dso__free_fields() 514 btf__name_by_offset(dso->btf, in dso__load_sym_table_from_elf() 1018 struct btf *base, *btf = NULL; in fentry_can_attach() local 1031 btf = btf__parse_split(sysfs_mod, base); in fentry_can_attach() 1032 if (!btf) { in fentry_can_attach() 1036 btf = base; in fentry_can_attach() 1040 btf = base; in fentry_can_attach() [all …]
|
/external/libbpf/android/ |
D | btfloader.cpp | 58 struct btf *btf = bpf_object__btf(obj); in main() local 59 if (!btf) return kERROR_BTF_NOT_FOUND; in main() 61 ret = btf__load_into_kernel(btf); in main() 69 for (unsigned int i = 1; i < btf__type_cnt(btf); ++i) { in main() 70 struct btf_type *bt = (struct btf_type *)btf__type_by_id(btf, i); in main() 75 if (btf__load_into_kernel(btf)) return kERROR_LOAD_BTF; in main() 78 btfFd = btf__fd(btf); in main() 79 if (sendBtfFd(socketFd, btf__fd(btf))) return kERROR_SEND_BTF_FD; in main() 86 if (btf__get_map_kv_tids(btf, mapName, bpf_map__key_size(m), in main()
|
/external/bpftool/docs/ |
D | bpftool-btf.rst | 4 bpftool-btf 17 **bpftool** [*OPTIONS*] **btf** *COMMAND* 19 *OPTIONS* := { |COMMON_OPTIONS| | { **-B** | **--base-btf** } } 26 | **bpftool** **btf** { **show** | **list** } [**id** *BTF_ID*] 27 | **bpftool** **btf dump** *BTF_SRC* [**format** *FORMAT*] 28 | **bpftool** **btf help** 37 **bpftool btf { show | list }** [**id** *BTF_ID*] 48 **bpftool btf dump** *BTF_SRC* 73 **bpftool btf help** 80 -B, --base-btf *FILE* [all …]
|
/external/bcc/src/cc/ |
D | bcc_btf.cc | 282 static int btf_ext_reloc_info(const struct btf *btf, in btf_ext_reloc_info() argument 299 info_sec_name = btf__name_by_offset(btf, sinfo->sec_name_off); in btf_ext_reloc_info() 329 int btf_ext__reloc_func_info(const struct btf *btf, in btf_ext__reloc_func_info() argument 334 return btf_ext_vendored::btf_ext_reloc_info(btf, &btf_ext->func_info, sec_name, in btf_ext__reloc_func_info() 338 int btf_ext__reloc_line_info(const struct btf *btf, in btf_ext__reloc_line_info() argument 343 return btf_ext_vendored::btf_ext_reloc_info(btf, &btf_ext->line_info, sec_name, in btf_ext__reloc_line_info() 581 struct btf *btf; in load() local 590 btf = btf__new(new_btf_sec, new_btf_sec_size); in load() 593 btf = btf__new(btf_sec, btf_sec_size); in load() 595 if (BCC_IS_ERR(btf)) { in load() [all …]
|
D | bcc_btf.h | 28 struct btf; 101 int btf_ext__reloc_func_info(const struct btf *btf, 105 int btf_ext__reloc_line_info(const struct btf *btf, 155 struct btf *btf_;
|