Lines Matching refs:id
226 static int btf_dump_order_type(struct btf_dump *d, __u32 id, bool through_ptr);
227 static void btf_dump_emit_type(struct btf_dump *d, __u32 id, __u32 cont_id);
245 int btf_dump__dump_type(struct btf_dump *d, __u32 id) in btf_dump__dump_type() argument
249 if (id > btf__get_nr_types(d->btf)) in btf_dump__dump_type()
257 err = btf_dump_order_type(d, id, false); in btf_dump__dump_type()
341 static int btf_dump_add_emit_queue_id(struct btf_dump *d, __u32 id) in btf_dump_add_emit_queue_id() argument
355 d->emit_queue[d->emit_queue_cnt++] = id; in btf_dump_add_emit_queue_id()
433 static int btf_dump_order_type(struct btf_dump *d, __u32 id, bool through_ptr) in btf_dump_order_type() argument
446 struct btf_dump_type_aux_state *tstate = &d->type_states[id]; in btf_dump_order_type()
455 t = btf__type_by_id(d->btf, id); in btf_dump_order_type()
461 pr_warn("unsatisfiable type cycle, id:[%u]\n", id); in btf_dump_order_type()
499 err = btf_dump_add_emit_queue_id(d, id); in btf_dump_order_type()
515 err = btf_dump_add_emit_queue_id(d, id); in btf_dump_order_type()
534 err = btf_dump_add_emit_queue_id(d, id); in btf_dump_order_type()
538 d->type_states[id].order_state = ORDERED; in btf_dump_order_type()
568 d->type_states[id].order_state = ORDERED; in btf_dump_order_type()
576 static void btf_dump_emit_missing_aliases(struct btf_dump *d, __u32 id,
579 static void btf_dump_emit_struct_fwd(struct btf_dump *d, __u32 id,
581 static void btf_dump_emit_struct_def(struct btf_dump *d, __u32 id,
584 static void btf_dump_emit_enum_fwd(struct btf_dump *d, __u32 id,
586 static void btf_dump_emit_enum_def(struct btf_dump *d, __u32 id,
589 static void btf_dump_emit_fwd_def(struct btf_dump *d, __u32 id,
592 static void btf_dump_emit_typedef_def(struct btf_dump *d, __u32 id,
601 static void btf_dump_emit_type_decl(struct btf_dump *d, __u32 id,
607 static const char *btf_dump_type_name(struct btf_dump *d, __u32 id);
608 static const char *btf_dump_ident_name(struct btf_dump *d, __u32 id);
612 static bool btf_dump_is_blacklisted(struct btf_dump *d, __u32 id) in btf_dump_is_blacklisted() argument
614 const struct btf_type *t = btf__type_by_id(d->btf, id); in btf_dump_is_blacklisted()
645 static void btf_dump_emit_type(struct btf_dump *d, __u32 id, __u32 cont_id) in btf_dump_emit_type() argument
647 struct btf_dump_type_aux_state *tstate = &d->type_states[id]; in btf_dump_emit_type()
655 t = btf__type_by_id(d->btf, id); in btf_dump_emit_type()
669 if (id == cont_id) in btf_dump_emit_type()
673 id); in btf_dump_emit_type()
676 btf_dump_emit_struct_fwd(d, id, t); in btf_dump_emit_type()
686 if (!btf_dump_is_blacklisted(d, id)) { in btf_dump_emit_type()
687 btf_dump_emit_typedef_def(d, id, t, 0); in btf_dump_emit_type()
702 btf_dump_emit_missing_aliases(d, id, t); in btf_dump_emit_type()
708 btf_dump_emit_enum_def(d, id, t, 0); in btf_dump_emit_type()
723 btf_dump_emit_fwd_def(d, id, t); in btf_dump_emit_type()
729 btf_dump_emit_type(d, t->type, id); in btf_dump_emit_type()
737 if (!tstate->fwd_emitted && !btf_dump_is_blacklisted(d, id)) { in btf_dump_emit_type()
738 btf_dump_emit_typedef_def(d, id, t, 0); in btf_dump_emit_type()
758 new_cont_id = t->name_off == 0 ? cont_id : id; in btf_dump_emit_type()
761 } else if (!tstate->fwd_emitted && id != cont_id) { in btf_dump_emit_type()
762 btf_dump_emit_struct_fwd(d, id, t); in btf_dump_emit_type()
768 btf_dump_emit_struct_def(d, id, t, 0); in btf_dump_emit_type()
791 static bool btf_is_struct_packed(const struct btf *btf, __u32 id, in btf_is_struct_packed() argument
912 static void btf_dump_emit_struct_fwd(struct btf_dump *d, __u32 id, in btf_dump_emit_struct_fwd() argument
917 btf_dump_type_name(d, id)); in btf_dump_emit_struct_fwd()
921 __u32 id, in btf_dump_emit_struct_def() argument
931 align = btf__align_of(d->btf, id); in btf_dump_emit_struct_def()
932 packed = is_struct ? btf_is_struct_packed(d->btf, id, t) : 0; in btf_dump_emit_struct_def()
937 btf_dump_type_name(d, id)); in btf_dump_emit_struct_def()
997 static void btf_dump_emit_missing_aliases(struct btf_dump *d, __u32 id, in btf_dump_emit_missing_aliases() argument
1000 const char *name = btf_dump_type_name(d, id); in btf_dump_emit_missing_aliases()
1012 static void btf_dump_emit_enum_fwd(struct btf_dump *d, __u32 id, in btf_dump_emit_enum_fwd() argument
1015 btf_dump_printf(d, "enum %s", btf_dump_type_name(d, id)); in btf_dump_emit_enum_fwd()
1018 static void btf_dump_emit_enum_def(struct btf_dump *d, __u32 id, in btf_dump_emit_enum_def() argument
1030 btf_dump_type_name(d, id)); in btf_dump_emit_enum_def()
1052 static void btf_dump_emit_fwd_def(struct btf_dump *d, __u32 id, in btf_dump_emit_fwd_def() argument
1055 const char *name = btf_dump_type_name(d, id); in btf_dump_emit_fwd_def()
1063 static void btf_dump_emit_typedef_def(struct btf_dump *d, __u32 id, in btf_dump_emit_typedef_def() argument
1066 const char *name = btf_dump_ident_name(d, id); in btf_dump_emit_typedef_def()
1083 static int btf_dump_push_decl_stack_id(struct btf_dump *d, __u32 id) in btf_dump_push_decl_stack_id() argument
1097 d->decl_stack[d->decl_stack_cnt++] = id; in btf_dump_push_decl_stack_id()
1143 int btf_dump__emit_type_decl(struct btf_dump *d, __u32 id, in btf_dump__emit_type_decl() argument
1159 btf_dump_emit_type_decl(d, id, fname, lvl); in btf_dump__emit_type_decl()
1164 static void btf_dump_emit_type_decl(struct btf_dump *d, __u32 id, in btf_dump_emit_type_decl() argument
1173 t = btf__type_by_id(d->btf, id); in btf_dump_emit_type_decl()
1177 err = btf_dump_push_decl_stack_id(d, id); in btf_dump_emit_type_decl()
1190 if (id == 0) in btf_dump_emit_type_decl()
1199 id = t->type; in btf_dump_emit_type_decl()
1202 id = btf_array(t)->type; in btf_dump_emit_type_decl()
1213 btf_kind(t), id); in btf_dump_emit_type_decl()
1245 __u32 id; in btf_dump_emit_mods() local
1248 id = decl_stack->ids[decl_stack->cnt - 1]; in btf_dump_emit_mods()
1249 t = btf__type_by_id(d->btf, id); in btf_dump_emit_mods()
1271 __u32 id; in btf_dump_drop_mods() local
1274 id = decl_stack->ids[decl_stack->cnt - 1]; in btf_dump_drop_mods()
1275 t = btf__type_by_id(d->btf, id); in btf_dump_drop_mods()
1307 __u32 id; in btf_dump_emit_type_chain() local
1310 id = decls->ids[--decls->cnt]; in btf_dump_emit_type_chain()
1311 if (id == 0) { in btf_dump_emit_type_chain()
1319 t = btf__type_by_id(d->btf, id); in btf_dump_emit_type_chain()
1333 btf_dump_emit_struct_def(d, id, t, lvl); in btf_dump_emit_type_chain()
1335 btf_dump_emit_struct_fwd(d, id, t); in btf_dump_emit_type_chain()
1341 btf_dump_emit_enum_def(d, id, t, lvl); in btf_dump_emit_type_chain()
1343 btf_dump_emit_enum_fwd(d, id, t); in btf_dump_emit_type_chain()
1347 btf_dump_emit_fwd_def(d, id, t); in btf_dump_emit_type_chain()
1351 btf_dump_printf(d, "%s", btf_dump_ident_name(d, id)); in btf_dump_emit_type_chain()
1455 kind, id); in btf_dump_emit_type_chain()
1490 static const char *btf_dump_resolve_name(struct btf_dump *d, __u32 id, in btf_dump_resolve_name() argument
1493 struct btf_dump_type_aux_state *s = &d->type_states[id]; in btf_dump_resolve_name()
1494 const struct btf_type *t = btf__type_by_id(d->btf, id); in btf_dump_resolve_name()
1496 const char **cached_name = &d->cached_names[id]; in btf_dump_resolve_name()
1523 static const char *btf_dump_type_name(struct btf_dump *d, __u32 id) in btf_dump_type_name() argument
1525 return btf_dump_resolve_name(d, id, d->type_names); in btf_dump_type_name()
1528 static const char *btf_dump_ident_name(struct btf_dump *d, __u32 id) in btf_dump_ident_name() argument
1530 return btf_dump_resolve_name(d, id, d->ident_names); in btf_dump_ident_name()