| /linux/tools/bpf/bpftool/Documentation/ |
| H A D | bpftool-btf.rst | 104 [1] PTR '(anon)' type_id=2 106 'pad' type_id=3 bits_offset=0 107 'sock' type_id=4 bits_offset=64 109 [4] PTR '(anon)' type_id=5 159 [1] PTR '(anon)' type_id=2 161 'a' type_id=3 bits_offset=0 162 'b' type_id=4 bits_offset=0 165 'const_int_field' type_id=5 bits_offset=0 166 'bitfield_field' type_id=3 bits_offset=32 bitfield_size=4 167 'arr_field' type_id [all...] |
| /linux/tools/bpf/bpftool/ |
| H A D | btf_dumper.c | 24 static int btf_dumper_do_type(const struct btf_dumper *d, __u32 type_id, 80 func_type = btf__type_by_id(prog_btf, finfo.type_id); in dump_prog_id_as_func_ptr() 135 static int btf_dumper_modifier(const struct btf_dumper *d, __u32 type_id, in btf_dumper_modifier() argument 140 actual_type_id = btf__resolve_type(d->btf, type_id); in btf_dumper_modifier() 247 static int btf_dumper_array(const struct btf_dumper *d, __u32 type_id, in btf_dumper_array() argument 250 const struct btf_type *t = btf__type_by_id(d->btf, type_id); in btf_dumper_array() 465 static int btf_dumper_struct(const struct btf_dumper *d, __u32 type_id, in btf_dumper_struct() argument 475 t = btf__type_by_id(d->btf, type_id); in btf_dumper_struct() 513 static int btf_dumper_var(const struct btf_dumper *d, __u32 type_id, in btf_dumper_var() argument 516 const struct btf_type *t = btf__type_by_id(d->btf, type_id); in btf_dumper_var() [all …]
|
| H A D | gen.c | 2113 static void btfgen_mark_member(struct btfgen_info *info, int type_id, int idx) in btfgen_mark_member() argument 2115 const struct btf_type *t = btf__type_by_id(info->marked_btf, type_id); in btfgen_mark_member() 2122 btfgen_mark_type(struct btfgen_info *info, unsigned int type_id, bool follow_pointers) in btfgen_mark_type() argument 2124 const struct btf_type *btf_type = btf__type_by_id(info->src_btf, type_id); in btfgen_mark_type() 2131 if (type_id == 0) in btfgen_mark_type() 2135 cloned_type = (struct btf_type *) btf__type_by_id(info->marked_btf, type_id); in btfgen_mark_type() 2190 p_err("unsupported kind: %s (%u)", btf_kind_str(btf_type), type_id); in btfgen_mark_type() 2203 unsigned int type_id = targ_spec->root_type_id; in btfgen_record_field_relo() local 2207 btf_type = btf__type_by_id(btf, type_id); in btfgen_record_field_relo() 2208 err = btfgen_mark_type(info, type_id, false); in btfgen_record_field_relo() [all …]
|
| /linux/net/ipv4/ |
| H A D | bpf_tcp_ca.c | 23 s32 type_id; in bpf_tcp_ca_init() local 25 type_id = btf_find_by_name_kind(btf, "sock", BTF_KIND_STRUCT); in bpf_tcp_ca_init() 26 if (type_id < 0) in bpf_tcp_ca_init() 28 sock_id = type_id; in bpf_tcp_ca_init() 30 type_id = btf_find_by_name_kind(btf, "tcp_sock", BTF_KIND_STRUCT); in bpf_tcp_ca_init() 31 if (type_id < 0) in bpf_tcp_ca_init() 33 tcp_sock_id = type_id; in bpf_tcp_ca_init() 36 type_id = btf_find_by_name_kind(btf, "tcp_congestion_ops", BTF_KIND_STRUCT); in bpf_tcp_ca_init() 37 if (type_id < 0) in bpf_tcp_ca_init() 39 tcp_congestion_ops_type = btf_type_by_id(btf, type_id); in bpf_tcp_ca_init()
|
| /linux/tools/lib/bpf/ |
| H A D | btf.c | 615 static int btf_validate_str(const struct btf *btf, __u32 str_off, const char *what, __u32 type_id) in btf_validate_str() argument 621 pr_warn("btf: type [%u]: invalid %s (string offset %u)\n", type_id, what, str_off); in btf_validate_str() 789 struct btf_type *btf_type_by_id(const struct btf *btf, __u32 type_id) in btf_type_by_id() argument 791 if (type_id == 0) in btf_type_by_id() 793 if (type_id < btf->start_id) in btf_type_by_id() 794 return btf_type_by_id(btf->base_btf, type_id); in btf_type_by_id() 795 return btf->types_data + btf->type_offs[type_id - btf->start_id]; in btf_type_by_id() 798 const struct btf_type *btf__type_by_id(const struct btf *btf, __u32 type_id) in btf__type_by_id() argument 800 if (type_id >= btf->start_id + btf->nr_types) in btf__type_by_id() 802 return btf_type_by_id((struct btf *)btf, type_id); in btf__type_by_id() [all …]
|
| H A D | relo_core.c | 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() 81 t = btf_type_by_id(btf, acc->type_id); in is_flex_arr() 279 spec->root_type_id = relo->type_id; in bpf_core_parse_spec() 306 t = skip_mods_and_typedefs(btf, relo->type_id, &id); in bpf_core_parse_spec() 312 acc->type_id = id; in bpf_core_parse_spec() 359 acc->type_id = id; in bpf_core_parse_spec() 378 spec->spec[spec->len].type_id = id; in bpf_core_parse_spec() 388 prog_name, relo->type_id, spec_str, i, id, btf_kind_str(t)); in bpf_core_parse_spec() 501 local_id = local_acc->type_id; in bpf_core_match_member() [all …]
|
| H A D | libbpf_internal.h | 247 struct btf_type *btf_type_by_id(const struct btf *btf, __u32 type_id); 535 __u32 type_id; member 553 i->type_id = bswap_32(i->type_id); in bpf_func_info_bswap() 567 i->type_id = bswap_32(i->type_id); in bpf_core_relo_bswap() 597 typedef int (*type_id_visit_fn)(__u32 *type_id, void *ctx);
|
| /linux/tools/testing/selftests/bpf/prog_tests/ |
| H A D | btf_dump.c | 345 __s32 type_id; in btf_dump_data() local 359 type_id = btf__find_by_name(btf, name); in btf_dump_data() 360 if (!ASSERT_GE(type_id, 0, "find type id")) in btf_dump_data() 362 type_sz = btf__resolve_size(btf, type_id); in btf_dump_data() 364 ret = btf_dump__dump_type_data(d, type_id, ptr, ptr_sz, &opts); in btf_dump_data() 645 __s32 type_id; in test_btf_dump_struct_data() local 715 type_id = btf__find_by_name(btf, "file_operations"); in test_btf_dump_struct_data() 716 if (ASSERT_GT(type_id, 0, "find type id")) { in test_btf_dump_struct_data() 717 type_sz = btf__resolve_size(btf, type_id); in test_btf_dump_struct_data() 720 ret = btf_dump__dump_type_data(d, type_id, fop in test_btf_dump_struct_data() 1005 __s32 type_id; test_btf_datasec() local [all...] |
| H A D | resolve_btfids.c | 147 __resolve_symbol(struct btf *btf, int type_id) in BTF_ID() 153 type = btf__type_by_id(btf, type_id); in BTF_ID() 167 test_symbols[i].id = type_id; in BTF_ID() 177 kfunc_symbols[i].id = type_id; in BTF_ID() 186 int type_id; in resolve_symbols() local 188 for (type_id = 1; type_id < nr; type_id++) { in resolve_symbols() 189 if (__resolve_symbol(btf, type_id)) in resolve_symbols()
|
| H A D | btf_module.c | 13 __s32 type_id; in test_btf_module() local 28 type_id = btf__find_by_name(module_btf, symbol_name); in test_btf_module() 29 ASSERT_GT(type_id, 0, "func not found"); in test_btf_module()
|
| H A D | btf_tag.c | 58 __s32 type_id; in load_btfs() local 73 type_id = btf__find_by_name_kind(*vmlinux_btf, "user", BTF_KIND_TYPE_TAG); in load_btfs() 74 if (type_id <= 0) { in load_btfs() 90 type_id = btf__find_by_name_kind(*module_btf, "user", BTF_KIND_TYPE_TAG); in load_btfs() 91 if (type_id <= 0) { in load_btfs()
|
| H A D | snprintf_btf.c | 71 static long run(struct snprintf_btf_void *skel, __u32 type_id) in run() argument 76 skel->bss->type_id = type_id; in run()
|
| H A D | core_reloc_raw.c | 24 .type_id = enum_id, in load_core_relo_insns() 101 { .insn_off = 0, .type_id = 3 }, in test_early_core_relo() 102 { .insn_off = 3, .type_id = 4 }, in test_early_core_relo() 250 .type_id = 4, in test_bad_local_id() 256 .type_id = 100500, /* !!! this type id does not exist */ in test_bad_local_id()
|
| H A D | tracing_multi.c | 82 __u32 nr, type_id, cnt = 0; in get_ids() local 117 for (type_id = 1; type_id < nr && cnt < funcs_cnt; type_id++) { in get_ids() 122 type = btf__type_by_id(btf, type_id); in get_ids() 150 ids[idx] = type_id; in get_ids() 678 __u32 nr, type_id; in serial_test_tracing_multi_bench_attach() local 726 for (type_id = 1; type_id < nr; type_id++) { in serial_test_tracing_multi_bench_attach() 730 type = btf__type_by_id(btf, type_id); in serial_test_tracing_multi_bench_attach() 755 ids[cnt++] = type_id; in serial_test_tracing_multi_bench_attach()
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | snprintf_btf_void.c | 5 __u32 type_id; variable 16 .type_id = type_id, in dump_type()
|
| /linux/kernel/bpf/ |
| H A D | btf.c | 187 #define BTF_TYPE_ID_VALID(type_id) ((type_id) <= BTF_MAX_TYPE) argument 291 u32 type_id; member 432 u32 type_id; member 463 u32 type_id, void *data, u8 bits_offsets, 471 const struct btf_type *t, u32 type_id); 960 const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id) in btf_type_by_id() argument 962 while (type_id < btf->start_id) in btf_type_by_id() 965 type_id -= btf->start_id; in btf_type_by_id() 966 if (type_id >= btf->nr_types) in btf_type_by_id() 968 return btf->types[type_id]; in btf_type_by_id() [all …]
|
| /linux/drivers/net/ethernet/microchip/lan966x/ |
| H A D | lan966x_vcap_ag_api.c | 2190 .type_id = 0, 2195 .type_id = 1, 2200 .type_id = 0, 2205 .type_id = 1, 2210 .type_id = 2, 2215 .type_id = 0, 2220 .type_id = 1, 2225 .type_id = 2, 2233 .type_id = 0, 2238 .type_id = 1, [all …]
|
| /linux/include/linux/ |
| H A D | btf.h | 178 u32 *type_id, 198 void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj, 200 int btf_type_seq_show_flags(const struct btf *btf, u32 type_id, void *obj, 216 int btf_type_snprintf_show(const struct btf *btf, u32 type_id, void *obj, 218 int btf_type_name_to_buf(const struct btf *btf, u32 type_id, char *buf, int len); 543 const struct bpf_struct_ops_desc *bpf_struct_ops_find(struct btf *btf, u32 type_id); 545 static inline const struct bpf_struct_ops_desc *bpf_struct_ops_find(struct btf *btf, u32 type_id) in bpf_struct_ops_find() argument 574 const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id); 617 u32 type_id) in btf_type_by_id() argument
|
| /linux/io_uring/ |
| H A D | bpf-ops.c | 112 s32 type_id; in io_lookup_struct_type() local 114 type_id = btf_find_by_name_kind(btf, name, BTF_KIND_STRUCT); in io_lookup_struct_type() 115 if (type_id < 0) in io_lookup_struct_type() 117 return btf_type_by_id(btf, type_id); in io_lookup_struct_type()
|
| /linux/drivers/net/ethernet/microchip/vcap/ |
| H A D | vcap_model_kunit.c | 2692 .type_id = 0, 2697 .type_id = 0, 2702 .type_id = 2, 2707 .type_id = 2, 2712 .type_id = 3, 2720 .type_id = 0, 2725 .type_id = 3, 2730 .type_id = 4, 2735 .type_id = 5, 2740 .type_id = 6, [all …]
|
| /linux/drivers/hid/bpf/ |
| H A D | hid_bpf_struct_ops.c | 99 s32 type_id; in hid_bpf_ops_btf_struct_access() local 109 type_id = btf_find_by_name_kind(reg->btf, write_range->struct_name, in hid_bpf_ops_btf_struct_access() 111 if (type_id < 0) in hid_bpf_ops_btf_struct_access() 114 state = btf_type_by_id(reg->btf, type_id); in hid_bpf_ops_btf_struct_access()
|
| /linux/drivers/net/ethernet/microchip/sparx5/ |
| H A D | sparx5_vcap_ag_api.c | 2290 .type_id = 0, 2295 .type_id = 2, 2303 .type_id = 0, 2308 .type_id = 3, 2313 .type_id = 4, 2318 .type_id = 5, 2323 .type_id = 6, 2328 .type_id = 1, 2336 .type_id = 0, 2344 .type_id = 0, [all …]
|
| /linux/drivers/net/ethernet/microchip/sparx5/lan969x/ |
| H A D | lan969x_vcap_ag_api.c | 2289 .type_id = 0, 2294 .type_id = 2, 2302 .type_id = 0, 2307 .type_id = 3, 2312 .type_id = 4, 2317 .type_id = 5, 2322 .type_id = 6, 2327 .type_id = 1, 2335 .type_id = 0, 2343 .type_id = 0, [all …]
|
| /linux/net/netfilter/ |
| H A D | nf_bpf_link.c | 276 s32 type_id; in nf_ptr_to_btf_id() local 282 type_id = btf_find_by_name_kind(btf, name, BTF_KIND_STRUCT); in nf_ptr_to_btf_id() 283 if (WARN_ON_ONCE(type_id < 0)) in nf_ptr_to_btf_id() 287 info->btf_id = type_id; in nf_ptr_to_btf_id()
|
| /linux/drivers/net/ethernet/hisilicon/hns3/hns3pf/ |
| H A D | hclge_err.c | 1707 .type_id = NONE_ERROR, 1710 .type_id = FIFO_ERROR, 1713 .type_id = MEMORY_ERROR, 1716 .type_id = POISON_ERROR, 1719 .type_id = MSIX_ECC_ERROR, 1722 .type_id = TQP_INT_ECC_ERROR, 1725 .type_id = PF_ABNORMAL_INT_ERROR, 1729 .type_id = MPF_ABNORMAL_INT_ERROR, 1733 .type_id = COMMON_ERROR, 1736 .type_id = PORT_ERROR, [all …]
|