bpftool: Support setting alternative arch for JIT disasm with LLVM
authorQuentin Monnet <quentin@isovalent.com>
Tue, 25 Oct 2022 15:03:28 +0000 (16:03 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 25 Oct 2022 17:11:56 +0000 (10:11 -0700)
commitce4f660862359f2172ff4e3df30e641df5475cf6
tree77321de34d70c1bed2a82345abbb338b4cd16e4b
parenteb9d1acf634baf6401dfb4f67dc895290713a357
bpftool: Support setting alternative arch for JIT disasm with LLVM

For offloaded BPF programs, instead of failing to create the
LLVM disassembler without even looking for a triple at all, do run the
function that attempts to retrieve a valid architecture name for the
device.

It will still fail for the LLVM disassembler, because currently we have
no valid triple to return (NFP disassembly is not supported by LLVM).
But failing in that function is more logical than to assume in
jit_disasm.c that passing an "arch" name is simply not supported.

Suggested-by: Song Liu <song@kernel.org>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/r/20221025150329.97371-8-quentin@isovalent.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/common.c
tools/bpf/bpftool/jit_disasm.c
tools/bpf/bpftool/main.h
tools/bpf/bpftool/prog.c