From: Evan Green Date: Fri, 12 Jul 2019 03:52:39 +0000 (-0700) Subject: scripts/decode_stacktrace: Accept dash/underscore in modules X-Git-Tag: v5.3-rc1~120^2~135 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ca90bbd410a1dc4b607210a5483786726043e9ec;p=users%2Fjedix%2Flinux-maple.git scripts/decode_stacktrace: Accept dash/underscore in modules 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/20190531205926.42474-1-evgreen@chromium.org Signed-off-by: Evan Green Reviewed-by: Douglas Anderson Acked-by: Konstantin Khlebnikov Cc: Stephen Rothwell Cc: Douglas Anderson Cc: Evan Green Cc: Nicolas Boichat Cc: Marc Zyngier Cc: Manuel Traut Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index fa704f17275e..13e5fbafdf2f 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh @@ -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