mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Srikar Dronamraju <srikar@linux.ibm.com>
Cc: Brian Johannesmeyer <bjohannesmeyer@gmail.com>,
	 Madhavan Srinivasan <maddy@linux.ibm.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Revert "scripts/faddr2line: Combine three readelf calls into one"
Date: Mon, 14 Sep 2026 12:00:26 -0700	[thread overview]
Message-ID: <aqhDm60zSZIazrnC@jpoimboe> (raw)
In-Reply-To: <20260905012449.3872882-2-srikar@linux.ibm.com>

On Sat, Sep 05, 2026 at 06:54:49AM +0530, Srikar Dronamraju wrote:
> This reverts commit b8d9d9496c1e ("scripts/faddr2line: Combine three
> readelf calls into one")
> 
> scripts/faddr2line stopped working on PowerPc systems with this commit.
> 
> Output  of scripts/faddr2line on latest kernel sources
> $ scripts/faddr2line ./vmlinux need_active_balance+0x1d4/0x21c
> $
> Output of scripts/faddr2line with revert
> $ scripts/faddr2line ./vmlinux need_active_balance+0x1d4/0x21c
> need_active_balance+0x1d4/0x21c:
> imbalanced_active_balance at kernel/sched/fair.c:12047
> (inlined by) need_active_balance at kernel/sched/fair.c:12061
> $
> 
> readelf on Powerpc when passed with --file-header --section-headers
> --symbol --wide option doesnt show the line
>  "There are 62 section headers, starting at offset 0x16f1a850:"
> 
> Hence faddr2line parsing gets broken.
> 
> It could be a bug in Powerpc readelf that this line doesnt get printed.
> However since its breaking with existing readelf, its better to be
> reverted.
> 
> With the revert, we end up calling readelf three times but this should
> still be fine since calling faddr2line is a debug tool.
> 
> Fixes: b8d9d9496c1e ("scripts/faddr2line: Combine three readelf calls into one")
> Signed-off-by: Srikar Dronamraju <srikar@linux.ibm.com>

Can you run

  bash -x scripts/faddr2line ./vmlinux need_active_balance+0x1d4/0x21c

to see what line it's failing at?

Any chance the below fixes it?

diff --git a/scripts/faddr2line b/scripts/faddr2line
index 622875396bcfc..550c0f9b9d473 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -78,7 +78,7 @@ GREP="grep"
 
 # Enforce ASCII-only output from tools like readelf
 # ensuring sed processes strings correctly.
-export LANG=C
+export LC_ALL=C
 
 command -v ${AWK} >/dev/null 2>&1 || die "${AWK} isn't installed"
 command -v ${READELF} >/dev/null 2>&1 || die "${READELF} isn't installed"

  reply	other threads:[~2026-09-14 19:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-05  1:24 Srikar Dronamraju
2026-09-14 19:00 ` Josh Poimboeuf [this message]
2026-09-15  2:15   ` Srikar Dronamraju

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=aqhDm60zSZIazrnC@jpoimboe \
    --to=jpoimboe@kernel.org \
    --cc=bjohannesmeyer@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=srikar@linux.ibm.com \
    /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

all inboxes | Powered by JetHome®