LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: Evan Green <evgreen@chromium.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Douglas Anderson <dianders@chromium.org>,
	linux-kernel@vger.kernel.org,
	Nicolas Boichat <drinkcat@chromium.org>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Manuel Traut <manut@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] scripts/decode_stacktrace: Accept dash/underscore in modules
Date: Mon, 3 Jun 2019 10:51:04 +0300	[thread overview]
Message-ID: <f9d0688c-246b-70b9-cdac-062dd9d329b2@yandex-team.ru> (raw)
In-Reply-To: <20190531205926.42474-1-evgreen@chromium.org>

On 31.05.2019 23:59, Evan Green wrote:
> The manpage for modprobe mentions that dashes and underscores are
> treated interchangeably in module names. The stack trace dumps seem
> to print module names with underscores. Use bash to replace _ with
> the pattern [-_] so that file names with dashes or underscores can be
> found.
> 
> For example, this line:
> [   27.919759]  hda_widget_sysfs_init+0x2b8/0x3a5 [snd_hda_core]
> 
> should find a module named snd-hda-core.ko.
> 
> Signed-off-by: Evan Green <evgreen@chromium.org>

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

> ---
> 
> Note: This should apply atop linux-next.
> 
> Thanks to Doug for showing me the bash string substitution magic.
> 
> ---
>   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 fa704f17275e..13e5fbafdf2f 100755
> --- a/scripts/decode_stacktrace.sh
> +++ b/scripts/decode_stacktrace.sh
> @@ -28,7 +28,7 @@ parse_symbol() {
>   		local objfile=${modcache[$module]}
>   	else
>   		[[ $modpath == "" ]] && return
> -		local objfile=$(find "$modpath" -name "$module.ko*" -print -quit)
> +		local objfile=$(find "$modpath" -name "${module//_/[-_]}.ko*" -print -quit)
>   		[[ $objfile == "" ]] && return
>   		modcache[$module]=$objfile
>   	fi
> 

      parent reply	other threads:[~2019-06-03  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 20:59 Evan Green
2019-05-31 21:01 ` Doug Anderson
2019-06-03  7:51 ` Konstantin Khlebnikov [this message]

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=f9d0688c-246b-70b9-cdac-062dd9d329b2@yandex-team.ru \
    --to=khlebnikov@yandex-team.ru \
    --cc=akpm@linux-foundation.org \
    --cc=dianders@chromium.org \
    --cc=drinkcat@chromium.org \
    --cc=evgreen@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manut@linutronix.de \
    --cc=marc.zyngier@arm.com \
    --cc=sfr@canb.auug.org.au \
    --subject='Re: [PATCH] scripts/decode_stacktrace: Accept dash/underscore in modules' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).