Lines Matching refs:t

9 	const struct btf_type *t;  in test_btf_write()  local
33 t = btf__type_by_id(btf, 1); in test_btf_write()
35 ASSERT_EQ(t->name_off, str_off, "int_name_off"); in test_btf_write()
36 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "int", "int_name"); in test_btf_write()
37 ASSERT_EQ(btf_kind(t), BTF_KIND_INT, "int_kind"); in test_btf_write()
38 ASSERT_EQ(t->size, 4, "int_sz"); in test_btf_write()
39 ASSERT_EQ(btf_int_encoding(t), BTF_INT_SIGNED, "int_enc"); in test_btf_write()
40 ASSERT_EQ(btf_int_bits(t), 32, "int_bits"); in test_btf_write()
60 t = btf__type_by_id(btf, 2); in test_btf_write()
61 ASSERT_EQ(btf_kind(t), BTF_KIND_PTR, "ptr_kind"); in test_btf_write()
62 ASSERT_EQ(t->type, 1, "ptr_type"); in test_btf_write()
68 t = btf__type_by_id(btf, 3); in test_btf_write()
69 ASSERT_EQ(btf_kind(t), BTF_KIND_CONST, "const_kind"); in test_btf_write()
70 ASSERT_EQ(t->type, 5, "const_type"); in test_btf_write()
76 t = btf__type_by_id(btf, 4); in test_btf_write()
77 ASSERT_EQ(btf_kind(t), BTF_KIND_VOLATILE, "volatile_kind"); in test_btf_write()
78 ASSERT_EQ(t->type, 3, "volatile_type"); in test_btf_write()
84 t = btf__type_by_id(btf, 5); in test_btf_write()
85 ASSERT_EQ(btf_kind(t), BTF_KIND_RESTRICT, "restrict_kind"); in test_btf_write()
86 ASSERT_EQ(t->type, 4, "restrict_type"); in test_btf_write()
93 t = btf__type_by_id(btf, 6); in test_btf_write()
94 ASSERT_EQ(btf_kind(t), BTF_KIND_ARRAY, "array_kind"); in test_btf_write()
95 ASSERT_EQ(btf_array(t)->index_type, 1, "array_index_type"); in test_btf_write()
96 ASSERT_EQ(btf_array(t)->type, 2, "array_elem_type"); in test_btf_write()
97 ASSERT_EQ(btf_array(t)->nelems, 10, "array_nelems"); in test_btf_write()
111 t = btf__type_by_id(btf, 7); in test_btf_write()
112 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "s1", "struct_name"); in test_btf_write()
113 ASSERT_EQ(btf_kind(t), BTF_KIND_STRUCT, "struct_kind"); in test_btf_write()
114 ASSERT_EQ(btf_vlen(t), 2, "struct_vlen"); in test_btf_write()
115 ASSERT_EQ(btf_kflag(t), true, "struct_kflag"); in test_btf_write()
116 ASSERT_EQ(t->size, 8, "struct_sz"); in test_btf_write()
117 m = btf_members(t) + 0; in test_btf_write()
120 ASSERT_EQ(btf_member_bit_offset(t, 0), 0, "f1_bit_off"); in test_btf_write()
121 ASSERT_EQ(btf_member_bitfield_size(t, 0), 0, "f1_bit_sz"); in test_btf_write()
122 m = btf_members(t) + 1; in test_btf_write()
125 ASSERT_EQ(btf_member_bit_offset(t, 1), 32, "f2_bit_off"); in test_btf_write()
126 ASSERT_EQ(btf_member_bitfield_size(t, 1), 16, "f2_bit_sz"); in test_btf_write()
143 t = btf__type_by_id(btf, 8); in test_btf_write()
144 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "u1", "union_name"); in test_btf_write()
145 ASSERT_EQ(btf_kind(t), BTF_KIND_UNION, "union_kind"); in test_btf_write()
146 ASSERT_EQ(btf_vlen(t), 1, "union_vlen"); in test_btf_write()
147 ASSERT_EQ(btf_kflag(t), true, "union_kflag"); in test_btf_write()
148 ASSERT_EQ(t->size, 8, "union_sz"); in test_btf_write()
149 m = btf_members(t) + 0; in test_btf_write()
152 ASSERT_EQ(btf_member_bit_offset(t, 0), 0, "f1_bit_off"); in test_btf_write()
153 ASSERT_EQ(btf_member_bitfield_size(t, 0), 16, "f1_bit_sz"); in test_btf_write()
166 t = btf__type_by_id(btf, 9); in test_btf_write()
167 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "e1", "enum_name"); in test_btf_write()
168 ASSERT_EQ(btf_kind(t), BTF_KIND_ENUM, "enum_kind"); in test_btf_write()
169 ASSERT_EQ(btf_vlen(t), 2, "enum_vlen"); in test_btf_write()
170 ASSERT_EQ(t->size, 4, "enum_sz"); in test_btf_write()
171 v = btf_enum(t) + 0; in test_btf_write()
174 v = btf_enum(t) + 1; in test_btf_write()
185 t = btf__type_by_id(btf, 10); in test_btf_write()
186 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "struct_fwd", "fwd_name"); in test_btf_write()
187 ASSERT_EQ(btf_kind(t), BTF_KIND_FWD, "fwd_kind"); in test_btf_write()
188 ASSERT_EQ(btf_kflag(t), 0, "fwd_kflag"); in test_btf_write()
194 t = btf__type_by_id(btf, 11); in test_btf_write()
195 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "union_fwd", "fwd_name"); in test_btf_write()
196 ASSERT_EQ(btf_kind(t), BTF_KIND_FWD, "fwd_kind"); in test_btf_write()
197 ASSERT_EQ(btf_kflag(t), 1, "fwd_kflag"); in test_btf_write()
203 t = btf__type_by_id(btf, 12); in test_btf_write()
204 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "enum_fwd", "fwd_name"); in test_btf_write()
205 ASSERT_EQ(btf_kind(t), BTF_KIND_ENUM, "enum_fwd_kind"); in test_btf_write()
206 ASSERT_EQ(btf_vlen(t), 0, "enum_fwd_kind"); in test_btf_write()
207 ASSERT_EQ(t->size, 4, "enum_fwd_sz"); in test_btf_write()
214 t = btf__type_by_id(btf, 13); in test_btf_write()
215 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "typedef1", "typedef_name"); in test_btf_write()
216 ASSERT_EQ(btf_kind(t), BTF_KIND_TYPEDEF, "typedef_kind"); in test_btf_write()
217 ASSERT_EQ(t->type, 1, "typedef_type"); in test_btf_write()
224 t = btf__type_by_id(btf, 14); in test_btf_write()
225 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "func1", "func_name"); in test_btf_write()
226 ASSERT_EQ(t->type, 15, "func_type"); in test_btf_write()
227 ASSERT_EQ(btf_kind(t), BTF_KIND_FUNC, "func_kind"); in test_btf_write()
228 ASSERT_EQ(btf_vlen(t), BTF_FUNC_GLOBAL, "func_vlen"); in test_btf_write()
239 t = btf__type_by_id(btf, 15); in test_btf_write()
240 ASSERT_EQ(btf_kind(t), BTF_KIND_FUNC_PROTO, "func_proto_kind"); in test_btf_write()
241 ASSERT_EQ(btf_vlen(t), 2, "func_proto_vlen"); in test_btf_write()
242 ASSERT_EQ(t->type, 1, "func_proto_ret_type"); in test_btf_write()
243 p = btf_params(t) + 0; in test_btf_write()
246 p = btf_params(t) + 1; in test_btf_write()
257 t = btf__type_by_id(btf, 16); in test_btf_write()
258 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "var1", "var_name"); in test_btf_write()
259 ASSERT_EQ(btf_kind(t), BTF_KIND_VAR, "var_kind"); in test_btf_write()
260 ASSERT_EQ(t->type, 1, "var_type"); in test_btf_write()
261 ASSERT_EQ(btf_var(t)->linkage, BTF_VAR_GLOBAL_ALLOCATED, "var_type"); in test_btf_write()
271 t = btf__type_by_id(btf, 17); in test_btf_write()
272 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "datasec1", "datasec_name"); in test_btf_write()
273 ASSERT_EQ(t->size, 12, "datasec_sz"); in test_btf_write()
274 ASSERT_EQ(btf_kind(t), BTF_KIND_DATASEC, "datasec_kind"); in test_btf_write()
275 ASSERT_EQ(btf_vlen(t), 1, "datasec_vlen"); in test_btf_write()
276 vi = btf_var_secinfos(t) + 0; in test_btf_write()