Skip to content

Commit

Permalink
scripts/decode_stacktrace: Accept dash/underscore in modules
Browse files Browse the repository at this point in the history
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.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Evan Green <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Acked-by: Konstantin Khlebnikov <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Cc: Douglas Anderson <[email protected]>
Cc: Evan Green <[email protected]>
Cc: Nicolas Boichat <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Manuel Traut <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Evan Green authored and torvalds committed Jul 12, 2019
1 parent 85f946f commit ca90bbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/decode_stacktrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca90bbd

Please sign in to comment.