/Linux-v4.19/tools/lib/bpf/ |
D | btf.c | 26 struct btf { struct 40 static int btf_add_type(struct btf *btf, struct btf_type *t) in btf_add_type() argument 42 if (btf->types_size - btf->nr_types < 2) { in btf_add_type() 46 if (btf->types_size == BTF_MAX_NR_TYPES) in btf_add_type() 49 expand_by = max(btf->types_size >> 2, 16); in btf_add_type() 50 new_size = min(BTF_MAX_NR_TYPES, btf->types_size + expand_by); in btf_add_type() 52 new_types = realloc(btf->types, sizeof(*new_types) * new_size); in btf_add_type() 56 if (btf->nr_types == 0) in btf_add_type() 59 btf->types = new_types; in btf_add_type() 60 btf->types_size = new_size; in btf_add_type() [all …]
|
D | btf.h | 11 struct btf; 17 void btf__free(struct btf *btf); 18 struct btf *btf__new(__u8 *data, __u32 size, btf_print_fn_t err_log); 19 __s32 btf__find_by_name(const struct btf *btf, const char *type_name); 20 const struct btf_type *btf__type_by_id(const struct btf *btf, __u32 id); 21 __s64 btf__resolve_size(const struct btf *btf, __u32 type_id); 22 int btf__resolve_type(const struct btf *btf, __u32 type_id); 23 int btf__fd(const struct btf *btf); 24 const char *btf__name_by_offset(const struct btf *btf, __u32 offset);
|
D | libbpf.c | 222 struct btf *btf; member 789 obj->btf = btf__new(data->d_buf, data->d_size, in bpf_object__elf_collect() 791 if (IS_ERR(obj->btf)) { in bpf_object__elf_collect() 793 BTF_ELF_SEC, PTR_ERR(obj->btf)); in bpf_object__elf_collect() 794 obj->btf = NULL; in bpf_object__elf_collect() 986 static int bpf_map_find_btf_info(struct bpf_map *map, const struct btf *btf) in bpf_map_find_btf_info() argument 1003 container_id = btf__find_by_name(btf, container_name); in bpf_map_find_btf_info() 1010 container_type = btf__type_by_id(btf, container_id); in bpf_map_find_btf_info() 1027 key_size = btf__resolve_size(btf, key->type); in bpf_map_find_btf_info() 1040 value_size = btf__resolve_size(btf, value->type); in bpf_map_find_btf_info() [all …]
|
D | Build | 1 libbpf-y := libbpf.o bpf.o nlattr.o btf.o libbpf_errno.o str_error.o
|
D | bpf.h | 109 int bpf_load_btf(void *btf, __u32 btf_size, char *log_buf, __u32 log_buf_size,
|
D | bpf.c | 623 int bpf_load_btf(void *btf, __u32 btf_size, char *log_buf, __u32 log_buf_size, in bpf_load_btf() argument 629 attr.btf = ptr_to_u64(btf); in bpf_load_btf()
|
D | Makefile | 192 $(call do_install,btf.h,$(prefix)/include/bpf,644);
|
/Linux-v4.19/kernel/bpf/ |
D | btf.c | 190 struct btf { struct 239 struct btf *btf; member 276 void (*seq_show)(const struct btf *btf, const struct btf_type *t, 423 static bool btf_name_offset_valid(const struct btf *btf, u32 offset) in btf_name_offset_valid() argument 426 offset < btf->hdr.str_len; in btf_name_offset_valid() 429 static const char *btf_name_by_offset(const struct btf *btf, u32 offset) in btf_name_by_offset() argument 433 else if (offset < btf->hdr.str_len) in btf_name_by_offset() 434 return &btf->strings[offset]; in btf_name_by_offset() 439 static const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id) in btf_type_by_id() argument 441 if (type_id > btf->nr_types) in btf_type_by_id() [all …]
|
D | syscall.c | 310 btf_put(map->btf); in __bpf_map_put() 466 static int map_check_btf(const struct bpf_map *map, const struct btf *btf, in map_check_btf() argument 473 key_type = btf_type_id_size(btf, &btf_key_id, &key_size); in map_check_btf() 477 value_type = btf_type_id_size(btf, &btf_value_id, &value_size); in map_check_btf() 522 struct btf *btf; in map_create() local 529 btf = btf_get_by_fd(attr->btf_fd); in map_create() 530 if (IS_ERR(btf)) { in map_create() 531 err = PTR_ERR(btf); in map_create() 535 err = map_check_btf(map, btf, attr->btf_key_type_id, in map_create() 538 btf_put(btf); in map_create() [all …]
|
D | Makefile | 8 obj-$(CONFIG_BPF_SYSCALL) += btf.o
|
D | hashtab.c | 1183 btf_type_seq_show(map->btf, map->btf_key_type_id, key, m); in htab_map_seq_show_elem() 1185 btf_type_seq_show(map->btf, map->btf_value_type_id, value, m); in htab_map_seq_show_elem()
|
D | arraymap.c | 355 btf_type_seq_show(map->btf, map->btf_value_type_id, value, m); in array_map_seq_show_elem()
|
/Linux-v4.19/include/linux/ |
D | btf.h | 9 struct btf; 15 void btf_put(struct btf *btf); 17 struct btf *btf_get_by_fd(int fd); 18 int btf_get_info_by_fd(const struct btf *btf, 42 const struct btf_type *btf_type_id_size(const struct btf *btf, 45 void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj, 48 u32 btf_id(const struct btf *btf);
|
D | bpf.h | 75 struct btf *btf; member 122 return map->btf && map->ops->map_seq_show_elem; in bpf_map_support_seq_show()
|
/Linux-v4.19/tools/bpf/bpftool/ |
D | map.c | 184 static int get_btf(struct bpf_map_info *map_info, struct btf **btf) in get_btf() argument 194 *btf = NULL; in get_btf() 212 btf_info.btf = ptr_to_u64(ptr); in get_btf() 226 btf_info.btf = ptr_to_u64(ptr); in get_btf() 235 *btf = btf__new((__u8 *)btf_info.btf, btf_info.btf_size, NULL); in get_btf() 236 if (IS_ERR(*btf)) { in get_btf() 237 err = PTR_ERR(*btf); in get_btf() 238 *btf = NULL; in get_btf() 260 unsigned char *value, struct btf *btf) in print_entry_json() argument 269 if (btf) { in print_entry_json() [all …]
|
D | btf_dumper.c | 39 actual_type_id = btf__resolve_type(d->btf, type_id); in btf_dumper_modifier() 54 const struct btf_type *t = btf__type_by_id(d->btf, type_id); in btf_dumper_array() 60 elem_size = btf__resolve_size(d->btf, arr->type); in btf_dumper_array() 186 t = btf__type_by_id(d->btf, type_id); in btf_dumper_struct() 196 jsonw_name(d->jw, btf__name_by_offset(d->btf, m[i].name_off)); in btf_dumper_struct() 212 const struct btf_type *t = btf__type_by_id(d->btf, type_id); in btf_dumper_do_type()
|
D | main.h | 154 const struct btf *btf; member
|
/Linux-v4.19/tools/include/uapi/linux/ |
D | bpf.h | 390 __aligned_u64 btf; member 2513 __aligned_u64 btf; member
|
/Linux-v4.19/include/uapi/linux/ |
D | bpf.h | 390 __aligned_u64 btf; member 2513 __aligned_u64 btf; member
|
/Linux-v4.19/drivers/media/i2c/ |
D | Makefile | 64 obj-$(CONFIG_VIDEO_SONY_BTF_MPX) += sony-btf-mpx.o
|
D | Kconfig | 181 module will be called sony-btf-mpx.
|
/Linux-v4.19/tools/testing/selftests/bpf/ |
D | test_btf.c | 1652 info->btf = ptr_to_u64(user_btf); in test_big_btf_info() 1720 info[i].btf = ptr_to_u64(user_btf[i]); in test_btf_id() 1873 info.btf = ptr_to_u64(user_btf); in do_test_get_info()
|