On Wed, 2025-08-13 at 14:51 -0700, Andrii Nakryiko wrote: [...] > > I have a feature request for this: > > generate local labels for branch and call targets. > > E.g. as in the tools/testing/selftests/bpf/jit_disasm_helpers.c. > > Or as in llvm-objdump -d --symbolize-operands. > > should we teach bpftool that? Would be nice to, imo. > > That aside, it looks like the code is very similar to bpftool's > > xlated_dumper.c. Is there a way to share the code? > > There would be now three places where xlated program is printed: > > - bpftool > > - veristat > > - selftests (this one does not handle ksyms, but it would be nice if it could) > > I was going to ask the question if veristat should just delegate all > this functionality to bpftool using popen() (it's very likely you'll > have bpftool installed if you have veristat), but I guess if we can > share more code between bpftool and veristat, it's fine as well. If code reuse proves to be convoluted, popen() sounds like a good idea to me. [...]