Lines Matching refs:type_id

63  * type_id:
65 * Each btf_type object is identified by a type_id. The type_id
67 * the BTF type section. The first one has type_id 1. The second
68 * one has type_id 2...etc. Hence, an earlier btf_type has
69 * a smaller type_id.
72 * type_id (i.e. the "type" in the "struct btf_type").
81 * by specifying type_id:
83 * [1] CONST (anon) type_id=2
84 * [2] PTR (anon) type_id=0
88 * - [?] is the type_id of the btf_type object.
92 * - type_id=XXX is the 'u32 type' in btf_type
94 * NOTE: "void" has type_id 0
123 * Without knowing the location of each type_id, most verifications
185 #define BTF_TYPE_ID_VALID(type_id) ((type_id) <= BTF_MAX_TYPE)
285 u32 type_id;
426 u32 type_id;
457 u32 type_id, void *data, u8 bits_offsets,
465 const struct btf_type *t, u32 type_id);
847 const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id)
849 while (type_id < btf->start_id)
852 type_id -= btf->start_id;
853 if (type_id >= btf->nr_types)
855 return btf->types[type_id];
959 u32 id = show->state.type_id;
983 * Start with type_id, as we have resolved the struct btf_type *
985 * struct, int etc it is defined as. In such cases, the type_id
1311 u32 type_id, void *data)
1314 show->state.type_id = type_id;
1323 show->state.type_id = 0;
1329 u32 type_id, void *data)
1331 void *safe_data = btf_show_start_type(show, t, type_id, data);
1377 u32 type_id,
1383 return btf_show_start_aggr_type(show, t, type_id, data);
1395 u32 type_id,
1398 return btf_show_start_aggr_type(show, t, type_id, data);
1512 "\t%s type_id=%u bitfield_size=%u bits_offset=%u",
1518 __btf_verifier_log(log, "\t%s type_id=%u bits_offset=%u",
1548 __btf_verifier_log(log, "\t type_id=%u offset=%u size=%u",
1834 u32 type_id)
1837 if (type_id < env->btf->start_id)
1840 return env->visit_states[type_id - env->btf->start_id] == RESOLVED;
1844 const struct btf_type *t, u32 type_id)
1852 if (type_id < btf->start_id
1853 || env->visit_states[type_id - btf->start_id] != NOT_VISITED)
1856 env->visit_states[type_id - btf->start_id] = VISITED;
1860 v->type_id = type_id;
1883 u32 type_id = env->stack[--(env->top_stack)].type_id;
1886 type_id -= btf->start_id; /* adjust to local type id */
1887 btf->resolved_sizes[type_id] = resolved_size;
1888 btf->resolved_ids[type_id] = resolved_type_id;
1889 env->visit_states[type_id] = RESOLVED;
1907 * *type_id: id of type if it's changed within the function, 0 if not
1915 * *type_id: id of type if it's changed within the function, 0 if not
1920 u32 *elem_id, u32 *total_nelems, u32 *type_id)
1981 if (type_id && id)
1982 *type_id = id;
1994 static u32 btf_resolved_type_id(const struct btf *btf, u32 type_id)
1996 while (type_id < btf->start_id)
1999 return btf->resolved_ids[type_id - btf->start_id];
2002 /* The input param "type_id" must point to a needs_resolve type */
2004 u32 *type_id)
2006 *type_id = btf_resolved_type_id(btf, *type_id);
2007 return btf_type_by_id(btf, *type_id);
2010 static u32 btf_resolved_type_size(const struct btf *btf, u32 type_id)
2012 while (type_id < btf->start_id)
2015 return btf->resolved_sizes[type_id - btf->start_id];
2019 u32 *type_id, u32 *ret_size)
2022 u32 size_type_id = *type_id;
2054 *type_id = size_type_id;
2111 u32 type_id, void *data, u8 bits_offsets,
2398 u32 type_id, void *data, u8 bits_offset,
2407 safe_data = btf_show_start_type(show, t, type_id, data);
2569 btf_verifier_log_type(env, t, "Invalid type_id");
2610 btf_verifier_log_type(env, v->t, "Invalid type_id");
2632 btf_verifier_log_type(env, v->t, "Invalid type_id");
2652 btf_verifier_log_type(env, v->t, "Invalid type_id");
2679 btf_verifier_log_type(env, v->t, "Invalid type_id");
2698 btf_verifier_log_type(env, v->t, "Invalid type_id");
2735 btf_verifier_log_type(env, v->t, "Invalid type_id");
2747 u32 type_id, void *data,
2751 t = btf_type_id_resolve(btf, &type_id);
2753 t = btf_type_skip_modifiers(btf, type_id, NULL);
2755 btf_type_ops(t)->show(btf, t, type_id, data, bits_offset, show);
2759 u32 type_id, void *data, u8 bits_offset,
2762 t = btf_type_id_resolve(btf, &type_id);
2764 btf_type_ops(t)->show(btf, t, type_id, data, bits_offset, show);
2768 u32 type_id, void *data, u8 bits_offset,
2773 safe_data = btf_show_start_type(show, t, type_id, data);
2788 btf_verifier_log(env, "type_id=%u", t->type);
3002 btf_verifier_log(env, "type_id=%u index_type_id=%u nr_elems=%u",
3007 u32 type_id, void *data, u8 bits_offset,
3035 if (!btf_show_start_array_type(show, t, type_id, encoding, data))
3060 u32 type_id, void *data, u8 bits_offset,
3075 __btf_array_show(btf, t, type_id, data, bits_offset, show);
3089 __btf_array_show(btf, t, type_id, data, bits_offset, show);
3173 "Invalid type_id");
3294 u32 type_id;
3352 info->kptr.type_id = res_id;
3649 t = btf_type_by_id(btf, info->kptr.type_id);
3660 id = info->kptr.type_id;
3977 u32 type_id, void *data, u8 bits_offset,
3984 safe_data = btf_show_start_struct_type(show, t, type_id, data);
4024 u32 type_id, void *data, u8 bits_offset,
4039 __btf_struct_show(btf, t, type_id, data, bits_offset, show);
4054 __btf_struct_show(btf, t, type_id, data, bits_offset, show);
4192 u32 type_id, void *data, u8 bits_offset,
4200 safe_data = btf_show_start_type(show, t, type_id, data);
4295 u32 type_id, void *data, u8 bits_offset,
4303 safe_data = btf_show_start_type(show, t, type_id, data);
4505 btf_verifier_log_type(env, t, "Invalid type_id");
4525 btf_verifier_log(env, "type_id=%u linkage=%u", t->type, var->linkage);
4575 "Invalid type_id");
4619 u32 var_type_id = vsi->type, type_id, type_size = 0;
4634 type_id = var_type->type;
4635 if (!btf_type_id_size(btf, &type_id, &type_size)) {
4657 const struct btf_type *t, u32 type_id,
4665 if (!btf_show_start_type(show, t, type_id, data))
4819 btf_verifier_log_type(env, v->t, "Invalid type_id");
4913 /* Last func arg type_id could be 0 if it is a vararg */
4975 btf_verifier_log_type(env, t, "Invalid type_id");
5084 u32 type_id)
5088 if (!env_type_is_resolved(env, type_id))
5092 return !btf_resolved_type_id(btf, type_id) &&
5093 !btf_resolved_type_size(btf, type_id);
5096 return btf_resolved_type_id(btf, type_id) &&
5097 !btf_resolved_type_size(btf, type_id);
5101 t = btf_type_id_resolve(btf, &type_id);
5117 btf_resolved_type_size(btf, type_id));
5124 const struct btf_type *t, u32 type_id)
5131 env_stack_push(env, t, type_id);
5133 env->log_type_id = v->type_id;
5137 env->log_type_id = type_id;
5147 if (!err && !btf_resolve_valid(env, t, type_id)) {
5160 u32 type_id, i;
5169 type_id = btf->start_id + i;
5170 t = btf_type_by_id(btf, type_id);
5172 env->log_type_id = type_id;
5174 !env_type_is_resolved(env, type_id)) {
5175 err = btf_resolve(env, t, type_id);
7016 btf_id = prog->aux->func_info[0].type_id;
7070 u32 kern_type_id, type_id;
7074 type_id = t->type;
7077 type_id = t->type;
7082 cc = bpf_core_find_cands(&ctx, type_id);
7150 btf_id = prog->aux->func_info[subprog].type_id;
7340 static void btf_type_show(const struct btf *btf, u32 type_id, void *obj,
7343 const struct btf_type *t = btf_type_by_id(btf, type_id);
7349 btf_type_ops(t)->show(btf, t, type_id, obj, 0, show);
7358 int btf_type_seq_show_flags(const struct btf *btf, u32 type_id,
7367 btf_type_show(btf, type_id, obj, &sseq);
7372 void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj,
7375 (void) btf_type_seq_show_flags(btf, type_id, obj, m,
7408 int btf_type_snprintf_show(const struct btf *btf, u32 type_id, void *obj,
7419 btf_type_show(btf, type_id, obj, (struct btf_show *)&ssnprintf);
8707 cc = bpf_core_find_cands(ctx, relo->type_id);
8710 relo->type_id);
8925 bpf_struct_ops_find(struct btf *btf, u32 type_id)
8931 if (!type_id)
8939 if (st_ops_list[i].type_id == type_id)