From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: dwarves@vger.kernel.org, bpf@vger.kernel.org
Subject: [PATCH 1/1] pahole: Don't fail when encoding BTF on an object with no DWARF info
Date: Tue, 22 Jul 2025 11:22:27 -0300 [thread overview]
Message-ID: <aH-eo6xY98cxBT1-@x1> (raw)
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@redhat.com>
---
pahole.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/pahole.c b/pahole.c
index 333e71ab65924d2c..a001ec86ef1b0908 100644
--- a/pahole.c
+++ b/pahole.c
@@ -3659,6 +3659,13 @@ try_sole_arg_as_class_names:
remaining = argc;
goto try_sole_arg_as_class_names;
}
+
+ if (btf_encode || ctf_encode) {
+ // If encoding is asked for and there is no DEBUG info to encode from,
+ // there are no errors, continue...
+ goto out_ok;
+ }
+
if (argv[remaining] != NULL) {
cus__fprintf_load_files_err(cus, "pahole", argv + remaining, err, stderr);
} else {
--
2.49.0
next reply other threads:[~2025-07-22 14:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 14:22 Arnaldo Carvalho de Melo [this message]
2025-07-23 19:00 ` [PATCH 1/1] pahole: Don't fail when encoding BTF on an object with no DWARF info Alan Maguire
2025-07-23 19:27 ` Arnaldo Carvalho de Melo
2025-07-31 8:09 ` 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=aH-eo6xY98cxBT1-@x1 \
--to=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=bpf@vger.kernel.org \
--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 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.