Lines Matching defs:type_id

62  * type_id:
64 * Each btf_type object is identified by a type_id. The type_id
66 * the BTF type section. The first one has type_id 1. The second
67 * one has type_id 2...etc. Hence, an earlier btf_type has
68 * a smaller type_id.
71 * type_id (i.e. the "type" in the "struct btf_type").
80 * by specifying type_id:
82 * [1] CONST (anon) type_id=2
83 * [2] PTR (anon) type_id=0
87 * - [?] is the type_id of the btf_type object.
91 * - type_id=XXX is the 'u32 type' in btf_type
93 * NOTE: "void" has type_id 0
122 * Without knowing the location of each type_id, most verifications
184 #define BTF_TYPE_ID_VALID(type_id) ((type_id) <= BTF_MAX_TYPE)
277 u32 type_id;
418 u32 type_id;
449 u32 type_id, void *data, u8 bits_offsets,
457 const struct btf_type *t, u32 type_id);
825 const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id)
827 while (type_id < btf->start_id)
830 type_id -= btf->start_id;
831 if (type_id >= btf->nr_types)
833 return btf->types[type_id];
937 u32 id = show->state.type_id;
961 * Start with type_id, as we have resolved the struct btf_type *
963 * struct, int etc it is defined as. In such cases, the type_id
1289 u32 type_id, void *data)
1292 show->state.type_id = type_id;
1301 show->state.type_id = 0;
1307 u32 type_id, void *data)
1309 void *safe_data = btf_show_start_type(show, t, type_id, data);
1355 u32 type_id,
1361 return btf_show_start_aggr_type(show, t, type_id, data);
1373 u32 type_id,
1376 return btf_show_start_aggr_type(show, t, type_id, data);
1490 "\t%s type_id=%u bitfield_size=%u bits_offset=%u",
1496 __btf_verifier_log(log, "\t%s type_id=%u bits_offset=%u",
1526 __btf_verifier_log(log, "\t type_id=%u offset=%u size=%u",
1791 u32 type_id)
1794 if (type_id < env->btf->start_id)
1797 return env->visit_states[type_id - env->btf->start_id] == RESOLVED;
1801 const struct btf_type *t, u32 type_id)
1809 if (type_id < btf->start_id
1810 || env->visit_states[type_id - btf->start_id] != NOT_VISITED)
1813 env->visit_states[type_id - btf->start_id] = VISITED;
1817 v->type_id = type_id;
1840 u32 type_id = env->stack[--(env->top_stack)].type_id;
1843 type_id -= btf->start_id; /* adjust to local type id */
1844 btf->resolved_sizes[type_id] = resolved_size;
1845 btf->resolved_ids[type_id] = resolved_type_id;
1846 env->visit_states[type_id] = RESOLVED;
1864 * *type_id: id of type if it's changed within the function, 0 if not
1872 * *type_id: id of type if it's changed within the function, 0 if not
1877 u32 *elem_id, u32 *total_nelems, u32 *type_id)
1938 if (type_id && id)
1939 *type_id = id;
1951 static u32 btf_resolved_type_id(const struct btf *btf, u32 type_id)
1953 while (type_id < btf->start_id)
1956 return btf->resolved_ids[type_id - btf->start_id];
1959 /* The input param "type_id" must point to a needs_resolve type */
1961 u32 *type_id)
1963 *type_id = btf_resolved_type_id(btf, *type_id);
1964 return btf_type_by_id(btf, *type_id);
1967 static u32 btf_resolved_type_size(const struct btf *btf, u32 type_id)
1969 while (type_id < btf->start_id)
1972 return btf->resolved_sizes[type_id - btf->start_id];
1976 u32 *type_id, u32 *ret_size)
1979 u32 size_type_id = *type_id;
2011 *type_id = size_type_id;
2068 u32 type_id, void *data, u8 bits_offsets,
2355 u32 type_id, void *data, u8 bits_offset,
2364 safe_data = btf_show_start_type(show, t, type_id, data);
2526 btf_verifier_log_type(env, t, "Invalid type_id");
2567 btf_verifier_log_type(env, v->t, "Invalid type_id");
2589 btf_verifier_log_type(env, v->t, "Invalid type_id");
2609 btf_verifier_log_type(env, v->t, "Invalid type_id");
2636 btf_verifier_log_type(env, v->t, "Invalid type_id");
2655 btf_verifier_log_type(env, v->t, "Invalid type_id");
2692 btf_verifier_log_type(env, v->t, "Invalid type_id");
2704 u32 type_id, void *data,
2708 t = btf_type_id_resolve(btf, &type_id);
2710 t = btf_type_skip_modifiers(btf, type_id, NULL);
2712 btf_type_ops(t)->show(btf, t, type_id, data, bits_offset, show);
2716 u32 type_id, void *data, u8 bits_offset,
2719 t = btf_type_id_resolve(btf, &type_id);
2721 btf_type_ops(t)->show(btf, t, type_id, data, bits_offset, show);
2725 u32 type_id, void *data, u8 bits_offset,
2730 safe_data = btf_show_start_type(show, t, type_id, data);
2745 btf_verifier_log(env, "type_id=%u", t->type);
2959 btf_verifier_log(env, "type_id=%u index_type_id=%u nr_elems=%u",
2964 u32 type_id, void *data, u8 bits_offset,
2992 if (!btf_show_start_array_type(show, t, type_id, encoding, data))
3017 u32 type_id, void *data, u8 bits_offset,
3032 __btf_array_show(btf, t, type_id, data, bits_offset, show);
3046 __btf_array_show(btf, t, type_id, data, bits_offset, show);
3130 "Invalid type_id");
3251 u32 type_id;
3307 info->kptr.type_id = res_id;
3579 t = btf_type_by_id(btf, info->kptr.type_id);
3590 id = info->kptr.type_id;
3909 u32 type_id, void *data, u8 bits_offset,
3916 safe_data = btf_show_start_struct_type(show, t, type_id, data);
3956 u32 type_id, void *data, u8 bits_offset,
3971 __btf_struct_show(btf, t, type_id, data, bits_offset, show);
3986 __btf_struct_show(btf, t, type_id, data, bits_offset, show);
4124 u32 type_id, void *data, u8 bits_offset,
4132 safe_data = btf_show_start_type(show, t, type_id, data);
4227 u32 type_id, void *data, u8 bits_offset,
4235 safe_data = btf_show_start_type(show, t, type_id, data);
4437 btf_verifier_log_type(env, t, "Invalid type_id");
4457 btf_verifier_log(env, "type_id=%u linkage=%u", t->type, var->linkage);
4507 "Invalid type_id");
4551 u32 var_type_id = vsi->type, type_id, type_size = 0;
4566 type_id = var_type->type;
4567 if (!btf_type_id_size(btf, &type_id, &type_size)) {
4589 const struct btf_type *t, u32 type_id,
4597 if (!btf_show_start_type(show, t, type_id, data))
4751 btf_verifier_log_type(env, v->t, "Invalid type_id");
4845 /* Last func arg type_id could be 0 if it is a vararg */
4907 btf_verifier_log_type(env, t, "Invalid type_id");
5016 u32 type_id)
5020 if (!env_type_is_resolved(env, type_id))
5024 return !btf_resolved_type_id(btf, type_id) &&
5025 !btf_resolved_type_size(btf, type_id);
5028 return btf_resolved_type_id(btf, type_id) &&
5029 !btf_resolved_type_size(btf, type_id);
5033 t = btf_type_id_resolve(btf, &type_id);
5049 btf_resolved_type_size(btf, type_id));
5056 const struct btf_type *t, u32 type_id)
5063 env_stack_push(env, t, type_id);
5065 env->log_type_id = v->type_id;
5069 env->log_type_id = type_id;
5079 if (!err && !btf_resolve_valid(env, t, type_id)) {
5092 u32 type_id, i;
5101 type_id = btf->start_id + i;
5102 t = btf_type_by_id(btf, type_id);
5104 env->log_type_id = type_id;
5106 !env_type_is_resolved(env, type_id)) {
5107 err = btf_resolve(env, t, type_id);
6750 btf_id = prog->aux->func_info[0].type_id;
6882 btf_id = prog->aux->func_info[subprog].type_id;
6925 btf_id = prog->aux->func_info[subprog].type_id;
6969 btf_id = prog->aux->func_info[subprog].type_id;
7061 static void btf_type_show(const struct btf *btf, u32 type_id, void *obj,
7064 const struct btf_type *t = btf_type_by_id(btf, type_id);
7070 btf_type_ops(t)->show(btf, t, type_id, obj, 0, show);
7079 int btf_type_seq_show_flags(const struct btf *btf, u32 type_id,
7088 btf_type_show(btf, type_id, obj, &sseq);
7093 void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj,
7096 (void) btf_type_seq_show_flags(btf, type_id, obj, m,
7129 int btf_type_snprintf_show(const struct btf *btf, u32 type_id, void *obj,
7140 btf_type_show(btf, type_id, obj, (struct btf_show *)&ssnprintf);
8438 cc = bpf_core_find_cands(ctx, relo->type_id);
8441 relo->type_id);