On Thu, Jul 4, 2024 at 3:24 AM Eduard Zingerman <eddyz87@xxxxxxxxx> wrote: > > struct bpf_insn *disasm_insn(struct bpf_insn *insn, char *buf, size_t buf_sz); > > Disassembles instruction 'insn' to a text buffer 'buf'. > Removes insn->code hex prefix added by kernel disassembly routine. > Returns a pointer to the next instruction > (increments insn by either 1 or 2). > > Signed-off-by: Eduard Zingerman <eddyz87@xxxxxxxxx> > --- > tools/testing/selftests/bpf/Makefile | 1 + > tools/testing/selftests/bpf/disasm_helpers.c | 51 +++++++++++++ > tools/testing/selftests/bpf/disasm_helpers.h | 12 +++ > .../selftests/bpf/prog_tests/ctx_rewrite.c | 74 +++---------------- > tools/testing/selftests/bpf/testing_helpers.c | 1 + > 5 files changed, 75 insertions(+), 64 deletions(-) > create mode 100644 tools/testing/selftests/bpf/disasm_helpers.c > create mode 100644 tools/testing/selftests/bpf/disasm_helpers.h > LGTM. Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx> [...]