On Tue, 2024-04-30 at 10:41 -0700, Andrii Nakryiko wrote: [...] > Speaking of sorting, Mykyta (cc'ed) is working on teaching *bpftool* > to do a sane ordering of types so that vmlinux.h output is a) > meaningfully (from human POV) sorted and b) vmlinux.h overall is more > "stable" between slight changes to vmlinux BTF itself, so that they > can be more meaningfully diffed. This is in no way related to sorting > vmlinux BTF data itself (sorting is done on the fly before generating > vmlinux.h), but I thought I'd mention that as you are probably > interested in this as well. Oh, well... I have a sorting pass already, it is here: https://github.com/eddyz87/dwarves/tree/sort-btf Would be a bit simpler, if moved inside libbpf and uses internal APIs.