Lines Matching refs:type
431 const struct btf_type *type; member
618 id = t->type; in btf_type_skip_modifiers()
619 t = btf_type_by_id(btf, t->type); in btf_type_skip_modifiers()
637 return btf_type_skip_modifiers(btf, t->type, res_id); in btf_type_resolve_ptr()
912 id = m->type; in btf_member_is_reg_int()
949 t = btf_type_by_id(btf, t->type); in btf_type_skip_qualifiers()
997 id = m->type; in btf_show_name()
1041 id = t->type; in btf_show_name()
1051 id = array->type; in btf_show_name()
1057 id = t->type; in btf_show_name()
1149 if ((show->flags & BTF_SHOW_COMPACT) && show->state.type && in btf_show_delim()
1150 BTF_INFO_KIND(show->state.type->info) == BTF_KIND_UNION) in btf_show_delim()
1331 show->state.type = t; in btf_show_start_type()
1340 show->state.type = NULL; in btf_show_end_type()
1532 member->type, in btf_verifier_log_member()
1538 member->type, member->offset); in btf_verifier_log_member()
1567 vsi->type, vsi->offset, vsi->size); in btf_verifier_log_vsi()
1952 __btf_resolve_size(const struct btf *btf, const struct btf_type *type, in __btf_resolve_size() argument
1961 switch (BTF_INFO_KIND(type->info)) { in __btf_resolve_size()
1969 size = type->size; in __btf_resolve_size()
1982 id = type->type; in __btf_resolve_size()
1983 type = btf_type_by_id(btf, type->type); in __btf_resolve_size()
1988 array_type = type; in __btf_resolve_size()
1989 array = btf_type_array(type); in __btf_resolve_size()
1993 type = btf_type_by_id(btf, array->type); in __btf_resolve_size()
2012 *elem_type = type; in __btf_resolve_size()
2014 *elem_id = array ? array->type : 0; in __btf_resolve_size()
2018 return array_type ? : type; in __btf_resolve_size()
2022 btf_resolve_size(const struct btf *btf, const struct btf_type *type, in btf_resolve_size() argument
2025 return __btf_resolve_size(btf, type, type_size, NULL, NULL, NULL, NULL); in btf_resolve_size()
2516 u32 resolved_type_id = member->type; in btf_modifier_check_member()
2528 resolved_member.type = resolved_type_id; in btf_modifier_check_member()
2541 u32 resolved_type_id = member->type; in btf_modifier_check_kflag_member()
2553 resolved_member.type = resolved_type_id; in btf_modifier_check_kflag_member()
2602 if (!BTF_TYPE_ID_VALID(t->type)) { in btf_ref_type_check_meta()
2639 u32 next_type_id = t->type; in btf_modifier_resolve()
2681 u32 next_type_id = t->type; in btf_var_resolve()
2727 u32 next_type_id = t->type; in btf_ptr_resolve()
2822 btf_verifier_log(env, "type_id=%u", t->type); in btf_ref_type_log()
2852 if (t->type) { in btf_fwd_check_meta()
2900 array_type_id = member->type; in btf_array_check_member()
2951 if (!array->type || !BTF_TYPE_ID_VALID(array->type)) { in btf_array_check_meta()
2996 elem_type_id = array->type; in btf_array_resolve()
3037 array->type, array->index_type, array->nelems); in btf_array_log()
3050 elem_type_id = array->type; in __btf_array_show()
3205 if (!member->type || !BTF_TYPE_ID_VALID(member->type)) { in btf_struct_check_meta()
3258 last_member_type_id = last_member->type; in btf_struct_resolve()
3278 u32 member_type_id = member->type; in btf_struct_resolve()
3324 enum btf_field_type type; member
3345 info->type = field_type; in btf_find_struct()
3353 enum btf_field_type type; in btf_find_kptr() local
3360 t = btf_type_by_id(btf, t->type); in btf_find_kptr()
3364 t = btf_type_by_id(btf, t->type); in btf_find_kptr()
3369 if (btf_type_is_type_tag(btf_type_by_id(btf, t->type))) in btf_find_kptr()
3373 type = BPF_KPTR_UNREF; in btf_find_kptr()
3375 type = BPF_KPTR_REF; in btf_find_kptr()
3377 type = BPF_KPTR_PERCPU; in btf_find_kptr()
3379 type = BPF_UPTR; in btf_find_kptr()
3383 if (!(type & field_mask)) in btf_find_kptr()
3387 t = btf_type_skip_modifiers(btf, t->type, &res_id); in btf_find_kptr()
3392 info->type = type; in btf_find_kptr()
3409 if (pt != btf_type_by_id(btf, t->type)) in btf_find_next_decl_tag()
3474 info->type = head_type; in btf_find_graph_root()
3483 type = field_type; \
3491 int type = 0; in btf_get_field_type() local
3499 type = BPF_SPIN_LOCK; in btf_get_field_type()
3508 type = BPF_RES_SPIN_LOCK; in btf_get_field_type()
3517 type = BPF_TIMER; in btf_get_field_type()
3526 type = BPF_WORKQUEUE; in btf_get_field_type()
3538 type = BPF_KPTR_REF; in btf_get_field_type()
3543 *sz = btf_field_type_size(type); in btf_get_field_type()
3544 *align = btf_field_type_align(type); in btf_get_field_type()
3545 return type; in btf_get_field_type()
3566 switch (info[i].type) { in btf_repeat_fields()
3659 var_type = btf_type_by_id(btf, array->type); in btf_find_field_one()
3746 member->type); in btf_find_struct_field()
3774 const struct btf_type *var = btf_type_by_id(btf, vsi->type); in btf_find_datasec_var()
3775 const struct btf_type *var_type = btf_type_by_id(btf, var->type); in btf_find_datasec_var()
3837 if (info->type == BPF_KPTR_REF) { in btf_parse_kptr()
3914 n = btf_type_by_id(btf, member->type); in btf_parse_graph_root()
3989 field_type_size = btf_field_type_size(info_arr[i].type); in btf_parse_fields()
4001 rec->field_mask |= info_arr[i].type; in btf_parse_fields()
4003 rec->fields[i].type = info_arr[i].type; in btf_parse_fields()
4006 switch (info_arr[i].type) { in btf_parse_fields()
4108 if (rec->fields[i].type == BPF_UPTR) { in btf_check_and_fixup_fields()
4123 if (!(rec->fields[i].type & BPF_GRAPH_ROOT)) in btf_check_and_fixup_fields()
4191 member->type); in __btf_struct_show()
4205 member->type, in __btf_struct_show()
4214 ops->show(btf, member_type, member->type, in __btf_struct_show()
4572 btf_verifier_log(env, "return=%u args=(", t->type); in btf_func_proto_log()
4578 if (nr_args == 1 && !args[0].type) { in btf_func_proto_log()
4584 btf_verifier_log(env, "%u %s", args[0].type, in btf_func_proto_log()
4588 btf_verifier_log(env, ", %u %s", args[i].type, in btf_func_proto_log()
4595 if (last_arg->type) in btf_func_proto_log()
4596 btf_verifier_log(env, ", %u %s", last_arg->type, in btf_func_proto_log()
4654 u32 next_type_id = t->type; in btf_func_resolve()
4705 if (!t->type || !BTF_TYPE_ID_VALID(t->type)) { in btf_var_check_meta()
4726 btf_verifier_log(env, "type_id=%u linkage=%u", t->type, var->linkage); in btf_var_log()
4774 if (!vsi->type || !BTF_TYPE_ID_VALID(vsi->type)) { in btf_datasec_check_meta()
4820 u32 var_type_id = vsi->type, type_id, type_size = 0; in btf_datasec_resolve()
4835 type_id = var_type->type; in btf_datasec_resolve()
4872 var = btf_type_by_id(btf, vsi->type); in btf_datasec_show()
4875 btf_type_ops(var)->show(btf, var, vsi->type, in btf_datasec_show()
5008 u32 next_type_id = t->type; in btf_decl_tag_resolve()
5034 next_type = btf_type_by_id(btf, next_type->type); in btf_decl_tag_resolve()
5051 btf_verifier_log(env, "type=%u component_idx=%d", t->type, in btf_decl_tag_log()
5078 if (t->type) { in btf_func_proto_check()
5079 u32 ret_type_id = t->type; in btf_func_proto_check()
5110 if (!args[nr_args - 1].type) { in btf_func_proto_check()
5123 arg_type_id = args[i].type; in btf_func_proto_check()
5168 proto_type = btf_type_by_id(btf, t->type); in btf_func_check()
5178 if (!args[i].name_off && args[i].type) { in btf_func_check()
5307 u32 elem_type_id = array->type; in btf_resolve_valid()
5651 struct btf_struct_meta *type; in btf_parse_struct_metas() local
5663 if (btf_id_set_contains(aof, member->type)) in btf_parse_struct_metas()
5679 type = &tab->types[tab->cnt]; in btf_parse_struct_metas()
5680 type->btf_id = i; in btf_parse_struct_metas()
5689 type->record = record; in btf_parse_struct_metas()
5749 cur_id = t->type; in btf_check_type_tags()
5924 return btf_type_by_id(btf_vmlinux, ctx_type->type); in find_canonical_prog_ctx_type()
5940 return ctx_type->type; in find_kern_ctx_type_id()
5959 t = btf_type_by_id(btf, t->type); in btf_is_prog_ctx_type()
5966 t = btf_type_by_id(btf, t->type); in btf_is_prog_ctx_type()
5976 t = btf_type_by_id(btf, t->type); in btf_is_prog_ctx_type()
6023 ctx_type = btf_type_by_id(btf_vmlinux, ctx_type->type); in btf_is_prog_ctx_type()
6050 t = btf_type_by_id(btf, t->type); in btf_validate_prog_ctx_type()
6055 t = btf_type_by_id(btf, t->type); in btf_validate_prog_ctx_type()
6066 t = btf_type_by_id(btf, t->type); in btf_validate_prog_ctx_type()
6152 ctx_type = btf_type_by_id(btf_vmlinux, ctx_type->type); in btf_validate_prog_ctx_type()
6193 kctx_type_id = kctx_member->type; in get_kern_ctx_btf_id()
6407 t = btf_type_skip_modifiers(btf, t->type, NULL); in is_void_or_int_ptr()
6425 t = btf_type_skip_modifiers(btf, args[i].type, NULL); in btf_ctx_arg_idx()
6431 t = btf_type_skip_modifiers(btf, func_proto->type, NULL); in btf_ctx_arg_idx()
6443 switch (prog->type) { in prog_args_trusted()
6465 t = btf_type_by_id(btf, args[i].type); in btf_ctx_arg_offset()
6672 bool btf_ctx_access(int off, int size, enum bpf_access_type type, in btf_ctx_access() argument
6733 t = btf_type_by_id(btf, t->type); in btf_ctx_access()
6742 t = btf_type_skip_modifiers(btf, t->type, NULL); in btf_ctx_access()
6759 t = btf_type_by_id(btf, args[arg].type); in btf_ctx_access()
6764 t = btf_type_by_id(btf, t->type); in btf_ctx_access()
6786 u32 type, flag; in btf_ctx_access() local
6788 type = base_type(ctx_arg_info->reg_type); in btf_ctx_access()
6790 if (ctx_arg_info->offset == off && type == PTR_TO_BUF && in btf_ctx_access()
6865 if (tgt_prog->type == BPF_PROG_TYPE_EXT) in btf_ctx_access()
6868 tgt_type = tgt_prog->type; in btf_ctx_access()
6881 info->btf_id = t->type; in btf_ctx_access()
6882 t = btf_type_by_id(btf, t->type); in btf_ctx_access()
6894 info->btf_id = t->type; in btf_ctx_access()
6895 t = btf_type_by_id(btf, t->type); in btf_ctx_access()
6940 t = btf_type_skip_modifiers(btf, t->type, NULL); in btf_struct_walk()
6966 mtype = btf_type_skip_modifiers(btf, member->type, in btf_struct_walk()
6980 t = btf_type_skip_modifiers(btf, array_elem->type, in btf_struct_walk()
7041 mid = member->type; in btf_struct_walk()
7042 mtype = btf_type_by_id(btf, member->type); in btf_struct_walk()
7143 t = btf_type_by_id(btf, mtype->type); in btf_struct_walk()
7157 stype = btf_type_skip_modifiers(btf, mtype->type, &id); in btf_struct_walk()
7200 while (type_is_alloc(reg->type)) { in btf_struct_access()
7215 btf_field_type_name(field->type)); in btf_struct_access()
7231 if (type_is_alloc(reg->type)) in btf_struct_access()
7285 const struct btf_type *type; in btf_struct_ids_match() local
7299 type = btf_type_by_id(btf, id); in btf_struct_ids_match()
7300 if (!type) in btf_struct_ids_match()
7302 err = btf_struct_walk(log, btf, type, off, 1, &id, &flag, NULL); in btf_struct_ids_match()
7330 t = btf_type_by_id(btf, t->type); in __get_type_size()
7386 ret = __get_type_size(btf, func->type, &t); in btf_distill_func_proto()
7397 if (i == nargs - 1 && args[i].type == 0) { in btf_distill_func_proto()
7403 ret = __get_type_size(btf, args[i].type, &t); in btf_distill_func_proto()
7453 t1 = btf_type_by_id(btf1, t1->type); in btf_check_func_type_match()
7456 t2 = btf_type_by_id(btf2, t2->type); in btf_check_func_type_match()
7471 t1 = btf_type_skip_modifiers(btf1, t1->type, NULL); in btf_check_func_type_match()
7472 t2 = btf_type_skip_modifiers(btf2, t2->type, NULL); in btf_check_func_type_match()
7482 t1 = btf_type_skip_modifiers(btf1, args1[i].type, NULL); in btf_check_func_type_match()
7483 t2 = btf_type_skip_modifiers(btf2, args2[i].type, NULL); in btf_check_func_type_match()
7511 t1 = btf_type_skip_modifiers(btf1, t1->type, NULL); in btf_check_func_type_match()
7512 t2 = btf_type_skip_modifiers(btf2, t2->type, NULL); in btf_check_func_type_match()
7571 t = btf_type_by_id(btf, t->type); /* skip PTR */ in btf_is_dynptr_ptr()
7574 t = btf_type_by_id(btf, t->type); in btf_is_dynptr_ptr()
7614 type_id = t->type; in btf_get_ptr_to_btf_id()
7615 t = btf_type_by_id(btf, t->type); in btf_get_ptr_to_btf_id()
7617 type_id = t->type; in btf_get_ptr_to_btf_id()
7618 t = btf_type_by_id(btf, t->type); in btf_get_ptr_to_btf_id()
7676 enum bpf_prog_type prog_type = prog->type; in btf_prepare_func_args()
7715 prog_type = prog->aux->dst_prog->type; in btf_prepare_func_args()
7717 t = btf_type_by_id(btf, fn_t->type); in btf_prepare_func_args()
7732 t = btf_type_by_id(btf, t->type); in btf_prepare_func_args()
7734 t = btf_type_by_id(btf, t->type); in btf_prepare_func_args()
7785 t = btf_type_by_id(btf, args[i].type); in btf_prepare_func_args()
7787 t = btf_type_by_id(btf, t->type); in btf_prepare_func_args()
7838 ref_t = btf_type_skip_modifiers(btf, t->type, NULL); in btf_prepare_func_args()
7877 t = btf_type_skip_modifiers(btf, t->type, NULL); in btf_prepare_func_args()
8413 #define BTF_TRACING_TYPE(name, type) BTF_ID(struct, type) in BTF_ID_LIST_GLOBAL() argument
8432 t = btf_type_skip_modifiers(btf, arg->type, NULL); in BTF_ID_LIST_GLOBAL()
8435 t = btf_type_skip_modifiers(btf, t->type, &btf_id); in BTF_ID_LIST_GLOBAL()
8497 t = btf_type_skip_modifiers(btf, func->type, NULL); in btf_check_iter_kfuncs()
8504 t = btf_type_by_id(btf, func->type); in btf_check_iter_kfuncs()
8528 func = btf_type_by_id(btf, func->type); in btf_check_kfunc_protos()
8840 dtor_func_proto = btf_type_by_id(btf, dtor_func->type); in btf_check_dtor_kfuncs()
8845 t = btf_type_by_id(btf, dtor_func_proto->type); in btf_check_dtor_kfuncs()
8853 t = btf_type_by_id(btf, args[0].type); in btf_check_dtor_kfuncs()
9283 const struct btf_type *type; in bpf_core_apply() local
9293 type = btf_type_by_id(ctx->btf, relo->type_id); in bpf_core_apply()
9294 if (!type) { in bpf_core_apply()
9386 const struct btf_type *mtype = btf_type_by_id(btf, member->type); in btf_nested_type_is_trusted()
9392 btf_type_skip_modifiers(btf, mtype->type, &id); in btf_nested_type_is_trusted()