On 23/07/2025 20:27, Arnaldo Carvalho de Melo wrote: > On Wed, Jul 23, 2025 at 08:00:31PM +0100, Alan Maguire wrote: >> On 22/07/2025 15:22, Arnaldo Carvalho de Melo wrote: >>> If pahole is asked to encode BTF for a file with no DWARF info, don't >>> fail, just skip it. > >>> This is the case, for instance, in this file in a kernel build with >>> DWARF info generation enabled: > >>> $ pahole ../build/v6.15.0-rc4+/arch/x86/purgatory/purgatory.o >>> libbpf: failed to find '.BTF' ELF section in ../build/v6.15.0-rc4+/arch/x86/purgatory/purgatory.o >>> pahole: file '../build/v6.15.0-rc4+/arch/x86/purgatory/purgatory.o' has no supported type information. >>> $ > >>> Before it was failing when encoding BTF for it, now: > >>> $ pahole --btf_encode ../build/v6.15.0-rc4+/arch/x86/purgatory/purgatory.o >>> $ echo $? >>> 0 >>> $ > >>> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> > >> Only potential issue I can see is that in the usual case of encoding BTF >> from DWARF in the kernel we'd probably like to fall over if we can't >> encode BTF due to DWARF absence. However current Kconfig dependencies of >> CONFIG_DEBUG_INFO_BTF mean this can't happen in practice I think so > > Right, this is an exception, just some .o files out of thousands end up > without DWARF. > > So I think that if we take --btf_encode as "Encode BTF from DWARF, if > DWARF is available" is a good interpretation of intent. > > - Arnaldo > >> Reviewed-by: Alan Maguire <alan.maguire@xxxxxxxxxx> > > Thanks! > Applied to the next branch of https://git.kernel.org/pub/scm/devel/pahole/pahole.git/ Thanks! Alan