On Tue, 2024-05-28 at 15:39 -0700, Andrii Nakryiko wrote: [...] > I meant something less heavy-handed: > > static const char *btf_dump_missing_alias(struct btf_dump *d, __u32 id) > { > const char *name = btf_dump_type_name(d, id); > int i; > > for (i = 0; i < ARRAY_SIZE(missing_base_types); i++) { > if (strcmp(name, missing_base_types[i][0]) == 0) > return missing_base_types[i][1]; > } > return NULL; > } > > And we actually don't need to use btf_dump_type_name(), btf_name_of() > should be more than adequate for this. > > Then if you get NULL from this function, there is no aliasing > required. If you got non-NULL, you have the name you should alias to > (btf_name_of() will give you original name). This should do it, thank you.