[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fWrFGM=TbQ5zBjdBAyDLJhJ48K_6TLHt22jLhnV11OG_g@mail.gmail.com>
Date: Tue, 21 Jan 2025 08:52:25 -0800
From: Ian Rogers <irogers@...gle.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Song Liu <song@...nel.org>, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>, Kan Liang <kan.liang@...ux.intel.com>,
Aditya Gupta <adityag@...ux.ibm.com>, Athira Rajeev <atrajeev@...ux.vnet.ibm.com>,
Charlie Jenkins <charlie@...osinc.com>, James Clark <james.clark@...aro.org>,
"Steinar H. Gunderson" <sesse@...gle.com>, Changbin Du <changbin.du@...wei.com>,
Ravi Bangoria <ravi.bangoria@....com>, Howard Chu <howardchu95@...il.com>,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v1 1/3] perf build: Remove libbfd support
On Mon, Jan 13, 2025 at 7:10 AM Arnaldo Carvalho de Melo
<acme@...nel.org> wrote:
>
> On Sat, Jan 11, 2025 at 12:28:49PM -0800, Ian Rogers wrote:
> > libbfd is license incompatible with perf and building requires the
> > BUILD_NONDISTRO=1 build flag. Remove the code to simplify the code
> > base.
> >
> > Signed-off-by: Ian Rogers <irogers@...gle.com>
>
> > diff --git a/tools/perf/util/disasm_bpf.c b/tools/perf/util/disasm_bpf.c
> > index 1fee71c79b62..a891a0b909a7 100644
> > --- a/tools/perf/util/disasm_bpf.c
> > -
> > -int symbol__disassemble_bpf(struct symbol *sym, struct annotate_args *args)
> > -{
> > - struct annotation *notes = symbol__annotation(sym);
>
> Song,
>
> Have you ever investigated how to reimplement BPF disassemble
> using some other library than this one?
I think doing it using libLLVM should be straightforward. I sent out
this series to make libcapstone and libLLVM loadable using
dlopen/dlsym:
https://lore.kernel.org/lkml/20250120173208.344231-1-irogers@google.com/
See symbol__disassemble_llvm in patch 5:
https://lore.kernel.org/lkml/20250120173208.344231-6-irogers@google.com/
the difference is selecting just the BPF disassembler, so don't pass a
triplet, force it to BPF.
Anyway, one option following that series is to factor libbfd
dependencies into a bfd.c in tools/perf/util. That way we can try to
have a common interface for capstone, LLVM, etc. The other is to
delete it, which is my preference. I can add the BPF disassembler
support to llvm.c in that series and rebase this series onto it.
Thanks,
Ian
> Thanks,
>
> - Arnaldo
Powered by blists - more mailing lists