All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan McGrath <bmcgrath@codeweavers.com>
To: Ian Rogers <irogers@google.com>, James Clark <james.clark@linaro.org>
Cc: "Rémi Bernon" <rbernon@codeweavers.com>,
	"Sam James" <sam@gentoo.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Jiri Olsa" <jolsa@kernel.org>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Leo Yan" <leo.yan@arm.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] perf symbols: Fix HAVE_LIBBFD_BUILDID_SUPPORT build
Date: Mon, 8 Sep 2025 20:24:45 +1000	[thread overview]
Message-ID: <3db2d6af-3b21-4ce2-be1f-668270adbbeb@codeweavers.com> (raw)
In-Reply-To: <CAP-5=fXKthsZe3J4_UHHGwDafBq7pHzM18Mh=_2QrnSfCT3nOg@mail.gmail.com>



On 9/5/25 01:53, Ian Rogers wrote:
> On Thu, Sep 4, 2025 at 7:18 AM James Clark <james.clark@linaro.org> wrote:
>>
>>
>>
>> On 04/09/2025 9:27 am, Rémi Bernon wrote:
>>> Hi!
>>>
>>> On 9/4/25 10:13, James Clark wrote:
>>>>
>>>>
>>>> On 03/09/2025 5:07 pm, Ian Rogers wrote:
>>>>> On Wed, Sep 3, 2025 at 8:15 AM James Clark <james.clark@linaro.org>
>>>>> wrote:
>>>>>>
>>>>>> read_build_id() now has a blocking argument, but libbfd uses fopen()
>>>>>> internally which doesn't support O_NONBLOCK. Fix the build by adding
>>>>>> the
>>>>>> argument and ignoring it:
>>>>>>
>>>>>>     util/symbol-elf.c:964:8: error: too many arguments to function
>>>>>> ‘read_build_id’
>>>>>>       964 |  err = read_build_id(filename, bid, block);
>>>>>>
>>>>>> Fixes: 2c369d91d093 ("perf symbol: Add blocking argument to
>>>>>> filename__read_build_id")
>>>>>> Signed-off-by: James Clark <james.clark@linaro.org>
>>>>>
>>>>> Libbfd should go away:
>>>>> https://lore.kernel.org/lkml/20250823003216.733941-14-
>>>>> irogers@google.com/
>>>>> but I can imagine that currently this is hit in a build test - sorry
>>>>> for missing that and thanks for the fix!
>>>>>
>>>>
>>>> Yeah just one of the build tests, I'm not actually using it.
>>>>
>>>> Remi are you still using this? To be fair the addition for PE support
>>>> is fairly recent and even includes a binary for testing it so I'm not
>>>> sure if we should be so quick to remove it.
>>>>
>>> Yes, I'm still using it occasionally, and I think it's generally useful
>>> for Wine profiling purposes and I would rather prefer that it's not
>>> removed.
>>>
>>> I know it's not built by default because of license conflicts. I didn't
>>> realize that was an issue when contributing the changes, and it is quite
>>> unfortunate (and silly IMO).
>>>
>>> Then I'm not particularly attached to libbfd and any other option that
>>> would let perf read PE files would be alright, as long as PE support is
>>> kept.
>>>
>>> Cheers,
>>
>> It looks like libLLVM might work. Looking at the doxygen there are vague
>> references to PE binaries around the getBuildID() function. But as
>> mentioned in the linked thread, it's huge at 100+ MB.
>>
>> WRT that thread, I think maybe re-writing some of this in Perf wouldn't
>> be so bad. Surely getting the buildID is trivial. For PE binaries it's
>> hard to tell what's supported currently, what's being used and what's
>> being done by what library or tool. addr2line, libbfd, symbols,
>> disassembly etc.
> 
> I know some people who work on LLVM for Windows for the sake of having
> a Chrome build from Linux. It should be possible to migrate the libbfd
> use cases to LLVM.

Just wanted to let you know that I've been able to put together a PoC 
that does just this. It allows the pe-file-parsing test to pass using 
LLVM in place of libbfd.

If there's interest, I would be happy to try to shape this in to 
something that can be accepted upstream.

> If I remember John Levine's Linkers and Loaders
> book correctly (contents available by way of your favorite search
> engine) everything is just a variant of COFF anyway.
> 
> It is a shame that the PE testing in buildid.sh (and the testing in
> general) is requiring `cc` as it'd be much nicer to have the tests in
> a form similar to the perf test workloads (e.g. perf test -w noploop).
> I don't have a good idea on how to fix this but just wanted to note
> it.
> 
> I'll write a non-blocking patch for read_build_id with libbfd that
> matches what the others do and should avoid the hang in the meantime.
> 
> Thanks,
> Ian
> 


  reply	other threads:[~2025-09-08 10:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-03 15:15 [PATCH 0/2] perf tools: read_build_id() blocking argument fixes James Clark
2025-09-03 15:15 ` [PATCH 1/2] perf tests: Fix "PE file support" test build James Clark
2025-09-03 16:28   ` Ian Rogers
2025-09-03 15:15 ` [PATCH 2/2] perf symbols: Fix HAVE_LIBBFD_BUILDID_SUPPORT build James Clark
2025-09-03 16:07   ` Ian Rogers
2025-09-04  8:13     ` James Clark
2025-09-04  8:27       ` Rémi Bernon
2025-09-04 14:18         ` James Clark
2025-09-04 15:53           ` Ian Rogers
2025-09-08 10:24             ` Brendan McGrath [this message]
2025-09-08 15:47               ` Ian Rogers
2025-09-08 21:15                 ` Arnaldo Carvalho de Melo
2025-09-11 23:23                 ` Brendan McGrath
2025-09-04 17:53     ` Sam James
2025-09-09 10:17       ` Guilherme Amadio
2025-09-03 15:34 ` [PATCH 0/2 v6.17-rc] perf tools: read_build_id() blocking argument fixes Arnaldo Carvalho de Melo
2025-09-03 17:47   ` Namhyung Kim

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=3db2d6af-3b21-4ce2-be1f-668270adbbeb@codeweavers.com \
    --to=bmcgrath@codeweavers.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rbernon@codeweavers.com \
    --cc=sam@gentoo.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.