mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Elliot Berman <quic_eberman@quicinc.com>
To: Xiong Nandi <xndchn@gmail.com>
Cc: <akpm@linux-foundation.org>, <linux-kernel@vger.kernel.org>,
	<quic_bjorande@quicinc.com>, <cmllamas@google.com>
Subject: Re: [PATCH v2 1/2] scripts/decode_stacktrace.sh: wrap nm with UTIL_PREFIX and UTIL_SUFFIX
Date: Wed, 22 May 2024 18:56:34 -0700	[thread overview]
Message-ID: <20240522185039245-0700.eberman@hu-eberman-lv.qualcomm.com> (raw)
In-Reply-To: <20240523010318.12934-2-xndchn@gmail.com>

On Thu, May 23, 2024 at 09:03:17AM +0800, Xiong Nandi wrote:
> Since System.map is generated by cross-compile nm tool, we should use it here
> too. Otherwise host nm may not recognize ARM Thumb-2 instruction address well.
> 
> Signed-off-by: Xiong Nandi <xndchn@gmail.com>

Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>

> ---
>  scripts/decode_stacktrace.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
> index fa5be6f57b00..2bc3a54ffba5 100755
> --- a/scripts/decode_stacktrace.sh
> +++ b/scripts/decode_stacktrace.sh
> @@ -30,6 +30,7 @@ fi
>  
>  READELF=${UTIL_PREFIX}readelf${UTIL_SUFFIX}
>  ADDR2LINE=${UTIL_PREFIX}addr2line${UTIL_SUFFIX}
> +NM=${UTIL_PREFIX}nm${UTIL_SUFFIX}
>  
>  if [[ $1 == "-r" ]] ; then
>  	vmlinux=""
> @@ -158,7 +159,7 @@ parse_symbol() {
>  	if [[ $aarray_support == true && "${cache[$module,$name]+isset}" == "isset" ]]; then
>  		local base_addr=${cache[$module,$name]}
>  	else
> -		local base_addr=$(nm "$objfile" 2>/dev/null | awk '$3 == "'$name'" && ($2 == "t" || $2 == "T") {print $1; exit}')
> +		local base_addr=$(${NM} "$objfile" 2>/dev/null | awk '$3 == "'$name'" && ($2 == "t" || $2 == "T") {print $1; exit}')
>  		if [[ $base_addr == "" ]] ; then
>  			# address not found
>  			return
> -- 
> 2.25.1
> 

  reply	other threads:[~2024-05-23  1:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21  0:56 [PATCH] scripts/decode_stacktrace.sh: better support to ARM32 module stack trace xndcn
2024-05-22  1:05 ` Xiong Nandi
2024-05-22  2:48   ` Elliot Berman
2024-05-22  4:10     ` xndcn
2024-05-23  1:03     ` [PATCH v2 0/2] scripts/decode_stacktrace.sh: better support to ARM32 Xiong Nandi
2024-05-23  1:03       ` [PATCH v2 1/2] scripts/decode_stacktrace.sh: wrap nm with UTIL_PREFIX and UTIL_SUFFIX Xiong Nandi
2024-05-23  1:56         ` Elliot Berman [this message]
2024-05-23  1:03       ` [PATCH v2 2/2] scripts/decode_stacktrace.sh: better support to ARM32 module stack trace Xiong Nandi
2024-05-23  2:00         ` Elliot Berman

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=20240522185039245-0700.eberman@hu-eberman-lv.qualcomm.com \
    --to=quic_eberman@quicinc.com \
    --cc=akpm@linux-foundation.org \
    --cc=cmllamas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_bjorande@quicinc.com \
    --cc=xndchn@gmail.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®