| /linux/tools/testing/selftests/bpf/prog_tests/ |
| H A D | linked_list.c | 252 static struct btf *init_btf(void) in init_btf() 255 struct btf *btf; in init_btf() local 257 btf = btf__new_empty(); in init_btf() 258 if (!ASSERT_OK_PTR(btf, "btf__new_empty")) in init_btf() 260 id = btf__add_int(btf, "int", 4, BTF_INT_SIGNED); in init_btf() 263 lid = btf__add_struct(btf, "bpf_spin_lock", 4); in init_btf() 266 hid = btf__add_struct(btf, "bpf_list_head", 16); in init_btf() 269 nid = btf__add_struct(btf, "bpf_list_node", 24); in init_btf() 272 return btf; in init_btf() 274 btf__free(btf); in init_btf() [all …]
|
| H A D | btf_write.c | 4 #include <bpf/btf.h> 7 static void gen_btf(struct btf *btf) in gen_btf() argument 17 str_off = btf__find_str(btf, "int"); in gen_btf() 20 str_off = btf__add_str(btf, "int"); in gen_btf() 23 str_off = btf__find_str(btf, "int"); in gen_btf() 27 id = btf__add_int(btf, "int", 4, BTF_INT_SIGNED); in gen_btf() 30 t = btf__type_by_id(btf, 1); in gen_btf() 33 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "int", "int_name"); in gen_btf() 38 ASSERT_STREQ(btf_type_raw_dump(btf, in gen_btf() 357 struct btf *btf; test_btf_add() local [all...] |
| H A D | btf_dump.c | 3 #include <bpf/btf.h> 25 static int btf_dump_all_types(const struct btf *btf, void *ctx) 27 size_t type_cnt = btf__type_cnt(btf); in btf_dump_all_types() 31 d = btf_dump__new(btf, btf_dump_printf, ctx, NULL); in btf_dump_all_types() 111 struct btf *btf = NULL; in test_btf_dump_case() 119 btf = btf__parse_elf(test_file, NULL); in test_btf_dump_case() 120 if (!ASSERT_OK_PTR(btf, "btf_parse_elf")) { in test_btf_dump_case() 121 err = -PTR_ERR(btf); in test_btf_dump_case() 26 btf_dump_all_types(const struct btf * btf,void * ctx) btf_dump_all_types() argument 51 struct btf *btf = NULL; test_btf_dump_case() local 130 struct btf *btf; global() member 184 struct btf *btf; test_btf_dump_incremental() local 285 struct btf *btf; test_btf_dump_type_tags() local 339 btf_dump_data(struct btf * btf,struct btf_dump * d,char * name,char * prefix,__u64 flags,void * ptr,size_t ptr_sz,char * str,const char * expected_val) btf_dump_data() argument 420 test_btf_dump_int_data(struct btf * btf,struct btf_dump * d,char * str) test_btf_dump_int_data() argument 478 test_btf_dump_float_data(struct btf * btf,struct btf_dump * d,char * str) test_btf_dump_float_data() argument 523 test_btf_dump_char_data(struct btf * btf,struct btf_dump * d,char * str) test_btf_dump_char_data() argument 545 test_btf_dump_typedef_data(struct btf * btf,struct btf_dump * d,char * str) test_btf_dump_typedef_data() argument 600 test_btf_dump_enum_data(struct btf * btf,struct btf_dump * d,char * str) test_btf_dump_enum_data() argument 636 test_btf_dump_struct_data(struct btf * btf,struct btf_dump * d,char * str) test_btf_dump_struct_data() argument 871 test_btf_dump_var_data(struct btf * btf,struct btf_dump * d,char * str) test_btf_dump_var_data() argument 883 struct btf *btf; global() member 998 test_btf_datasec(struct btf * btf,struct btf_dump * d,char * str,const char * name,const char * expected_val,void * data,size_t data_sz) test_btf_datasec() argument 1026 struct btf *btf; test_btf_dump_datasec_data() local 1049 struct btf *btf; test_btf_dump() local [all...] |
| H A D | local_kptr_ownership.c | 14 static struct btf *init_btf(void) in init_btf() 16 struct btf *btf; in init_btf() local 19 btf = btf__new_empty(); in init_btf() 20 if (!ASSERT_OK_PTR(btf, "btf__new_empty")) in init_btf() 22 id = btf__add_int(btf, "int", 4, BTF_INT_SIGNED); in init_btf() 25 id = btf__add_struct(btf, "bpf_spin_lock", 4); in init_btf() 28 id = btf__add_struct(btf, "bpf_list_head", 16); in init_btf() 31 id = btf__add_struct(btf, "bpf_list_node", 24); in init_btf() 34 return btf; in init_btf() 37 btf__free(btf); in init_btf() [all …]
|
| H A D | btf_field_iter.c | 5 #include <bpf/btf.h> 46 struct btf *btf = NULL; in test_btf_field_iter() 49 btf = btf__new_empty(); in test_btf_field_iter() 50 if (!ASSERT_OK_PTR(btf, "empty_btf")) in test_btf_field_iter() 53 btf__add_int(btf, "int", 4, BTF_INT_SIGNED); /* [1] int */ in test_btf_field_iter() 54 btf__add_int(btf, "int64", 8, BTF_INT_SIGNED); /* [2] int64 */ in test_btf_field_iter() 55 btf__add_ptr(btf, 1); /* [3] int * */ in test_btf_field_iter() 56 btf__add_array(btf, 1, 2, 3); /* [4] int64[3] */ in test_btf_field_iter() 57 btf__add_struct(btf, "s in test_btf_field_iter() 43 struct btf *btf = NULL; test_btf_field_iter() local [all...] |
| H A D | libbpf_str.c | 23 struct btf *btf; in test_libbpf_bpf_attach_type_str() local 28 btf = btf__parse("/sys/kernel/btf/vmlinux", NULL); in test_libbpf_bpf_attach_type_str() 29 if (!ASSERT_OK_PTR(btf, "btf_parse")) in test_libbpf_bpf_attach_type_str() 33 id = btf__find_by_name_kind(btf, "bpf_attach_type", BTF_KIND_ENUM); in test_libbpf_bpf_attach_type_str() 36 t = btf__type_by_id(btf, id); in test_libbpf_bpf_attach_type_str() 48 attach_type_name = btf__str_by_offset(btf, e->name_off); in test_libbpf_bpf_attach_type_str() 59 btf__free(btf); in test_libbpf_bpf_attach_type_str() 68 struct btf *btf; in test_libbpf_bpf_link_type_str() local 73 btf = btf__parse("/sys/kernel/btf/vmlinux", NULL); in test_libbpf_bpf_link_type_str() 74 if (!ASSERT_OK_PTR(btf, "btf_parse")) in test_libbpf_bpf_link_type_str() [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() 157 str = btf__name_by_offset(btf, type->name_off); in BTF_ID() 183 static int resolve_symbols(struct btf *btf) in resolve_symbols() argument 185 __u32 nr = btf__type_cnt(btf); in resolve_symbols() 189 if (__resolve_symbol(btf, type_id)) in resolve_symbols() 195 static bool btf_has_decl_tag(struct btf *btf, const char *tag_name, s32 target_id) in btf_has_decl_tag() argument 201 nr = btf__type_cnt(btf); in btf_has_decl_tag() 203 t = btf__type_by_id(btf, id); in btf_has_decl_tag() 210 name = btf__name_by_offset(btf, t->name_off); in btf_has_decl_tag() [all …]
|
| H A D | libbpf_probes.c | 9 struct btf *btf; in test_libbpf_probe_prog_types() local 14 btf = btf__parse("/sys/kernel/btf/vmlinux", NULL); in test_libbpf_probe_prog_types() 15 if (!ASSERT_OK_PTR(btf, "btf_parse")) in test_libbpf_probe_prog_types() 19 id = btf__find_by_name_kind(btf, "bpf_prog_type", BTF_KIND_ENUM); in test_libbpf_probe_prog_types() 22 t = btf__type_by_id(btf, id); in test_libbpf_probe_prog_types() 27 const char *prog_type_name = btf__str_by_offset(btf, e->name_off); in test_libbpf_probe_prog_types() 44 btf__free(btf); in test_libbpf_probe_prog_types() 49 struct btf *btf; in test_libbpf_probe_map_types() local 54 btf = btf__parse("/sys/kernel/btf/vmlinux", NULL); in test_libbpf_probe_map_types() 55 if (!ASSERT_OK_PTR(btf, "btf_parse")) in test_libbpf_probe_map_types() [all …]
|
| H A D | test_global_funcs.c | 27 static void check_ctx_arg_type(const struct btf *btf, const struct btf_param *p) in check_ctx_arg_type() 32 t = btf__type_by_id(btf, p->type); in check_ctx_arg_type() 36 s = btf_type_raw_dump(btf, t->type); in check_ctx_arg_type() 48 struct btf *btf = NULL; in subtest_ctx_arg_rewrite() 51 struct btf *kern_btf = NULL; in subtest_ctx_arg_rewrite() 88 btf = btf__load_from_kernel_by_id(info.btf_id); in subtest_ctx_arg_rewrite() 89 if (!ASSERT_OK_PTR(btf, "obj_kern_btf")) in subtest_ctx_arg_rewrite() 100 fn_t = btf__type_by_id(btf, re in subtest_ctx_arg_rewrite() 26 check_ctx_arg_type(const struct btf * btf,const struct btf_param * p) check_ctx_arg_type() argument 47 struct btf *btf = NULL; subtest_ctx_arg_rewrite() local [all...] |
| H A D | btf_endian.c | 18 struct btf *btf = NULL, *swap_btf = NULL; in test_btf_endian() local 26 btf = btf__parse_elf("btf_dump_test_case_syntax.bpf.o", NULL); in test_btf_endian() 27 if (!ASSERT_OK_PTR(btf, "parse_native_btf")) in test_btf_endian() 30 ASSERT_EQ(btf__endianness(btf), endian, "endian"); in test_btf_endian() 31 btf__set_endianness(btf, swap_endian); in test_btf_endian() 32 ASSERT_EQ(btf__endianness(btf), swap_endian, "endian"); in test_btf_endian() 35 raw_data = btf__raw_data(btf, &raw_sz); in test_btf_endian() 45 ASSERT_EQ(btf__type_cnt(swap_btf), btf__type_cnt(btf), "nr_types"); in test_btf_endian() 71 var_id = btf__add_var(btf, "some_var", BTF_VAR_GLOBAL_ALLOCATED, 1); in test_btf_endian() 77 btf__set_endianness(btf, swap_endian); in test_btf_endian() [all …]
|
| H A D | core_autosize.c | 60 struct btf *btf = NULL; in test_core_autosize() local 66 btf = btf__new_empty(); in test_core_autosize() 67 if (!ASSERT_OK_PTR(btf, "empty_btf")) in test_core_autosize() 85 btf__set_pointer_size(btf, 4); in test_core_autosize() 87 char_id = btf__add_int(btf, "unsigned char", 1, 0); in test_core_autosize() 89 short_id = btf__add_int(btf, "unsigned short", 2, 0); in test_core_autosize() 92 int_id = btf__add_int(btf, "long unsigned int", 4, 0); in test_core_autosize() 94 long_long_id = btf__add_int(btf, "unsigned long long", 8, 0); in test_core_autosize() 96 void_ptr_id = btf__add_ptr(btf, 0); in test_core_autosize() 99 id = btf__add_struct(btf, "test_struct", 20 /* bytes */); in test_core_autosize() [all …]
|
| H A D | btf_dedup_split.c | 4 #include <bpf/btf.h> 9 struct btf *btf1, *btf2; in test_split_simple() 143 struct btf *btf1, *btf2; in test_split_fwd_resolve() 241 struct btf *btf1, *btf2; in test_split_struct_duped() 348 static void btf_add_dup_struct_in_cu(struct btf *btf, int start_id) in btf_add_dup_struct_in_cu() 351 btf__set_pointer_size(btf, 8); /* enforce 64-bit arch */ in btf_add_dup_struct_in_cu() 353 btf__add_int(btf, "int", 4, BTF_INT_SIGNED); /* [1] int */ in btf_add_dup_struct_in_cu() 355 btf__add_struct(btf, "s", 8); /* [2] struct s { */ 356 btf__add_field(btf, " 332 btf_add_dup_struct_in_cu(struct btf * btf,int start_id) btf_add_dup_struct_in_cu() argument [all...] |
| /linux/tools/lib/bpf/ |
| H A D | btf.h | 10 #include <linux/btf.h> 24 struct btf; 37 * @param btf BTF object to free 39 LIBBPF_API void btf__free(struct btf *btf); 55 LIBBPF_API struct btf *btf__new(const void *data, __u32 size); 77 LIBBPF_API struct btf *btf__new_split(const void *data, __u32 size, struct btf *base_btf); 91 LIBBPF_API struct btf *btf__new_empty(void); 110 LIBBPF_API struct btf *btf__new_empty_spli [all...] |
| H A D | btf.c | 18 #include <linux/btf.h> 20 #include "btf.h" 65 struct btf { 90 * A separate struct btf_header is embedded as btf->hdr, 144 struct btf *base_btf; 256 static void *btf_add_type_offs_mem(struct btf *btf, size_t add_cnt) in btf_add_type_offs_mem() 258 return libbpf_add_mem((void **)&btf->type_offs, &btf->type_offs_cap, sizeof(__u32), 259 btf argument 62 struct btf { global() struct 87 swapped_endianbtf global() argument 119 hdrbtf global() argument 141 base_btfbtf global() argument 163 strs_dedupedbtf global() argument 164 owns_basebtf global() argument 167 raw_data_is_mmapbtf global() argument 170 modifiablebtf global() argument 174 has_hdr_extrabtf global() argument 178 layoutbtf global() argument 181 fdbtf global() argument 184 ptr_szbtf global() argument 253 btf_add_type_offs_mem(struct btf * btf,size_t add_cnt) btf_add_type_offs_mem() argument 286 btf_parse_hdr(struct btf * btf) btf_parse_hdr() argument 380 btf_parse_str_sec(struct btf * btf) btf_parse_str_sec() argument 398 btf_parse_layout_sec(struct btf * btf) btf_parse_layout_sec() argument 420 btf_type_size_unknown(const struct btf * btf,const struct btf_type * t) btf_type_size_unknown() argument 454 btf_type_size(const struct btf * btf,const struct btf_type * t) btf_type_size() argument 578 btf_parse_type_sec(struct btf * btf) btf_parse_type_sec() argument 615 btf_validate_str(const struct btf * btf,__u32 str_off,const char * what,__u32 type_id) btf_validate_str() argument 628 btf_validate_id(const struct btf * btf,__u32 id,__u32 ctx_id) btf_validate_id() argument 641 btf_validate_type(const struct btf * btf,const struct btf_type * t,__u32 id) btf_validate_type() argument 763 btf_sanity_check(const struct btf * btf) btf_sanity_check() argument 778 btf__type_cnt(const struct btf * btf) btf__type_cnt() argument 783 btf__base_btf(const struct btf * btf) btf__base_btf() argument 789 btf_type_by_id(const struct btf * btf,__u32 type_id) btf_type_by_id() argument 798 btf__type_by_id(const struct btf * btf,__u32 type_id) btf__type_by_id() argument 805 determine_ptr_size(const struct btf * btf) determine_ptr_size() argument 849 btf_ptr_sz(const struct btf * btf) btf_ptr_sz() argument 864 btf__pointer_size(const struct btf * btf) btf__pointer_size() argument 879 btf__set_pointer_size(struct btf * btf,size_t ptr_sz) btf__set_pointer_size() argument 898 btf__endianness(const struct btf * btf) btf__endianness() argument 906 btf__set_endianness(struct btf * btf,enum btf_endianness endian) btf__set_endianness() argument 931 btf__resolve_size(const struct btf * btf,__u32 type_id) btf__resolve_size() argument 986 btf__align_of(const struct btf * btf,__u32 id) btf__align_of() argument 1041 btf__resolve_type(const struct btf * btf,__u32 type_id) btf__resolve_type() argument 1061 btf_check_sorted(struct btf * btf) btf_check_sorted() argument 1085 btf_find_type_by_name_bsearch(const struct btf * btf,const char * name,__s32 start_id) btf_find_type_by_name_bsearch() argument 1110 btf_find_by_name_kind(const struct btf * btf,int start_id,const char * type_name,__s32 kind) btf_find_by_name_kind() argument 1155 btf__find_by_name(const struct btf * btf,const char * type_name) btf__find_by_name() argument 1160 btf__find_by_name_kind_own(const struct btf * btf,const char * type_name,__u32 kind) btf__find_by_name_kind_own() argument 1166 btf__find_by_name_kind(const struct btf * btf,const char * type_name,__u32 kind) btf__find_by_name_kind() argument 1172 btf_is_modifiable(const struct btf * btf) btf_is_modifiable() argument 1178 btf_free_raw_data(struct btf * btf) btf_free_raw_data() argument 1189 btf__free(struct btf * btf) btf__free() argument 1221 struct btf *btf; btf_new_empty() local 1302 struct btf *btf; btf_new() local 1452 struct btf *btf = NULL; btf_parse_elf() local 1561 struct btf *btf = NULL; btf_parse_raw() local 1636 struct btf *btf; btf_parse_raw_mmap() local 1665 struct btf *btf; btf_parse() local 1692 btf_load_into_kernel(struct btf * btf,char * log_buf,size_t log_sz,__u32 log_level,int token_fd) btf_load_into_kernel() argument 1773 btf__load_into_kernel(struct btf * btf) btf__load_into_kernel() argument 1778 btf__fd(const struct btf * btf) btf__fd() argument 1783 btf__set_fd(struct btf * btf,int fd) btf__set_fd() argument 1788 btf_strs_data(const struct btf * btf) btf_strs_data() argument 1793 btf_get_raw_data(const struct btf * btf,__u32 * size,bool swap_endian) btf_get_raw_data() argument 1858 struct btf *btf = (struct btf *)btf_ro; btf__raw_data() local 1878 btf__str_by_offset(const struct btf * btf,__u32 offset) btf__str_by_offset() argument 1888 btf__name_by_offset(const struct btf * btf,__u32 offset) btf__name_by_offset() argument 1898 struct btf *btf; btf_get_from_fd() local 1949 struct btf *btf; btf_load_from_kernel() local 1978 btf_invalidate_raw_data(struct btf * btf) btf_invalidate_raw_data() argument 1993 btf_ensure_modifiable(struct btf * btf) btf_ensure_modifiable() argument 2066 btf__find_str(struct btf * btf,const char * s) btf__find_str() argument 2094 btf__add_str(struct btf * btf,const char * s) btf__add_str() argument 2118 btf_add_type_mem(struct btf * btf,size_t add_sz) btf_add_type_mem() argument 2132 btf_hdr_update_type_len(struct btf * btf,int new_len) btf_hdr_update_type_len() argument 2143 btf_hdr_update_str_len(struct btf * btf,int new_len) btf_hdr_update_str_len() argument 2148 btf_commit_type(struct btf * btf,int data_sz) btf_commit_type() argument 2233 btf__add_type(struct btf * btf,const struct btf * src_btf,const struct btf_type * src_type) btf__add_type() argument 2243 btf__add_btf(struct btf * btf,const struct btf * src_btf) btf__add_btf() argument 2381 btf__add_int(struct btf * btf,const char * name,size_t byte_sz,int encoding) btf__add_int() argument 2431 btf__add_float(struct btf * btf,const char * name,size_t byte_sz) btf__add_float() argument 2478 btf_add_ref_kind(struct btf * btf,int kind,const char * name,int ref_type_id,int kflag) btf_add_ref_kind() argument 2516 btf__add_ptr(struct btf * btf,int ref_type_id) btf__add_ptr() argument 2530 btf__add_array(struct btf * btf,int index_type_id,int elem_type_id,__u32 nr_elems) btf__add_array() argument 2562 btf_add_composite(struct btf * btf,int kind,const char * name,__u32 bytes_sz) btf_add_composite() argument 2605 btf__add_struct(struct btf * btf,const char * name,__u32 byte_sz) btf__add_struct() argument 2623 btf__add_union(struct btf * btf,const char * name,__u32 byte_sz) btf__add_union() argument 2628 btf_last_type(struct btf * btf) btf_last_type() argument 2643 btf__add_field(struct btf * btf,const char * name,int type_id,__u32 bit_offset,__u32 bit_size) btf__add_field() argument 2702 btf_add_enum_common(struct btf * btf,const char * name,__u32 byte_sz,bool is_signed,__u8 kind) btf_add_enum_common() argument 2749 btf__add_enum(struct btf * btf,const char * name,__u32 byte_sz) btf__add_enum() argument 2766 btf__add_enum_value(struct btf * btf,const char * name,__s64 value) btf__add_enum_value() argument 2831 btf__add_enum64(struct btf * btf,const char * name,__u32 byte_sz,bool is_signed) btf__add_enum64() argument 2846 btf__add_enum64_value(struct btf * btf,const char * name,__u64 value) btf__add_enum64_value() argument 2901 btf__add_fwd(struct btf * btf,const char * name,enum btf_fwd_kind fwd_kind) btf__add_fwd() argument 2937 btf__add_typedef(struct btf * btf,const char * name,int ref_type_id) btf__add_typedef() argument 2952 btf__add_volatile(struct btf * btf,int ref_type_id) btf__add_volatile() argument 2964 btf__add_const(struct btf * btf,int ref_type_id) btf__add_const() argument 2976 btf__add_restrict(struct btf * btf,int ref_type_id) btf__add_restrict() argument 2989 btf__add_type_tag(struct btf * btf,const char * value,int ref_type_id) btf__add_type_tag() argument 3006 btf__add_type_attr(struct btf * btf,const char * value,int ref_type_id) btf__add_type_attr() argument 3022 btf__add_func(struct btf * btf,const char * name,enum btf_func_linkage linkage,int proto_type_id) btf__add_func() argument 3054 btf__add_func_proto(struct btf * btf,int ret_type_id) btf__add_func_proto() argument 3090 btf__add_func_param(struct btf * btf,const char * name,int type_id) btf__add_func_param() argument 3146 btf__add_var(struct btf * btf,const char * name,int linkage,int type_id) btf__add_var() argument 3198 btf__add_datasec(struct btf * btf,const char * name,__u32 byte_sz) btf__add_datasec() argument 3239 btf__add_datasec_var_info(struct btf * btf,int var_type_id,__u32 offset,__u32 byte_sz) btf__add_datasec_var_info() argument 3280 btf_add_decl_tag(struct btf * btf,const char * value,int ref_type_id,int component_idx,int kflag) btf_add_decl_tag() argument 3324 btf__add_decl_tag(struct btf * btf,const char * value,int ref_type_id,int component_idx) btf__add_decl_tag() argument 3341 btf__add_decl_attr(struct btf * btf,const char * value,int ref_type_id,int component_idx) btf__add_decl_attr() argument 3905 btf__dedup(struct btf * btf,const struct btf_dedup_opts * opts) btf__dedup() argument 3974 struct btf *btf; global() member 4080 btf_dedup_new(struct btf * btf,const struct btf_dedup_opts * opts) btf_dedup_new() argument 5788 struct btf *btf; btf__load_vmlinux_btf() local 6225 btf_header(const struct btf * btf) btf_header() argument 6230 btf_set_base_btf(struct btf * btf,const struct btf * base_btf) btf_set_base_btf() argument 6237 btf__relocate(struct btf * btf,const struct btf * base_btf) btf__relocate() argument 6247 struct btf *btf; global() member 6269 btf__permute(struct btf * btf,__u32 * id_map,__u32 id_map_cnt,const struct btf_permute_opts * opts) btf__permute() argument [all...] |
| H A D | relo_core.h | 10 const struct btf *btf; member 30 const struct btf *btf; member 71 int __bpf_core_types_are_compat(const struct btf *local_btf, __u32 local_id, 72 const struct btf *targ_btf, __u32 targ_id, int level); 73 int bpf_core_types_are_compat(const struct btf *local_btf, __u32 local_id, 74 const struct btf *targ_btf, __u32 targ_id); 75 int __bpf_core_types_match(const struct btf *local_btf, __u32 local_id, const struct btf *targ_btf, 77 int bpf_core_types_match(const struct btf *local_btf, __u32 local_id, const struct btf *targ_btf, 84 const struct btf *local_btf, 93 int bpf_core_parse_spec(const char *prog_name, const struct btf *btf,
|
| /linux/include/linux/ |
| H A D | btf.h | 12 #include <uapi/linux/btf.h> 115 struct btf; 161 const char *btf_get_name(const struct btf *btf); 162 void btf_get(struct btf *btf); 163 void btf_put(struct btf *btf); 164 const struct btf_header *btf_header(const struct btf *btf); 545 bpf_struct_ops_find(struct btf * btf,u32 type_id) bpf_struct_ops_find() argument 606 btf_type_is_struct_ptr(struct btf * btf,const struct btf_type * t) btf_type_is_struct_ptr() argument 616 btf_type_by_id(const struct btf * btf,u32 type_id) btf_type_by_id() argument 622 btf_set_base_btf(struct btf * btf,const struct btf * base_btf) btf_set_base_btf() argument 626 btf_relocate(void * log,struct btf * btf,const struct btf * base_btf,__u32 ** map_ids) btf_relocate() argument 643 btf_name_by_offset(const struct btf * btf,u32 offset) btf_name_by_offset() argument 648 btf_kfunc_id_set_contains(const struct btf * btf,u32 kfunc_btf_id,struct bpf_prog * prog) btf_kfunc_id_set_contains() argument 660 btf_find_dtor_kfunc(struct btf * btf,u32 btf_id) btf_find_dtor_kfunc() argument 669 btf_find_struct_meta(const struct btf * btf,u32 btf_id) btf_find_struct_meta() argument 674 btf_is_prog_ctx_type(struct bpf_verifier_log * log,const struct btf * btf,const struct btf_type * t,enum bpf_prog_type prog_type,int arg) btf_is_prog_ctx_type() argument 689 btf_check_iter_arg(struct btf * btf,const struct btf_type * func,int arg_idx) btf_check_iter_arg() argument [all...] |
| /linux/kernel/bpf/ |
| H A D | btf.c | 4 #include <uapi/linux/btf.h> 20 #include <linux/btf.h> 121 * an array: "btf->types". 142 * 1) does exist in the BTF (i.e. in btf->types[]) 256 struct btf { argument 278 struct btf *base_btf; 319 struct btf *btf; 428 const struct btf *btf; 254 struct btf { global() struct 261 hdrbtf global() argument 269 kfunc_set_tabbtf global() argument 270 dtor_kfunc_tabbtf global() argument 271 struct_meta_tabbtf global() argument 272 struct_ops_tabbtf global() argument 273 layoutbtf global() argument 276 base_btfbtf global() argument 280 kernel_btfbtf global() argument 290 base_id_mapbtf global() argument 317 struct btf *btf; global() member 423 const struct btf *btf; global() member 500 btf_start_id(const struct btf * btf) btf_start_id() argument 538 btf_is_vmlinux(const struct btf * btf) btf_is_vmlinux() argument 543 btf_nr_types(const struct btf * btf) btf_nr_types() argument 559 btf_check_sorted(struct btf * btf) btf_check_sorted() argument 607 btf_named_start_id(const struct btf * btf,bool own) btf_named_start_id() argument 617 btf_find_by_name_kind_bsearch(const struct btf * btf,const char * name) btf_find_by_name_kind_bsearch() argument 641 btf_find_by_name_kind(const struct btf * btf,const char * name,u8 kind) btf_find_by_name_kind() argument 681 struct btf *btf; bpf_find_btf_id() local 724 btf_type_skip_modifiers(const struct btf * btf,u32 id,u32 * res_id) btf_type_skip_modifiers() argument 740 btf_type_resolve_ptr(const struct btf * btf,u32 id,u32 * res_id) btf_type_resolve_ptr() argument 752 btf_type_resolve_func_ptr(const struct btf * btf,u32 id,u32 * res_id) btf_type_resolve_func_ptr() argument 868 btf_name_offset_valid(const struct btf * btf,u32 offset) btf_name_offset_valid() argument 890 btf_str_by_offset(const struct btf * btf,u32 offset) btf_str_by_offset() argument 902 btf_name_valid_identifier(const struct btf * btf,u32 offset) btf_name_valid_identifier() argument 924 btf_name_valid_section(const struct btf * btf,u32 offset) btf_name_valid_section() argument 944 __btf_name_by_offset(const struct btf * btf,u32 offset) __btf_name_by_offset() argument 955 btf_name_by_offset(const struct btf * btf,u32 offset) btf_name_by_offset() argument 960 btf_type_by_id(const struct btf * btf,u32 type_id) btf_type_by_id() argument 1016 btf_member_is_reg_int(const struct btf * btf,const struct btf_type * s,const struct btf_member * m,u32 expected_offset,u32 expected_size) btf_member_is_reg_int() argument 1054 btf_type_skip_qualifiers(const struct btf * btf,u32 id) btf_type_skip_qualifiers() argument 1566 struct btf *btf = env->btf; __btf_verifier_log_type() local 1616 struct btf *btf = env->btf; btf_verifier_log_member() local 1694 const struct btf *btf = env->btf; btf_verifier_log_hdr() local 1721 struct btf *btf = env->btf; btf_add_type() local 1764 btf_alloc_id(struct btf * btf) btf_alloc_id() argument 1782 btf_free_id(struct btf * btf) btf_free_id() argument 1809 btf_free_kfunc_set_tab(struct btf * btf) btf_free_kfunc_set_tab() argument 1822 btf_free_dtor_kfunc_tab(struct btf * btf) btf_free_dtor_kfunc_tab() argument 1843 btf_free_struct_meta_tab(struct btf * btf) btf_free_struct_meta_tab() argument 1851 btf_free_struct_ops_tab(struct btf * btf) btf_free_struct_ops_tab() argument 1866 btf_free(struct btf * btf) btf_free() argument 1886 struct btf *btf = container_of(rcu, struct btf, rcu); btf_free_rcu() local 1891 btf_get_name(const struct btf * btf) btf_get_name() argument 1896 btf_get(struct btf * btf) btf_get() argument 1901 btf_put(struct btf * btf) btf_put() argument 1909 btf_base_btf(const struct btf * btf) btf_base_btf() argument 1914 btf_header(const struct btf * btf) btf_header() argument 1919 btf_set_base_btf(struct btf * btf,const struct btf * base_btf) btf_set_base_btf() argument 1928 struct btf *btf = env->btf; env_resolve_init() local 2006 const struct btf *btf = env->btf; env_stack_push() local 2044 struct btf *btf = env->btf; env_stack_pop_resolved() local 2078 __btf_resolve_size(const struct btf * btf,const struct btf_type * type,u32 * type_size,const struct btf_type ** elem_type,u32 * elem_id,u32 * total_nelems,u32 * type_id) __btf_resolve_size() argument 2148 btf_resolve_size(const struct btf * btf,const struct btf_type * type,u32 * type_size) btf_resolve_size() argument 2154 btf_resolved_type_id(const struct btf * btf,u32 type_id) btf_resolved_type_id() argument 2163 btf_type_id_resolve(const struct btf * btf,u32 * type_id) btf_type_id_resolve() argument 2170 btf_resolved_type_size(const struct btf * btf,u32 type_id) btf_resolved_type_size() argument 2178 btf_type_id_size(const struct btf * btf,u32 * type_id,u32 * ret_size) btf_type_id_size() argument 2270 btf_df_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offsets,struct btf_show * show) btf_df_show() argument 2537 btf_int_bits_show(const struct btf * btf,const struct btf_type * t,void * data,u8 bits_offset,struct btf_show * show) btf_int_bits_show() argument 2556 btf_int_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) btf_int_show() argument 2643 struct btf *btf = env->btf; btf_modifier_check_member() local 2668 struct btf *btf = env->btf; btf_modifier_check_kflag_member() local 2765 struct btf *btf = env->btf; btf_modifier_resolve() local 2807 struct btf *btf = env->btf; btf_var_resolve() local 2853 struct btf *btf = env->btf; btf_ptr_resolve() local 2904 btf_modifier_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) btf_modifier_show() argument 2924 btf_var_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) btf_var_show() argument 2941 btf_ptr_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) btf_ptr_show() argument 3032 struct btf *btf = env->btf; btf_array_check_member() local 3112 struct btf *btf = env->btf; btf_array_resolve() local 3180 __btf_array_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) __btf_array_show() argument 3233 btf_array_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) btf_array_show() argument 3307 struct btf *btf = env->btf; btf_struct_check_meta() local 3477 btf_find_struct(const struct btf * btf,const struct btf_type * t,u32 off,int sz,enum btf_field_type field_type,struct btf_field_info * info) btf_find_struct() argument 3501 btf_type_tag_walk(const struct btf * btf,struct btf_type_tag_walk_ctx * ctx,const struct btf_type_tag_match * matches,u32 match_cnt) btf_type_tag_walk() argument 3541 btf_find_kptr(const struct btf * btf,const struct btf_type * t,u32 off,int sz,struct btf_field_info * info,u32 field_mask) btf_find_kptr() argument 3585 btf_find_next_decl_tag(const struct btf * btf,const struct btf_type * pt,int comp_idx,const char * tag_key,int last_id) btf_find_next_decl_tag() argument 3607 btf_find_decl_tag_value(const struct btf * btf,const struct btf_type * pt,int comp_idx,const char * tag_key) btf_find_decl_tag_value() argument 3632 btf_find_graph_root(const struct btf * btf,const struct btf_type * pt,const struct btf_type * t,int comp_idx,u32 off,int sz,struct btf_field_info * info,enum btf_field_type head_type) btf_find_graph_root() argument 3669 btf_get_field_type(const struct btf * btf,const struct btf_type * var_type,u32 field_mask,u32 * seen_mask,int * align,int * sz) btf_get_field_type() argument 3776 btf_find_nested_struct(const struct btf * btf,const struct btf_type * t,u32 off,u32 nelems,u32 field_mask,struct btf_field_info * info,int info_cnt,u32 level,u32 * seen_mask) btf_find_nested_struct() argument 3809 btf_find_field_one(const struct btf * btf,const struct btf_type * var,const struct btf_type * var_type,int var_idx,u32 off,u32 expected_size,u32 field_mask,u32 * seen_mask,struct btf_field_info * info,int info_cnt,u32 level) btf_find_field_one() argument 3906 btf_find_struct_field(const struct btf * btf,const struct btf_type * t,u32 field_mask,struct btf_field_info * info,int info_cnt,u32 level,u32 * seen_mask) btf_find_struct_field() argument 3936 btf_find_datasec_var(const struct btf * btf,const struct btf_type * t,u32 field_mask,struct btf_field_info * info,int info_cnt,u32 level,u32 * seen_mask) btf_find_datasec_var() argument 3960 btf_find_field(const struct btf * btf,const struct btf_type * t,u32 field_mask,struct btf_field_info * info,int info_cnt) btf_find_field() argument 3974 btf_parse_kptr(const struct btf * btf,struct btf_field * field,struct btf_field_info * info) btf_parse_kptr() argument 4064 btf_parse_graph_root(const struct btf * btf,struct btf_field * field,struct btf_field_info * info,const char * node_type_name,size_t node_type_align) btf_parse_graph_root() argument 4108 btf_parse_list_head(const struct btf * btf,struct btf_field * field,struct btf_field_info * info) btf_parse_list_head() argument 4115 btf_parse_rb_root(const struct btf * btf,struct btf_field * field,struct btf_field_info * info) btf_parse_rb_root() argument 4134 btf_parse_fields(const struct btf * btf,const struct btf_type * t,u32 field_mask,u32 value_size) btf_parse_fields() argument 4267 btf_check_and_fixup_fields(const struct btf * btf,struct btf_record * rec) btf_check_and_fixup_fields() argument 4309 btf_owned_type_idx(const struct btf * btf,struct btf_struct_metas * tab,const struct btf_field * field) btf_owned_type_idx() argument 4340 btf_ownership_depth(const struct btf * btf,struct btf_struct_metas * tab,u8 * depth,int idx,int depth_left) btf_ownership_depth() argument 4368 btf_check_ownership_depth(const struct btf * btf,struct btf_struct_metas * tab) btf_check_ownership_depth() argument 4389 __btf_struct_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) __btf_struct_show() argument 4436 btf_struct_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) btf_struct_show() argument 4544 struct btf *btf = env->btf; btf_enum_check_meta() local 4604 btf_enum_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) btf_enum_show() argument 4652 struct btf *btf = env->btf; btf_enum64_check_meta() local 4707 btf_enum64_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) btf_enum64_show() argument 5027 struct btf *btf = env->btf; btf_datasec_resolve() local 5069 btf_datasec_show(const struct btf * btf,const struct btf_type * t,u32 type_id,void * data,u8 bits_offset,struct btf_show * show) btf_datasec_show() argument 5221 struct btf *btf = env->btf; btf_decl_tag_resolve() local 5281 const struct btf *btf; btf_func_proto_check() local 5376 const struct btf *btf; btf_func_check() local 5459 struct btf *btf = env->btf; btf_check_all_metas() local 5488 struct btf *btf = env->btf; btf_resolve_valid() local 5560 struct btf *btf = env->btf; btf_check_all_types() local 5618 struct btf *btf = env->btf; btf_parse_str_sec() local 5650 struct btf *btf = env->btf; btf_parse_layout_sec() local 5704 const struct btf *btf; btf_check_sec_info() local 5758 struct btf *btf; btf_parse_hdr() local 5828 btf_parse_struct_metas(struct bpf_verifier_log * log,struct btf * btf) btf_parse_struct_metas() argument 5949 btf_find_struct_meta(const struct btf * btf,u32 btf_id) btf_find_struct_meta() argument 5961 btf_check_modifier_chain_length(struct btf_verifier_env * env,struct btf * btf,int start_id) btf_check_modifier_chain_length() argument 6004 struct btf *btf = NULL; btf_parse() local 6184 btf_is_prog_ctx_type(struct bpf_verifier_log * log,const struct btf * btf,const struct btf_type * t,enum bpf_prog_type prog_type,int arg) btf_is_prog_ctx_type() argument 6270 btf_validate_prog_ctx_type(struct bpf_verifier_log * log,const struct btf * btf,const struct btf_type * t,int arg,enum bpf_prog_type prog_type,enum bpf_attach_type attach_type) btf_validate_prog_ctx_type() argument 6406 btf_translate_to_vmlinux(struct bpf_verifier_log * log,struct btf * btf,const struct btf_type * t,enum bpf_prog_type prog_type,int arg) btf_translate_to_vmlinux() argument 6441 struct btf *btf = NULL; BTF_ID_LIST_SINGLE() local 6495 struct btf *btf; btf_parse_vmlinux() local 6524 btf_relocate_id(const struct btf * btf,__u32 id) btf_relocate_id() argument 6537 struct btf *btf = NULL, *vmlinux_btf, *base_btf = NULL; btf_parse_module() local 6641 btf_ctx_arg_idx(struct btf * btf,const struct btf_type * func_proto,int off) btf_ctx_arg_idx() argument 6685 btf_ctx_arg_offset(const struct btf * btf,const struct btf_type * func_proto,u32 arg_no) btf_ctx_arg_offset() argument 6912 struct btf *btf = bpf_prog_get_target_btf(prog); btf_ctx_access() local 7073 struct btf *btf = prog->aux->attach_btf; btf_ctx_access() local 7166 btf_struct_walk(struct bpf_verifier_log * log,const struct btf * btf,const struct btf_type * t,int off,int size,u32 * next_btf_id,enum bpf_type_flag * flag,const char ** field_name,bool walk_flex_arrays) btf_struct_walk() argument 7438 const struct btf *btf = reg->btf; btf_struct_access() local 7526 btf_struct_ids_match(struct bpf_verifier_log * log,const struct btf * btf,u32 id,int off,const struct btf * need_btf,u32 need_type_id,bool strict,bool walk_flex_arrays) btf_struct_ids_match() argument 7565 __get_type_size(struct btf * btf,u32 btf_id,const struct btf_type ** ret_type) __get_type_size() argument 7598 __get_arg_fmodel_flags(const struct btf * btf,const struct btf_param * arg,const struct btf_type * t) __get_arg_fmodel_flags() argument 7615 btf_distill_func_proto(struct bpf_verifier_log * log,struct btf * btf,const struct btf_type * func,const char * tname,struct btf_func_model * m) btf_distill_func_proto() argument 7827 btf_is_dynptr_ptr(const struct btf * btf,const struct btf_type * t) btf_is_dynptr_ptr() argument 7852 const struct btf *btf; global() member 7863 btf_get_ptr_to_btf_id(struct bpf_verifier_log * log,int arg_idx,const struct btf * btf,const struct btf_type * t) btf_get_ptr_to_btf_id() argument 7923 btf_scan_decl_tags(struct bpf_verifier_env * env,const struct btf * btf,const struct btf_type * fn_t,u32 arg_idx,bool is_global,u32 * tags) btf_scan_decl_tags() argument 7985 btf_scan_type_tags(struct bpf_verifier_env * env,const struct btf * btf,u32 type_id,u32 * tags) btf_scan_type_tags() argument 8019 btf_validate_return_type(struct bpf_verifier_env * env,struct btf * btf,const struct btf_type * t,int subprog) btf_validate_return_type() argument 8061 struct btf *btf = prog->aux->btf; btf_prepare_func_args() local 8283 btf_type_show(const struct btf * btf,u32 type_id,void * obj,struct btf_show * show) btf_type_show() argument 8301 btf_type_seq_show_flags(const struct btf * btf,u32 type_id,void * obj,struct seq_file * m,u64 flags) btf_type_seq_show_flags() argument 8315 btf_type_seq_show(const struct btf * btf,u32 type_id,void * obj,struct seq_file * m) btf_type_seq_show() argument 8351 btf_type_snprintf_show(const struct btf * btf,u32 type_id,void * obj,char * buf,int len,u64 flags) btf_type_snprintf_show() argument 8372 btf_type_name_to_buf(const struct btf * btf,u32 type_id,char * buf,int len) btf_type_name_to_buf() argument 8385 const struct btf *btf = filp->private_data; bpf_btf_show_fdinfo() local 8404 __btf_new_fd(struct btf * btf) __btf_new_fd() argument 8411 struct btf *btf; btf_new_fd() local 8439 struct btf *btf; btf_get_by_fd() local 8449 btf_get_info_by_fd(const struct btf * btf,const union bpf_attr * attr,union bpf_attr __user * uattr) btf_get_info_by_fd() argument 8511 struct btf *btf; btf_get_fd_by_id() local 8530 btf_obj_id(const struct btf * btf) btf_obj_id() argument 8535 btf_is_kernel(const struct btf * btf) btf_is_kernel() argument 8540 btf_is_module(const struct btf * btf) btf_is_module() argument 8553 struct btf *btf; global() member 8568 struct btf *btf; btf_module_notify() local 8690 btf_try_get_module(const struct btf * btf) btf_try_get_module() argument 8725 struct btf *btf = NULL; btf_get_module_btf() local 8763 struct btf *btf = NULL; BPF_CALL_4() local 8832 btf_check_iter_kfuncs(struct btf * btf,const char * func_name,const struct btf_type * func,u32 func_flags) btf_check_iter_kfuncs() argument 8898 btf_check_kfunc_name(struct btf * btf,const char * func_name,u32 kind) btf_check_kfunc_name() argument 8931 btf_check_kfunc_protos(struct btf * btf,u32 func_id,u32 func_flags) btf_check_kfunc_protos() argument 8963 btf_populate_kfunc_set(struct btf * btf,enum btf_kfunc_hook hook,const struct btf_kfunc_id_set * kset) btf_populate_kfunc_set() argument 9074 btf_kfunc_id_set_contains(const struct btf * btf,enum btf_kfunc_hook hook,u32 kfunc_btf_id) btf_kfunc_id_set_contains() argument 9095 __btf_kfunc_is_allowed(const struct btf * btf,enum btf_kfunc_hook hook,u32 kfunc_btf_id,const struct bpf_prog * prog) __btf_kfunc_is_allowed() argument 9164 btf_kfunc_is_allowed(const struct btf * btf,u32 kfunc_btf_id,const struct bpf_prog * prog) btf_kfunc_is_allowed() argument 9191 btf_kfunc_flags(const struct btf * btf,u32 kfunc_btf_id,const struct bpf_prog * prog) btf_kfunc_flags() argument 9213 btf_kfunc_check_flag(const struct btf * btf,u32 kfunc_btf_id,u32 flag) btf_kfunc_check_flag() argument 9234 btf_kfunc_is_modify_return(const struct btf * btf,u32 kfunc_btf_id,const struct bpf_prog * prog) btf_kfunc_is_modify_return() argument 9246 struct btf *btf; __register_btf_kfunc_id_set() local 9295 btf_find_dtor_kfunc(struct btf * btf,u32 btf_id) btf_find_dtor_kfunc() argument 9312 btf_check_dtor_kfuncs(struct btf * btf,const struct btf_id_dtor_kfunc * dtors,u32 cnt) btf_check_dtor_kfuncs() argument 9361 struct btf *btf; register_btf_id_dtor_kfuncs() local 9592 __purge_cand_cache(struct btf * btf,struct bpf_cand_cache ** cache,int cache_size) __purge_cand_cache() argument 9624 purge_cand_cache(struct btf * btf) purge_cand_cache() argument 9852 struct btf *btf = reg->btf; btf_nested_type_is_trusted() local 9952 btf_add_struct_ops(struct btf * btf,struct bpf_struct_ops * st_ops,struct bpf_verifier_log * log) btf_add_struct_ops() argument 9994 bpf_struct_ops_find_value(struct btf * btf,u32 value_id) bpf_struct_ops_find_value() argument 10016 bpf_struct_ops_find(struct btf * btf,u32 type_id) bpf_struct_ops_find() argument 10040 struct btf *btf; __register_bpf_struct_ops() local 10068 btf_param_match_suffix(const struct btf * btf,const struct btf_param * arg,const char * suffix) btf_param_match_suffix() argument [all...] |
| H A D | check_btf.c | 40 const struct btf *btf; in prepare_btf_func() local 61 btf = prog->aux->btf; in prepare_btf_func() 108 type = btf_type_by_id(btf, krecord[i].type_id); in prepare_btf_func() 115 func_proto = btf_type_by_id(btf, type->type); in prepare_btf_func() 142 const struct btf *btf; in check_btf_func() local 161 btf = prog->aux->btf; in check_btf_func() 181 type = btf_type_by_id(btf, krecord[i].type_id); in check_btf_func() 184 func_proto = btf_type_by_id(btf, type->type); in check_btf_func() 186 ret_type = btf_type_skip_modifiers(btf, func_proto->type, NULL); in check_btf_func() 198 env->subprog_info[i].name = btf_name_by_offset(btf, type->name_off); in check_btf_func() [all …]
|
| H A D | bpf_struct_ops.c | 6 #include <linux/btf.h> 43 /* The owner moduler's btf. */ member 44 struct btf *btf; 88 extern struct btf *btf_vmlinux; 90 static bool is_valid_value_type(struct btf *btf, s32 value_id, in is_valid_value_type() 98 vt = btf_type_by_id(btf, value_id); in is_valid_value_type() 105 mt = btf_type_by_id(btf, member->type); in is_valid_value_type() 114 mt = btf_type_by_id(btf, membe in is_valid_value_type() 89 is_valid_value_type(struct btf * btf,s32 value_id,const struct btf_type * type,const char * value_name) is_valid_value_type() argument 173 prepare_arg_info(struct btf * btf,const char * st_ops_name,const char * member_name,const struct btf_type * func_proto,void * stub_func_addr,struct btf_func_model * model,struct bpf_struct_ops_arg_info * arg_info) prepare_arg_info() argument 337 is_module_member(const struct btf * btf,u32 id) is_module_member() argument 359 bpf_struct_ops_desc_init(struct bpf_struct_ops_desc * st_ops_desc,struct btf * btf,struct bpf_verifier_log * log) bpf_struct_ops_desc_init() argument 595 check_zero_holes(const struct btf * btf,const struct btf_type * t,void * data) check_zero_holes() argument 1071 count_func_ptrs(const struct btf * btf,const struct btf_type * t) count_func_ptrs() argument 1092 struct btf *btf; bpf_struct_ops_map_alloc() local [all...] |
| /linux/tools/bpf/resolve_btfids/ |
| H A D | main.c | 90 #include <bpf/btf.h> 145 struct btf *btf; 146 struct btf *base_btf; 147 struct btf *inline_btf; 148 struct btf *orig_btf; 219 struct btf *btf; 801 struct btf *base_btf = NULL, *btf in id_patch() 143 struct btf *btf; global() member 196 struct btf *btf; global() member 682 struct btf *base_btf = NULL, *btf = NULL; load_btf() local 722 struct btf *btf = obj->btf; symbols_resolve() local 961 dump_raw_btf(struct btf * btf,const char * out_path) dump_raw_btf() argument 980 btf_type_skip_qualifiers(const struct btf * btf,s32 type_id) btf_type_skip_qualifiers() argument 1056 struct btf *btf = ctx->btf; collect_decl_tags() local 1080 is_arena_param(const struct btf * btf,const struct btf_param * param) is_arena_param() argument 1091 struct btf *btf = ctx->btf; collect_kfuncs() local 1170 is_kf_implicit_arg(const struct btf * btf,const struct btf_param * p) is_kf_implicit_arg() argument 1225 struct btf *btf = ctx->btf; process_kfunc_with_implicit_args() local 1320 is_arena_arg(const struct btf * btf,const struct kfunc * kfunc,const struct btf_param * param,u32 idx) is_arena_arg() argument 1336 arena_tag_ptr(struct btf * btf,u32 ptr_id,struct kfunc * kfunc) arena_tag_ptr() argument 1369 add_arena_tagged_proto(struct btf * btf,struct kfunc * kfunc) add_arena_tagged_proto() argument 1519 struct btf *btf = (struct btf *)priv; cmp_type_names() local 1535 sort_btf_by_name(struct btf * btf) sort_btf_by_name() argument 1580 struct btf *base_btf = obj->base_btf, *btf = obj->btf; finalize_btf() local [all...] |
| /linux/tools/bpf/bpftool/ |
| H A D | btf.c | 15 #include <linux/btf.h> 20 #include <bpf/btf.h> 112 static const char *btf_str(const struct btf *btf, __u32 off) in btf_str() 116 return btf__name_by_offset(btf, off) ? : "(invalid)"; in btf_kind_safe() 290 static void btf_locsec_func_str(const struct btf *btf, in dump_btf_type() 304 func = btf__type_by_id(btf, loc->func); in dump_btf_type() 308 name = btf_str(btf, func->name_off); in dump_btf_type() 309 func_proto = btf__type_by_id(btf, fun in dump_btf_type() 108 btf_str(const struct btf * btf,__u32 off) btf_str() argument 120 dump_btf_type(const struct btf * btf,__u32 id,const struct btf_type * t) dump_btf_type() argument 430 dump_btf_raw(const struct btf * btf,__u32 * root_type_ids,int root_type_cnt) dump_btf_raw() argument 499 struct btf *btf = ctx; cmp_kfuncs() local 507 dump_btf_kfuncs(struct btf_dump * d,const struct btf * btf) dump_btf_kfuncs() argument 584 btf_type_rank(const struct btf * btf,__u32 index,bool has_name) btf_type_rank() argument 624 btf_type_sort_name(const struct btf * btf,__u32 index,bool from_ref) btf_type_sort_name() argument 661 btf_name_hasher(__u64 hash,const struct btf * btf,__u32 name_off) btf_name_hasher() argument 669 btf_type_disambig_hash(const struct btf * btf,__u32 id,bool include_members) btf_type_disambig_hash() argument 740 sort_btf_c(const struct btf * btf) sort_btf_c() argument 766 dump_btf_c(const struct btf * btf,__u32 * root_type_ids,int root_type_cnt,bool sort_dump) dump_btf_c() argument 918 struct btf *btf = NULL, *base = NULL; do_dump() local [all...] |
| H A D | btf_dumper.c | 10 #include <linux/btf.h> 12 #include <bpf/btf.h> 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() 211 is_str_array(const struct btf * btf,const struct btf_array * arr,const char * s) is_str_array() argument 619 __btf_dumper_type_only(const struct btf * btf,__u32 type_id,char * func_sig,int pos,int size) __btf_dumper_type_only() argument 710 btf_dump_func(const struct btf * btf,char * func_sig,const struct btf_type * func_proto,const struct btf_type * func,int pos,int size) btf_dump_func() argument 747 btf_dumper_type_only(const struct btf * btf,__u32 type_id,char * func_sig,int size) btf_dumper_type_only() argument 769 btf_dump_linfo_plain(const struct btf * btf,const struct bpf_line_info * linfo,const char * prefix,bool linum) btf_dump_linfo_plain() argument 801 btf_dump_linfo_json(const struct btf * btf,const struct bpf_line_info * linfo,bool linum) btf_dump_linfo_json() argument 874 btf_dump_linfo_dotlabel(const struct btf * btf,const struct bpf_line_info * linfo,bool linum) btf_dump_linfo_dotlabel() argument [all...] |
| H A D | gen.c | 22 #include <bpf/btf.h> 59 resolve_func_ptr(const struct btf *btf, __u32 id, __u32 *res_id) in resolve_func_ptr() argument 63 t = skip_mods_and_typedefs(btf, id, NULL); in resolve_func_ptr() 67 t = skip_mods_and_typedefs(btf, t->type, res_id); in resolve_func_ptr() 154 struct btf *btf, in codegen_datasec_def() argument 159 const char *sec_name = btf__name_by_offset(btf, sec->name_off); in codegen_datasec_def() 173 const struct btf_type *var = btf__type_by_id(btf, sec_var->type); in codegen_datasec_def() 174 const char *var_name = btf__name_by_offset(btf, va in codegen_datasec_def() 241 find_type_for_map(struct btf * btf,const char * map_ident) find_type_for_map() argument 294 struct btf *btf = bpf_object__btf(obj); codegen_datasecs() local 335 btf_is_ptr_to_func_proto(const struct btf * btf,const struct btf_type * v) btf_is_ptr_to_func_proto() argument 343 struct btf *btf = bpf_object__btf(obj); codegen_subskel_datasecs() local 516 struct btf *btf = bpf_object__btf(obj); codegen_asserts() local 1046 walk_st_ops_shadow_vars(struct btf * btf,const char * ident,const struct btf_type * map_type,__u32 map_type_id) walk_st_ops_shadow_vars() argument 1161 gen_st_ops_shadow_type(const char * obj_name,struct btf * btf,const char * ident,const struct bpf_map * map) gen_st_ops_shadow_type() argument 1189 gen_st_ops_shadow(const char * obj_name,struct btf * btf,struct bpf_object * obj) gen_st_ops_shadow() argument 1223 gen_st_ops_shadow_init(struct btf * btf,struct bpf_object * obj) gen_st_ops_shadow_init() argument 1260 struct btf *btf; do_skeleton() local 1673 struct btf *btf; do_subskeleton() local 2031 btf_save_raw(const struct btf * btf,const char * path) btf_save_raw() argument 2199 struct btf *btf = info->src_btf; btfgen_record_field_relo() local 2262 struct btf *btf = info->src_btf; btfgen_mark_type_match() local 2446 struct btf *btf = NULL; btfgen_record_obj() local [all...] |
| /linux/tools/testing/selftests/bpf/ |
| H A D | btf_helpers.h | 9 int fprintf_btf_type_raw(FILE *out, const struct btf *btf, __u32 id); 10 const char *btf_type_raw_dump(const struct btf *btf, int type_id); 11 int btf_validate_raw(struct btf *btf, int nr_types, const char *exp_types[]); 13 #define VALIDATE_RAW_BTF(btf, raw_types...) \ argument 14 btf_validate_raw(btf, \ 18 const char *btf_type_c_dump(const struct btf *btf);
|
| H A D | btf_helpers.c | 5 #include <bpf/btf.h> 84 static const char *btf_str(const struct btf *btf, __u32 off) in btf_str() 88 return btf__str_by_offset(btf, off) ?: "(invalid)"; in fprintf_btf_type_raw() argument 91 int fprintf_btf_type_raw(FILE *out, const struct btf *btf, __u32 id) in fprintf_btf_type_raw() 97 t = btf__type_by_id(btf, id); in fprintf_btf_type_raw() 104 fprintf(out, "[%u] %s '%s'", id, btf_kind_str(kind), btf_str(btf, t->name_off)); in fprintf_btf_type_raw() 141 btf_str(btf, m->name_off), m->type, bit_off); in fprintf_btf_type_raw() 156 btf_str(btf, in fprintf_btf_type_raw() 81 btf_str(const struct btf * btf,__u32 off) btf_str() argument 216 btf_type_raw_dump(const struct btf * btf,int type_id) btf_type_raw_dump() argument 234 btf_validate_raw(struct btf * btf,int nr_types,const char * exp_types[]) btf_validate_raw() argument 257 btf_type_c_dump(const struct btf * btf) btf_type_c_dump() argument [all...] |