Skip to content

Commit

Permalink
scripts/decode_stacktrace: warn when modpath is needed but is unset
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Sasha Levin authored and torvalds committed Jun 15, 2020
1 parent 3be20b6 commit a5dc830
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/decode_stacktrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a5dc830

Please sign in to comment.