From: Sam James <sam@gentoo.org>
To: Ian Rogers <irogers@google.com>, Ingo Molnar <mingo@redhat.com>
Cc: acme@kernel.org, adityag@linux.ibm.com,
adrian.hunter@intel.com, ak@linux.intel.com,
alexander.shishkin@linux.intel.com, amadio@gentoo.org,
atrajeev@linux.vnet.ibm.com, bpf@vger.kernel.org,
chaitanyas.prakash@arm.com, changbin.du@huawei.com,
charlie@rivosinc.com, dvyukov@google.com,
james.clark@linaro.org, jolsa@kernel.org,
justinstitt@google.com, kan.liang@linux.intel.com,
kjain@linux.ibm.com, lihuafei1@huawei.com,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
llvm@lists.linux.dev, mark.rutland@arm.com,
mhiramat@kernel.org, mingo@redhat.com, morbo@google.com,
namhyung@kernel.org, nathan@kernel.org,
nick.desaulniers+lkml@gmail.com, peterz@infradead.org,
sesse@google.com, song@kernel.org
Subject: Re: [PATCH v5 00/19] Support dynamic opening of capstone/llvm remove BUILD_NONDISTRO
Date: Sat, 23 Aug 2025 23:04:06 +0100 [thread overview]
Message-ID: <87zfbpae5l.fsf@gentoo.org> (raw)
In-Reply-To: <CAP-5=fV+-VZ+SsGL1SJGYMEv-gwkv1AKk_6MZJ4tLBrCXFnMQA@mail.gmail.com>
Ian Rogers <irogers@google.com> writes:
> On Fri, Aug 22, 2025 at 11:52 PM Sam James <sam@gentoo.org> wrote:
>>
>> > A few months ago, objdump was the only way to get
>> > source line support [0]. Is that still the case?
>>
>> ... or is this perhaps handled by "[PATCH v5 18/19] perf srcline:
>> Fallback between addr2line implementations", in which case, shouldn't
>> that really land first so people can try the LLVM impl and use the
>> binutils one if it fails?
>
> So my opinion, BUILD_NON_DISTRO isn't supported and the code behind it
> should go away. Please don't do anything to the contrary or enable it
> for your distribution - this was supposed to be implied by the name.
We're principally a source-based distribution, so it's not as much of an
issue.
> The forking and running addr2line gets around the license issue that
> is GPLv3* but comes with a performance overhead. It also has a
> maintenance overhead supporting llvm and binutil addr2line, when the
> addr2line output changes things break, etc. (LLVM has been evolving
> their output but I'm not aware of it breaking things yet). We should
> (imo) delete the forking and running addr2line support, it fits the
> billing of something we can do when capstone and libLLVM support
> aren't there but the code is a hot mess and we don't do exhaustive
> testing against the many addr2line flavors, the best case is buyer
> beware. Capstone is derived from libLLVM, I'm not sure it makes sense
> having 2 libraries for this stuff. There's libLLVM but what it
> provides through a C API is a mess requiring the C++ shimming. Tbh, I
> think most of what these libraries provide we should just get over
> ourselves and provide in perf itself. For example, does it make sense
> to be trying to add type annotations to objdump output, to just update
> objdump or have a disassembler library where we can annotate things as
> we see fit? Library bindings don't break when text output formats get
> tweaked. Given we're doing so much dwarf processing, do we need a
> library for that or should that just be in-house? We can side step
> most of this mess by starting again in python as is being shown in the
> textual changes that bring with it stuff like console flame graphs:
> https://lore.kernel.org/lkml/CAP-5=fU=z8kcY4zjezoxSwYf9vczYzHztiMSBvJxdwwBPVWv2Q@mail.gmail.com/
> So I think long term we make the perf tool minimal with minimal
> dependencies (ie no addr2line, libLLVM, etc.), we work on having nice
> stuff in the python stuff where we can reuse or build new libraries
> for addr2line, objdump-ing, etc. Use >1 thread, use asyncio, etc.
Yeah, this absolutely sounds like the right direction indeed. I'm glad
to hear it.
>
> For where we are now, ie no python stuff, BUILD_NON_DISTRO should go
> away as nobody is maintaining it and hasn't for 2 years (what happens
> when libbfd and libiberty change?)
They don't change often, though. The fixes are usually trivial when they
do arise.
> We should focus on making the best
> of what we have via libraries/tools that are supported - while not
> forcing the libraries to be there or making the perf binary massive by
> dragging in say libLLVM. The patch series pushes in that direction and
> I commend it to the reader.
>
> No, reordering the patches to compare performance of binutils doesn't
> make sense, just build with and without the patch series if you want
> to do this, but also don't do this as BUILD_NON_DISTRO should go away.
I was asking purely because of the *functionality loss*, though, not
performance. In the thread I linked from just a few months ago with Ingo
Molnar, there was a real issue with llvm or capstone-based disassembly
not showing source information. I'd hit the same problem. Is that fixed now?
This is my principal concern rather than the LLVM dependency (even if
I'd love to avoid that, I understand and appreciate the arguments you're
making above and intent on future direction).
>
> Thanks,
> Ian
>
> * (As I understand the issue IANAL) GPLv3 and GPLv2 can't be linked
> together. Why not just use GPLv3? A major issue for me is that GPLv3
> adds a requirement for “Installation Information” to be provided,
> which means placing a binary in a cryptographically signed OS
> partition you'd need to reveal the signing key which defeats the
> purpose of signing the partition to ensure you aren't hacked. I like
> open source and using the code, I don't want to be hacked by giving to
> the hackers my signing keys.
I think the way people usually handle this is allowing a custom key to
be added, but then it taints the device. That's how I think routers seem
to handle it often anyway.
next prev parent reply other threads:[~2025-08-23 22:04 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-23 0:31 [PATCH v5 00/19] Support dynamic opening of capstone/llvm remove BUILD_NONDISTRO Ian Rogers
2025-08-23 0:31 ` [PATCH v5 01/19] perf build: Remove libtracefs configuration Ian Rogers
2025-08-23 0:31 ` [PATCH v5 02/19] perf map: Constify objdump offset/address conversion APIs Ian Rogers
2025-08-23 0:31 ` [PATCH v5 03/19] perf capstone: Move capstone functionality into its own file Ian Rogers
2025-08-23 0:32 ` [PATCH v5 04/19] perf llvm: Move llvm " Ian Rogers
2025-08-23 0:32 ` [PATCH v5 05/19] perf capstone: Remove open_capstone_handle Ian Rogers
2025-08-23 0:32 ` [PATCH v5 06/19] perf capstone: Support for dlopen-ing libcapstone.so Ian Rogers
2025-08-23 0:32 ` [PATCH v5 07/19] perf llvm: Support for dlopen-ing libLLVM.so Ian Rogers
2025-08-23 0:32 ` [PATCH v5 08/19] perf llvm: Mangle libperf-llvm.so function names Ian Rogers
2025-08-23 0:32 ` [PATCH v5 09/19] perf dso: Move read_symbol from llvm/capstone to dso Ian Rogers
2025-08-23 0:32 ` [PATCH v5 10/19] perf dso: Support BPF programs in dso__read_symbol Ian Rogers
2025-08-23 0:32 ` [PATCH v5 11/19] perf llvm: Disassemble cleanup Ian Rogers
2025-08-23 0:32 ` [PATCH v5 12/19] perf dso: Clean up read_symbol error handling Ian Rogers
2025-08-23 0:32 ` [PATCH v5 13/19] perf build: Remove libbfd support Ian Rogers
2025-08-23 0:32 ` [PATCH v5 14/19] perf build: Remove libiberty support Ian Rogers
2025-08-23 0:32 ` [PATCH v5 15/19] perf build: Remove unused defines Ian Rogers
2025-08-23 0:32 ` [PATCH v5 16/19] perf disasm: Remove disasm_bpf Ian Rogers
2025-08-23 0:32 ` [PATCH v5 17/19] perf disasm: Make ins__scnprintf and ins__is_nop static Ian Rogers
2025-08-23 0:32 ` [PATCH v5 18/19] perf srcline: Fallback between addr2line implementations Ian Rogers
2025-08-23 0:32 ` [PATCH v5 19/19] perf disasm: Remove unused evsel from annotate_args Ian Rogers
2025-08-23 6:49 ` [PATCH v5 00/19] Support dynamic opening of capstone/llvm remove BUILD_NONDISTRO Sam James
2025-08-23 6:52 ` Sam James
2025-08-23 16:49 ` Ian Rogers
2025-08-23 22:04 ` Sam James [this message]
2025-08-24 17:32 ` Ian Rogers
2025-08-23 23:34 ` Andi Kleen
2025-08-24 16:39 ` Ian Rogers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zfbpae5l.fsf@gentoo.org \
--to=sam@gentoo.org \
--cc=acme@kernel.org \
--cc=adityag@linux.ibm.com \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=amadio@gentoo.org \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=bpf@vger.kernel.org \
--cc=chaitanyas.prakash@arm.com \
--cc=changbin.du@huawei.com \
--cc=charlie@rivosinc.com \
--cc=dvyukov@google.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=justinstitt@google.com \
--cc=kan.liang@linux.intel.com \
--cc=kjain@linux.ibm.com \
--cc=lihuafei1@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=namhyung@kernel.org \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=peterz@infradead.org \
--cc=sesse@google.com \
--cc=song@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.