Lines Matching refs:t

10 	const struct btf_type *t;  in gen_btf()  local
29 t = btf__type_by_id(btf, 1); in gen_btf()
31 ASSERT_EQ(t->name_off, str_off, "int_name_off"); in gen_btf()
32 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "int", "int_name"); in gen_btf()
33 ASSERT_EQ(btf_kind(t), BTF_KIND_INT, "int_kind"); in gen_btf()
34 ASSERT_EQ(t->size, 4, "int_sz"); in gen_btf()
35 ASSERT_EQ(btf_int_encoding(t), BTF_INT_SIGNED, "int_enc"); in gen_btf()
36 ASSERT_EQ(btf_int_bits(t), 32, "int_bits"); in gen_btf()
56 t = btf__type_by_id(btf, 2); in gen_btf()
57 ASSERT_EQ(btf_kind(t), BTF_KIND_PTR, "ptr_kind"); in gen_btf()
58 ASSERT_EQ(t->type, 1, "ptr_type"); in gen_btf()
64 t = btf__type_by_id(btf, 3); in gen_btf()
65 ASSERT_EQ(btf_kind(t), BTF_KIND_CONST, "const_kind"); in gen_btf()
66 ASSERT_EQ(t->type, 5, "const_type"); in gen_btf()
72 t = btf__type_by_id(btf, 4); in gen_btf()
73 ASSERT_EQ(btf_kind(t), BTF_KIND_VOLATILE, "volatile_kind"); in gen_btf()
74 ASSERT_EQ(t->type, 3, "volatile_type"); in gen_btf()
80 t = btf__type_by_id(btf, 5); in gen_btf()
81 ASSERT_EQ(btf_kind(t), BTF_KIND_RESTRICT, "restrict_kind"); in gen_btf()
82 ASSERT_EQ(t->type, 4, "restrict_type"); in gen_btf()
89 t = btf__type_by_id(btf, 6); in gen_btf()
90 ASSERT_EQ(btf_kind(t), BTF_KIND_ARRAY, "array_kind"); in gen_btf()
91 ASSERT_EQ(btf_array(t)->index_type, 1, "array_index_type"); in gen_btf()
92 ASSERT_EQ(btf_array(t)->type, 2, "array_elem_type"); in gen_btf()
93 ASSERT_EQ(btf_array(t)->nelems, 10, "array_nelems"); in gen_btf()
107 t = btf__type_by_id(btf, 7); in gen_btf()
108 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "s1", "struct_name"); in gen_btf()
109 ASSERT_EQ(btf_kind(t), BTF_KIND_STRUCT, "struct_kind"); in gen_btf()
110 ASSERT_EQ(btf_vlen(t), 2, "struct_vlen"); in gen_btf()
111 ASSERT_EQ(btf_kflag(t), true, "struct_kflag"); in gen_btf()
112 ASSERT_EQ(t->size, 8, "struct_sz"); in gen_btf()
113 m = btf_members(t) + 0; in gen_btf()
116 ASSERT_EQ(btf_member_bit_offset(t, 0), 0, "f1_bit_off"); in gen_btf()
117 ASSERT_EQ(btf_member_bitfield_size(t, 0), 0, "f1_bit_sz"); in gen_btf()
118 m = btf_members(t) + 1; in gen_btf()
121 ASSERT_EQ(btf_member_bit_offset(t, 1), 32, "f2_bit_off"); in gen_btf()
122 ASSERT_EQ(btf_member_bitfield_size(t, 1), 16, "f2_bit_sz"); in gen_btf()
139 t = btf__type_by_id(btf, 8); in gen_btf()
140 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "u1", "union_name"); in gen_btf()
141 ASSERT_EQ(btf_kind(t), BTF_KIND_UNION, "union_kind"); in gen_btf()
142 ASSERT_EQ(btf_vlen(t), 1, "union_vlen"); in gen_btf()
143 ASSERT_EQ(btf_kflag(t), true, "union_kflag"); in gen_btf()
144 ASSERT_EQ(t->size, 8, "union_sz"); in gen_btf()
145 m = btf_members(t) + 0; in gen_btf()
148 ASSERT_EQ(btf_member_bit_offset(t, 0), 0, "f1_bit_off"); in gen_btf()
149 ASSERT_EQ(btf_member_bitfield_size(t, 0), 16, "f1_bit_sz"); in gen_btf()
162 t = btf__type_by_id(btf, 9); in gen_btf()
163 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "e1", "enum_name"); in gen_btf()
164 ASSERT_EQ(btf_kind(t), BTF_KIND_ENUM, "enum_kind"); in gen_btf()
165 ASSERT_EQ(btf_vlen(t), 2, "enum_vlen"); in gen_btf()
166 ASSERT_EQ(t->size, 4, "enum_sz"); in gen_btf()
167 v = btf_enum(t) + 0; in gen_btf()
170 v = btf_enum(t) + 1; in gen_btf()
181 t = btf__type_by_id(btf, 10); in gen_btf()
182 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "struct_fwd", "fwd_name"); in gen_btf()
183 ASSERT_EQ(btf_kind(t), BTF_KIND_FWD, "fwd_kind"); in gen_btf()
184 ASSERT_EQ(btf_kflag(t), 0, "fwd_kflag"); in gen_btf()
190 t = btf__type_by_id(btf, 11); in gen_btf()
191 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "union_fwd", "fwd_name"); in gen_btf()
192 ASSERT_EQ(btf_kind(t), BTF_KIND_FWD, "fwd_kind"); in gen_btf()
193 ASSERT_EQ(btf_kflag(t), 1, "fwd_kflag"); in gen_btf()
199 t = btf__type_by_id(btf, 12); in gen_btf()
200 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "enum_fwd", "fwd_name"); in gen_btf()
201 ASSERT_EQ(btf_kind(t), BTF_KIND_ENUM, "enum_fwd_kind"); in gen_btf()
202 ASSERT_EQ(btf_vlen(t), 0, "enum_fwd_kind"); in gen_btf()
203 ASSERT_EQ(t->size, 4, "enum_fwd_sz"); in gen_btf()
210 t = btf__type_by_id(btf, 13); in gen_btf()
211 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "typedef1", "typedef_name"); in gen_btf()
212 ASSERT_EQ(btf_kind(t), BTF_KIND_TYPEDEF, "typedef_kind"); in gen_btf()
213 ASSERT_EQ(t->type, 1, "typedef_type"); in gen_btf()
220 t = btf__type_by_id(btf, 14); in gen_btf()
221 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "func1", "func_name"); in gen_btf()
222 ASSERT_EQ(t->type, 15, "func_type"); in gen_btf()
223 ASSERT_EQ(btf_kind(t), BTF_KIND_FUNC, "func_kind"); in gen_btf()
224 ASSERT_EQ(btf_vlen(t), BTF_FUNC_GLOBAL, "func_vlen"); in gen_btf()
235 t = btf__type_by_id(btf, 15); in gen_btf()
236 ASSERT_EQ(btf_kind(t), BTF_KIND_FUNC_PROTO, "func_proto_kind"); in gen_btf()
237 ASSERT_EQ(btf_vlen(t), 2, "func_proto_vlen"); in gen_btf()
238 ASSERT_EQ(t->type, 1, "func_proto_ret_type"); in gen_btf()
239 p = btf_params(t) + 0; in gen_btf()
242 p = btf_params(t) + 1; in gen_btf()
253 t = btf__type_by_id(btf, 16); in gen_btf()
254 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "var1", "var_name"); in gen_btf()
255 ASSERT_EQ(btf_kind(t), BTF_KIND_VAR, "var_kind"); in gen_btf()
256 ASSERT_EQ(t->type, 1, "var_type"); in gen_btf()
257 ASSERT_EQ(btf_var(t)->linkage, BTF_VAR_GLOBAL_ALLOCATED, "var_type"); in gen_btf()
267 t = btf__type_by_id(btf, 17); in gen_btf()
268 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "datasec1", "datasec_name"); in gen_btf()
269 ASSERT_EQ(t->size, 12, "datasec_sz"); in gen_btf()
270 ASSERT_EQ(btf_kind(t), BTF_KIND_DATASEC, "datasec_kind"); in gen_btf()
271 ASSERT_EQ(btf_vlen(t), 1, "datasec_vlen"); in gen_btf()
272 vi = btf_var_secinfos(t) + 0; in gen_btf()
283 t = btf__type_by_id(btf, 18); in gen_btf()
284 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "tag1", "tag_value"); in gen_btf()
285 ASSERT_EQ(btf_kind(t), BTF_KIND_DECL_TAG, "tag_kind"); in gen_btf()
286 ASSERT_EQ(t->type, 16, "tag_type"); in gen_btf()
287 ASSERT_EQ(btf_decl_tag(t)->component_idx, -1, "tag_component_idx"); in gen_btf()
293 t = btf__type_by_id(btf, 19); in gen_btf()
294 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "tag2", "tag_value"); in gen_btf()
295 ASSERT_EQ(btf_kind(t), BTF_KIND_DECL_TAG, "tag_kind"); in gen_btf()
296 ASSERT_EQ(t->type, 14, "tag_type"); in gen_btf()
297 ASSERT_EQ(btf_decl_tag(t)->component_idx, 1, "tag_component_idx"); in gen_btf()