Lines Matching defs:t

25 static const char PREFIXES[] = "\t\t\t\t\t\t\t\t\t\t\t\t\t";
269 * for another type, they won't be emitted again. This API allows callers to
312 * top-level anonymous enum won't be referenced by anything, while embedded
318 const struct btf_type *t;
322 t = btf__type_by_id(d->btf, i);
323 vlen = btf_vlen(t);
325 switch (btf_kind(t)) {
342 d->type_states[t->type].referenced = 1;
346 const struct btf_array *a = btf_array(t);
354 const struct btf_member *m = btf_members(t);
361 const struct btf_param *p = btf_params(t);
368 const struct btf_var_secinfo *v = btf_var_secinfos(t);
464 * result won't change.
480 * Int/void don't need definitions, they are assumed to be always
487 const struct btf_type *t;
495 t = btf__type_by_id(d->btf, id);
499 if (btf_is_composite(t) && through_ptr && t->name_off != 0)
505 switch (btf_kind(t)) {
512 err = btf_dump_order_type(d, t->type, true);
517 return btf_dump_order_type(d, btf_array(t)->type, false);
521 const struct btf_member *m = btf_members(t);
527 if (through_ptr && t->name_off != 0)
532 vlen = btf_vlen(t);
539 if (t->name_off != 0) {
554 * applied to FWDs, it won't hurt anyways.
556 if (t->name_off != 0 || !tstate->referenced) {
567 is_strong = btf_dump_order_type(d, t->type, through_ptr);
571 /* typedef is similar to struct/union w.r.t. fwd-decls */
587 return btf_dump_order_type(d, t->type, through_ptr);
590 const struct btf_param *p = btf_params(t);
593 err = btf_dump_order_type(d, t->type, through_ptr);
598 vlen = btf_vlen(t);
621 const struct btf_type *t);
624 const struct btf_type *t);
626 const struct btf_type *t, int lvl);
629 const struct btf_type *t);
631 const struct btf_type *t, int lvl);
634 const struct btf_type *t);
637 const struct btf_type *t, int lvl);
658 const struct btf_type *t = btf__type_by_id(d->btf, id);
666 if (t->name_off == 0)
668 return strcmp(btf_name_of(d, t->name_off), "__builtin_va_list") == 0;
686 * that doesn't comply to C rules completely), algorithm will try to proceed
693 const struct btf_type *t;
699 t = btf__type_by_id(d->btf, id);
700 kind = btf_kind(t);
715 if (t->name_off == 0) {
720 btf_dump_emit_struct_fwd(d, id, t);
731 btf_dump_emit_typedef_def(d, id, t, 0);
746 btf_dump_emit_missing_aliases(d, id, t);
753 btf_dump_emit_enum_def(d, id, t, 0);
763 btf_dump_emit_type(d, t->type, cont_id);
766 btf_dump_emit_type(d, btf_array(t)->type, cont_id);
769 btf_dump_emit_fwd_def(d, id, t);
775 btf_dump_emit_type(d, t->type, id);
784 btf_dump_emit_typedef_def(d, id, t, 0);
799 if (top_level_def || t->name_off == 0) {
800 const struct btf_member *m = btf_members(t);
801 __u16 vlen = btf_vlen(t);
804 new_cont_id = t->name_off == 0 ? cont_id : id;
808 btf_dump_emit_struct_fwd(d, id, t);
814 btf_dump_emit_struct_def(d, id, t, 0);
822 const struct btf_param *p = btf_params(t);
823 __u16 n = btf_vlen(t);
826 btf_dump_emit_type(d, t->type, cont_id);
838 const struct btf_type *t)
844 m = btf_members(t);
845 vlen = btf_vlen(t);
849 bit_sz = btf_member_bitfield_size(t, i);
855 if (t->size % max_align != 0)
891 * X;` explicit padding doesn't actually change struct's
895 * this fact heavily and don't worry about ruining correct
911 * alignment (so compiler won't naturally align to the
939 /* For the remainder padding that doesn't cover entire
959 const struct btf_type *t)
962 btf_is_struct(t) ? "struct" : "union",
963 t->name_off ? " " : "",
969 const struct btf_type *t,
972 const struct btf_member *m = btf_members(t);
973 bool is_struct = btf_is_struct(t);
976 __u16 vlen = btf_vlen(t);
979 packed = is_struct ? btf_is_struct_packed(d->btf, id, t) : 0;
983 t->name_off ? " " : "",
992 m_sz = btf_member_bitfield_size(t, i);
993 m_off = btf_member_bit_offset(t, i);
1017 btf_dump_emit_bit_padding(d, off, t->size * 8, align, false, lvl + 1);
1023 if (vlen || t->size) {
1045 const struct btf_type *t)
1060 const struct btf_type *t)
1066 const struct btf_type *t,
1069 const struct btf_enum *v = btf_enum(t);
1070 bool is_signed = btf_kflag(t);
1091 const struct btf_type *t,
1094 const struct btf_enum64 *v = btf_enum64(t);
1095 bool is_signed = btf_kflag(t);
1122 const struct btf_type *t,
1125 __u16 vlen = btf_vlen(t);
1128 t->name_off ? " " : "",
1135 if (btf_is_enum(t))
1136 btf_dump_emit_enum32_val(d, t, lvl, vlen);
1138 btf_dump_emit_enum64_val(d, t, lvl, vlen);
1142 if (t->size == 1) {
1145 } else if (t->size == 8 && d->ptr_sz == 8) {
1147 * doesn't fit in 32-bit integer, or by adding mode(word)
1154 if (btf_is_enum(t)) {
1155 /* enum can't represent 64-bit values, so we need word mode */
1160 * fit in 32-bit integers and won't cause compiler to
1167 if (btf_enum64(t)[i].val_hi32 != 0) {
1180 const struct btf_type *t)
1184 if (btf_kflag(t))
1191 const struct btf_type *t, int lvl)
1201 if (t->type == 0 && strcmp(name, "__gnuc_va_list") == 0) {
1207 btf_dump_emit_type_decl(d, t->type, name, lvl);
1243 * It won't help with BTF to C conversion much, though, as it's an opposite
1295 const struct btf_type *t;
1300 t = btf__type_by_id(d->btf, id);
1301 if (d->strip_mods && btf_is_mod(t))
1307 * if we don't have enough memory for entire type decl
1320 switch (btf_kind(t)) {
1327 id = t->type;
1330 id = btf_array(t)->type;
1343 btf_kind(t), id);
1364 * decl_stack, so it doesn't actually pop anything from the
1374 const struct btf_type *t;
1379 t = btf__type_by_id(d->btf, id);
1381 switch (btf_kind(t)) {
1400 const struct btf_type *t;
1405 t = btf__type_by_id(d->btf, id);
1406 if (!btf_is_mod(t))
1431 * don't want to prepend space for that last pointer.
1434 const struct btf_type *t;
1449 t = btf__type_by_id(d->btf, id);
1450 kind = btf_kind(t);
1456 name = btf_name_of(d, t->name_off);
1463 if (t->name_off == 0 && !d->skip_anon_defs)
1464 btf_dump_emit_struct_def(d, id, t, lvl);
1466 btf_dump_emit_struct_fwd(d, id, t);
1472 if (t->name_off == 0 && !d->skip_anon_defs)
1473 btf_dump_emit_enum_def(d, id, t, lvl);
1475 btf_dump_emit_enum_fwd(d, id, t);
1479 btf_dump_emit_fwd_def(d, id, t);
1499 name = btf_name_of(d, t->name_off);
1500 if (btf_kflag(t))
1506 const struct btf_array *a = btf_array(t);
1515 * const/volatile modifiers. Clang doesn't do that.
1516 * In general, it doesn't seem very meaningful to have
1544 const struct btf_param *p = btf_params(t);
1545 __u16 vlen = btf_vlen(t);
1551 * doesn't do it. It's a GCC quirk for backwards
1611 const struct btf_type *t;
1613 /* for array members, we don't bother emitting type name for each
1623 t = btf__type_by_id(d->btf, id);
1624 if (btf_is_var(t) || btf_is_datasec(t))
1668 const struct btf_type *t = btf__type_by_id(d->btf, id);
1669 const char *orig_name = btf_name_of(d, t->name_off);
1673 if (t->name_off == 0)
1679 if (btf_is_fwd(t) || (btf_is_enum(t) && btf_vlen(t) == 0)) {
1709 const struct btf_type *t,
1748 const struct btf_type *t,
1751 btf_dump_printf(d, "<unsupported kind:%u>", btf_kind(t));
1756 const struct btf_type *t,
1769 if (t->size > 8) {
1770 pr_warn("unexpected bitfield size %d\n", t->size);
1778 for (i = t->size - 1; i >= 0; i--)
1782 for (i = 0; i < t->size; i++)
1784 nr_copy_bits = t->size * 8 - bits_offset;
1797 const struct btf_type *t,
1805 err = btf_dump_get_bitfield_value(d, t, data, bits_offset, bit_sz, &check_num);
1814 const struct btf_type *t,
1822 err = btf_dump_get_bitfield_value(d, t, data, bits_offset, bit_sz, &print_num);
1833 const struct btf_type *t,
1843 if (btf_kind(t) == BTF_KIND_PTR)
1846 nr_bytes = t->size;
1870 const struct btf_type *t,
1875 __u8 encoding = btf_int_encoding(t);
1878 int sz = t->size;
1969 const struct btf_type *t,
1975 int sz = t->size;
2006 const struct btf_type *t;
2028 t = btf__type_by_id(d->btf, type_id);
2031 return btf_dump_dump_type_data(d, NULL, t, type_id, data, 0, 0);
2035 const struct btf_type *t,
2039 const struct btf_array *array = btf_array(t);
2081 const struct btf_type *t,
2085 const struct btf_array *array = btf_array(t);
2109 btf_dump_string_data(d, t, id, data) == 0) {
2148 const struct btf_type *t,
2152 const struct btf_member *m = btf_members(t);
2153 __u16 n = btf_vlen(t);
2174 moffset = btf_member_bit_offset(t, i);
2176 bit_sz = btf_member_bitfield_size(t, i);
2194 const struct btf_type *t,
2213 const struct btf_type *t,
2218 bool is_signed = btf_kflag(t);
2224 err = btf_dump_get_bitfield_value(d, t, data, 0, 0, &val);
2231 switch (t->size) {
2245 pr_warn("unexpected size %d for enum, id:[%u]\n", t->size, id);
2251 const struct btf_type *t,
2259 err = btf_dump_get_enum_value(d, t, data, id, &value);
2263 is_signed = btf_kflag(t);
2264 if (btf_is_enum(t)) {
2267 for (i = 0, e = btf_enum(t); i < btf_vlen(t); i++, e++) {
2278 for (i = 0, e = btf_enum64(t); i < btf_vlen(t); i++, e++) {
2292 const struct btf_type *t,
2301 btf_dump_type_values(d, "SEC(\"%s\") ", btf_name_of(d, t->name_off));
2303 for (i = 0, vsi = btf_var_secinfos(t); i < btf_vlen(t); i++, vsi++) {
2315 const struct btf_type *t,
2351 t = skip_mods_and_typedefs(d->btf, id, NULL);
2352 if (!t) {
2358 switch (btf_kind(t)) {
2374 const struct btf_type *t,
2387 * not a char array; we don't want to be in a situation where we
2399 t = skip_mods_and_typedefs(d->btf, id, NULL);
2401 switch (btf_kind(t)) {
2404 return btf_dump_bitfield_check_zero(d, t, data, bits_offset, bit_sz);
2405 return btf_dump_base_type_check_zero(d, t, id, data);
2408 return btf_dump_base_type_check_zero(d, t, id, data);
2410 const struct btf_array *array = btf_array(t);
2442 const struct btf_member *m = btf_members(t);
2443 __u16 n = btf_vlen(t);
2453 moffset = btf_member_bit_offset(t, i);
2459 bit_sz = btf_member_bitfield_size(t, i);
2469 err = btf_dump_get_enum_value(d, t, data, id, &value);
2483 const struct btf_type *t,
2491 size = btf_dump_type_data_check_overflow(d, t, id, data, bits_offset, bit_sz);
2494 err = btf_dump_type_data_check_zero(d, t, id, data, bits_offset, bit_sz);
2511 t = skip_mods_and_typedefs(d->btf, id, NULL);
2513 switch (btf_kind(t)) {
2519 err = btf_dump_unsupported_data(d, t, id);
2523 err = btf_dump_bitfield_data(d, t, data, bits_offset, bit_sz);
2525 err = btf_dump_int_data(d, t, id, data, bits_offset);
2528 err = btf_dump_float_data(d, t, id, data);
2531 err = btf_dump_ptr_data(d, t, id, data);
2534 err = btf_dump_array_data(d, t, id, data);
2538 err = btf_dump_struct_data(d, t, id, data);
2547 err = btf_dump_get_bitfield_value(d, t, data, bits_offset, bit_sz,
2552 err = btf_dump_enum_data(d, t, id, &enum_val);
2554 err = btf_dump_enum_data(d, t, id, data);
2557 err = btf_dump_var_data(d, t, id, data);
2560 err = btf_dump_datasec_data(d, t, id, data);
2564 BTF_INFO_KIND(t->info), id);
2577 const struct btf_type *t;
2583 t = btf__type_by_id(d->btf, id);
2584 if (!t)
2593 d->typed_dump->indent_str[0] = '\t';
2603 ret = btf_dump_dump_type_data(d, NULL, t, id, data, 0, 0);