aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/decode_stacktrace.sh
diff options
context:
space:
mode:
authorSasha Levin <sashal@kernel.org>2020-06-15 18:24:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2020-06-15 15:37:24 -0700
commita5dc8300df75e8b8384b4c82225f1e4a0b4d9b55 (patch)
treeec21a14434f3c1f246d196f03ebc91bbb6cf912b /scripts/decode_stacktrace.sh
parentMerge tag 'ext4-for-linus-5.8-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 (diff)
downloadlinux-dev-a5dc8300df75e8b8384b4c82225f1e4a0b4d9b55.tar.xz
linux-dev-a5dc8300df75e8b8384b4c82225f1e4a0b4d9b55.zip
scripts/decode_stacktrace: warn when modpath is needed but is unset
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/decode_stacktrace.sh')
-rwxr-xr-xscripts/decode_stacktrace.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index 13e5fbafdf2f..66a6d511b524 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