All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/decode_stacktrace.sh: prefix addr2line with $CROSS_COMPILE
@ 2019-05-27  8:34 Manuel Traut
  2019-05-28  8:22 ` Konstantin Khlebnikov
  0 siblings, 1 reply; 3+ messages in thread
From: Manuel Traut @ 2019-05-27  8:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, marc.zyngier, khlebnikov, Manuel Traut

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 bcdd45df3f51..a7a36209a193 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -73,7 +73,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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scripts/decode_stacktrace.sh: prefix addr2line with $CROSS_COMPILE
  2019-05-27  8:34 [PATCH] scripts/decode_stacktrace.sh: prefix addr2line with $CROSS_COMPILE Manuel Traut
@ 2019-05-28  8:22 ` Konstantin Khlebnikov
  0 siblings, 0 replies; 3+ messages in thread
From: Konstantin Khlebnikov @ 2019-05-28  8:22 UTC (permalink / raw)
  To: manut, linux-kernel; +Cc: akpm, marc.zyngier, Manuel Traut



On 27.05.2019 11:34, Manuel Traut wrote:
> 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>

Acked-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>


> ---
>   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 bcdd45df3f51..a7a36209a193 100755
> --- a/scripts/decode_stacktrace.sh
> +++ b/scripts/decode_stacktrace.sh
> @@ -73,7 +73,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
>   
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] scripts/decode_stacktrace.sh: prefix addr2line with $CROSS_COMPILE
@ 2019-01-09 14:47 Manuel Traut
  0 siblings, 0 replies; 3+ messages in thread
From: Manuel Traut @ 2019-01-09 14:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: sasha.levin, Manuel Traut

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-28  8:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-27  8:34 [PATCH] scripts/decode_stacktrace.sh: prefix addr2line with $CROSS_COMPILE Manuel Traut
2019-05-28  8:22 ` Konstantin Khlebnikov
  -- strict thread matches above, loose matches on Subject: below --
2019-01-09 14:47 Manuel Traut

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.