]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf bpf: Move BPF disassembly routines to separate file to avoid clash with capstone...
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 31 Jul 2024 14:58:56 +0000 (11:58 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 1 Aug 2024 21:54:19 +0000 (18:54 -0300)
commitea59b70a8418a313d6f2ab48a957de015fc33018
tree33eef6d0f1dc2c3673399ec2d57a276353026230
parent9cb3549b73c1cd1f8ed0ff32bafab7649e5bf4ea
perf bpf: Move BPF disassembly routines to separate file to avoid clash with capstone bpf headers

There is a clash of the libbpf and capstone libraries, that ends up
with:

  In file included from /usr/include/capstone/capstone.h:325,
                   from util/disasm.c:1513:
  /usr/include/capstone/bpf.h:94:14: error: ‘bpf_insn’ defined as wrong kind of tag
     94 | typedef enum bpf_insn {

So far we're just trying to avoid this by not having both headers
included in the same .c or .h file, do it one more time by moving the
BPF diassembly routines from util/disasm.c to util/disasm_bpf.c.

This is only being hit when building with BUILD_NONDISTRO=1, i.e.
building with binutils-devel, that isn't the in the default build due to
a licencing clash. We need to reimplement what is now isolated in
util/disasm_bpf.c using some other library to have BPF annotation
feature that now only is available with BUILD_NONDISTRO=1.

Fixes: 6d17edc113de1e21 ("perf annotate: Use libcapstone to disassemble")
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/ZqpUSKPxMwaQKORr@x1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/Build
tools/perf/util/disasm.c
tools/perf/util/disasm_bpf.c [new file with mode: 0644]
tools/perf/util/disasm_bpf.h [new file with mode: 0644]