All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manuel Traut <manut@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: sasha.levin@oracle.com, Manuel Traut <manut@linutronix.de>
Subject: [PATCH] scripts/decode_stacktrace.sh: prefix addr2line with $CROSS_COMPILE
Date: Wed,  9 Jan 2019 15:47:56 +0100	[thread overview]
Message-ID: <20190109144756.24202-1-manut@linutronix.de> (raw)

At least for ARM64 kernels compiled with the crosstoolchain from
Debian/stretch or with the toolchain from kernel.org the line number is not
decoded correctly by 'decode_stacktrace.sh':

$ echo "[  136.513051]  f1+0x0/0xc [kcrash]" | \
  CROSS_COMPILE=/opt/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- \
 ./scripts/decode_stacktrace.sh /scratch/linux-arm64/vmlinux \
                                /scratch/linux-arm64 \
                                /nfs/debian/lib/modules/4.20.0-devel
[  136.513051] f1 (/linux/drivers/staging/kcrash/kcrash.c:68) kcrash

If addr2line from the toolchain is used the decoded line number is correct:

[  136.513051] f1 (/linux/drivers/staging/kcrash/kcrash.c:57) kcrash

Signed-off-by: Manuel Traut <manut@linutronix.de>
---
 scripts/decode_stacktrace.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index 64220e36ce3b..2f8c30b5c85b 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -66,7 +66,7 @@ parse_symbol() {
 	if [[ "${cache[$module,$address]+isset}" == "isset" ]]; then
 		local code=${cache[$module,$address]}
 	else
-		local code=$(addr2line -i -e "$objfile" "$address")
+		local code=$(${CROSS_COMPILE}addr2line -i -e "$objfile" "$address")
 		cache[$module,$address]=$code
 	fi
 
-- 
2.20.1


             reply	other threads:[~2019-01-09 14:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 14:47 Manuel Traut [this message]
2019-05-27  8:34 [PATCH] scripts/decode_stacktrace.sh: prefix addr2line with $CROSS_COMPILE Manuel Traut
2019-05-28  8:22 ` Konstantin Khlebnikov

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=20190109144756.24202-1-manut@linutronix.de \
    --to=manut@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sasha.levin@oracle.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 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.