bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Ambardar <tony.ambardar@gmail.com>
To: "Alexis Lothoré" <alexis.lothore@bootlin.com>
Cc: dwarves@vger.kernel.org, bpf@vger.kernel.org,
	Alan Maguire <alan.maguire@oracle.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH dwarves v2] dwarf_loader: Fix skipped encoding of function BTF on 32-bit systems
Date: Thu, 8 May 2025 22:21:35 -0700	[thread overview]
Message-ID: <aB2Q3ylln95YFTCD@kodidev-ubuntu> (raw)
In-Reply-To: <D9QOFW6WEIT0.2AJBVJINZRRBV@bootlin.com>

Hi Alexis,

On Thu, May 08, 2025 at 11:38:06AM +0200, Alexis Lothoré wrote:
> Hello,
> 
> On Fri May 2, 2025 at 9:03 AM CEST, Tony Ambardar wrote:
> > I encountered an issue building BTF kernels for 32-bit armhf, where many
> > functions are missing in BTF data:
> 
> [...]
> 
> > Fixes: a53c58158b76 ("dwarf_loader: Mark functions that do not use expected registers for params")
> > Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
> 
> I encountered some issues with pahole 1.30 when trying to generate BTF data
> for functions having some __int128 values ([1]), and have been redirected
> here by Tony. I gave a try to the patch below and confirm that it fixes my
> issue: BTF data is now properly generated for my target function, so:
> 
> Tested-by: Alexis Lothoré <alexis.lothore@bootlin.com>
> 

Glad that resolved your issue, and thank you for the extra testing data
point.

> While at it, to follow-up on Alan's request for more testing, I did the
> following:
> - build kernel and bpf selftests with pahole 1.30, extract BTF raw data
>   with bpftool
> - repeat with pahole 1.30 + Tony's patch
> - I build my kernel for arm64, it is based on bpf-next_base and I use a
>   defconfig very close to the one used in BPF CI (so based on
>   tools/testing/selftests/bpf/config*)
> 

Nice! I notice bootlin has worked on several BPF testing contributions,
and was wondering if your build is some new standard buildroot/yocto
config tailored for BPF testing, and what archs it might support? Reason
for asking is I have a large stack of WIP patches for enabling use of
test_progs across 64/32-bit archs and cross-compilation, and I'm keen to
see other examples of configs, root images, etc. (especially for 32-bit)
At the moment I'm targeting 32-bit armhf support to make progress..

> I observe the following when comparing the resulting BTF data with/without
> Tony's patch:
> - There is no difference on vmlinux BTF data
> - For bpf_testmod.ko, there is a slight shift in the first BTF ID (first ID
>   is 46 with pristine pahole, 47 with patched pahole), which in turns makes
>   a lot of noise in the diff, but the actual diff seems to be about two new
>   BTF entries related to my custom function now being properly detected
>   (BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO)
> 

Right, I noticed the same skew and it does make checking equivalence more
complicated.

> Alexis
> 
> [1] https://lore.kernel.org/bpf/D9Q73OTLEOU4.LNAO9K4POETM@bootlin.com/
> 
> -- 
> Alexis Lothoré, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> 
Thanks again,
Tony

  reply	other threads:[~2025-05-09  5:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10  8:33 [PATCH dwarves v1] dwarf_loader: Fix skipped encoding of function BTF on 32-bit systems Tony Ambardar
2025-04-10 12:20 ` Alan Maguire
2025-04-16 10:33   ` Tony Ambardar
2025-05-02  7:03     ` [PATCH dwarves v2] " Tony Ambardar
2025-05-08  9:38       ` Alexis Lothoré
2025-05-09  5:21         ` Tony Ambardar [this message]
2025-05-09  8:33           ` Alexis Lothoré
2025-05-12  8:41             ` Tony Ambardar
2025-05-08 13:24       ` Alan Maguire
2025-05-09  5:22         ` Tony Ambardar
2025-05-22  6:37       ` [PATCH dwarves v3] " Tony Ambardar
2025-06-24 16:14         ` Alan Maguire
2025-06-30 10:01           ` Alan Maguire
2025-06-30 13:51             ` Jiri Olsa
2025-06-30 17:32               ` Alan Maguire

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=aB2Q3ylln95YFTCD@kodidev-ubuntu \
    --to=tony.ambardar@gmail.com \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=alexis.lothore@bootlin.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dwarves@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).