Skip to content

Commit a5dc830

Browse files
Sasha Levintorvalds
authored andcommitted
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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 3be20b6 commit a5dc830

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/decode_stacktrace.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ parse_symbol() {
2727
elif [[ "${modcache[$module]+isset}" == "isset" ]]; then
2828
local objfile=${modcache[$module]}
2929
else
30-
[[ $modpath == "" ]] && return
30+
if [[ $modpath == "" ]]; then
31+
echo "WARNING! Modules path isn't set, but is needed to parse this symbol" >&2
32+
return
33+
fi
3134
local objfile=$(find "$modpath" -name "${module//_/[-_]}.ko*" -print -quit)
3235
[[ $objfile == "" ]] && return
3336
modcache[$module]=$objfile

0 commit comments

Comments
 (0)