public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: dwarves@vger.kernel.org
Subject: [PATCH 1/1] pahole: When trying to encode BTF avoid DWARF less files
Date: Wed, 2 Apr 2025 17:35:22 -0300	[thread overview]
Message-ID: <Z-2fij_hUUFYF-YQ@x1> (raw)

Make sure only DWARF is expected when encoding BTF. In time BTF will
also be accepted, to fixup or augment info produced by some producer, be
it gcc, clang, pahole or some other tool, for now, avoid trying to use
BTF when DWARF isn't available.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 pahole.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/pahole.c b/pahole.c
index af3e1cfe224dd14a..f247ff5e88feeb95 100644
--- a/pahole.c
+++ b/pahole.c
@@ -3493,6 +3493,14 @@ int main(int argc, char *argv[])
 		goto out;
 	}
 
+	// Right now encoding BTF has to be from DWARF, so enforce that, otherwise
+	// the loading process can fall back to other formats, BTF being the case
+	// and as this is at this point unintended, avoid that.
+	// Next we need to just skip object files that don't have the format we
+	// expect as the source for BTF encoding, i.e. no DWARF, no BTF, no problema.
+	if (btf_encode && conf_load.format_path == NULL)
+		conf_load.format_path = "dwarf";
+
 	if (show_running_kernel_vmlinux) {
 		const char *vmlinux = vmlinux_path__find_running_kernel();
 
-- 
2.49.0


             reply	other threads:[~2025-04-02 20:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02 20:35 Arnaldo Carvalho de Melo [this message]
2025-04-03 18:40 ` [PATCH 1/1] pahole: When trying to encode BTF avoid DWARF less files Alan Maguire
2025-04-04 19:22   ` Arnaldo Carvalho de Melo
2025-04-04 19:37     ` Arnaldo Carvalho de Melo
2025-04-08 10:14   ` 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=Z-2fij_hUUFYF-YQ@x1 \
    --to=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --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