On Mon, 2024-07-22 at 09:54 -0700, Yonghong Song wrote: [...] > > For "0156b148b5b4" I opted to do a popen() call and execute bpftool process, > > an alternative would be to: > > a. either link tools/bpf/bpftool/jit_disasm.c as a part of the > > test_progs executable; > > b. call libbfd (binutils dis-assembler) directly from the bpftool. > > > > Currently bpftool can use two dis-assemblers: libbfd and llvm library, > > depending on the build environment. For CI builds libbfd is used. > > I don't know if llvm and libbfd always produce same output for > > identical binary code. Imo, if people are Ok with adding libbfd > > dependency to test_progs, option (b) is the best. If folks on the > > mailing list agree with this, I can work on updating the patches. > > I think this is a good idea in the long time. > Let me try with your patch. What do you think about direct dependency on libbfd for test_progs, should I update the disassembly function or popen'ing bpftool is fine? I'd prefer libbfd dependency, tbh. [...]