linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: torvalds@linux-foundation.org
Cc: skhan@linuxfoundation.org, koct9i@gmail.com, jroedel@suse.de,
	luto@kernel.org, peterz@infradead.org, tiwai@suse.com,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH] scripts/decode_stacktrace: warn when modpath is needed but is unset
Date: Mon, 15 Jun 2020 18:24:27 -0400	[thread overview]
Message-ID: <20200615222427.60126-1-sashal@kernel.org> (raw)
In-Reply-To: <CAHk-=wgB6xs-gfihkMSngyAcRHaQ0oE3jVawVMzzAh4Xm0VsSQ@mail.gmail.com>

When a user tries to parse a symbol located inside a module he must have
modpath set. Otherwise, decode_stacktrace won't be able to parse the
symbol correctly.

Right now the failure is silent and easily missed by the user. What's
worse is that by the time the user realizes what happened (or someone on
LKML asks him to add the modpath and re-run), he might have already got
rid of the vmlinux/modules.

Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 scripts/decode_stacktrace.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index 13e5fbafdf2f..2c9ee4beb545 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -27,7 +27,10 @@ parse_symbol() {
 	elif [[ "${modcache[$module]+isset}" == "isset" ]]; then
 		local objfile=${modcache[$module]}
 	else
-		[[ $modpath == "" ]] && return
+		if [[ $modpath == "" ]]; then
+			echo "WARNING! Modules path isn't set, but is needed to parse this symbol" >&2
+			return
+		fi
 		local objfile=$(find "$modpath" -name "${module//_/[-_]}.ko*" -print -quit)
 		[[ $objfile == "" ]] && return
 		modcache[$module]=$objfile
-- 
2.25.1


  parent reply	other threads:[~2020-06-15 22:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 18:48 Linux 5.8-rc1 BUG unable to handle page fault (snd_pcm) Shuah Khan
2020-06-15 19:47 ` David Rientjes
2020-06-15 19:48 ` Linus Torvalds
2020-06-15 20:41   ` Shuah Khan
2020-06-15 20:55     ` Linus Torvalds
2020-06-15 21:18       ` Shuah Khan
2020-06-15 22:23         ` Linus Torvalds
2020-06-15 22:24       ` Sasha Levin [this message]
2020-06-15 22:37         ` [PATCH] scripts/decode_stacktrace: warn when modpath is needed but is unset Linus Torvalds
2020-06-15 22:43           ` Linus Torvalds
2020-06-15 23:24             ` Sasha Levin
2020-06-15 19:57 ` Linux 5.8-rc1 BUG unable to handle page fault (snd_pcm) Takashi Iwai
2020-06-15 20:53   ` Shuah Khan
2020-06-15 21:04     ` Shuah Khan

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=20200615222427.60126-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=jroedel@suse.de \
    --cc=koct9i@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tiwai@suse.com \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).