Add option decode_stacktrace -r <release> to specify only release name. This is enough to guess standard paths to vmlinux and modules: $ echo -e 'schedule+0x0/0x0 tap_open+0x0/0x0 [tap]' | ./scripts/decode_stacktrace.sh -r 5.4.0-37-generic schedule (kernel/sched/core.c:4138) tap_open (drivers/net/tap.c:502) tap
Showing the changes to scripts/decode_stacktrace.sh (1 of 1 file). Show all
Unified · Split
| @@ -5,14 +5,33 @@ · 4 unmodified lines | |||
| 5 | 5 | ||
| 6 | if [[ $# < 1 ]]; then | 6 | if [[ $# < 1 ]]; then |
| 7 | echo "Usage:" | 7 | echo "Usage:" |
| 8 | echo " $0 <vmlinux> [base path] [modules path]" | 8 | echo " $0 -r <release> | <vmlinux> [base path] [modules path]" |
| 9 | exit 1 | 9 | exit 1 |
| 10 | fi | 10 | fi |
| 11 | 11 | ||
| 12 | vmlinux=$1 | 12 | if [[ $1 == "-r" ]] ; then |
| 13 | basepath=${2-auto} | 13 | vmlinux="" |
| 14 | modpath=$3 | 14 | basepath="auto" |
| 15 | release="" | 15 | modpath="" |
| 16 | release=$2 | ||
| 17 | |||
| 18 | for fn in {,/usr/lib/debug}/boot/vmlinux-$release{,.debug} /lib/modules/$release{,/build}/vmlinux ; do | ||
| 19 | if [ -e "$fn" ] ; then | ||
| 20 | vmlinux=$fn | ||
| 21 | break | ||
| 22 | fi | ||
| 23 | done | ||
| 24 | |||
| 25 | if [[ $vmlinux == "" ]] ; then | ||
| 26 | echo "ERROR! vmlinux image for release $release is not found" >&2 | ||
| 27 | exit 2 | ||
| 28 | fi | ||
| 29 | else | ||
| 30 | vmlinux=$1 | ||
| 31 | basepath=${2-auto} | ||
| 32 | modpath=$3 | ||
| 33 | release="" | ||
| 34 | fi | ||
| 16 | 35 | ||
| 17 | declare -A cache | 36 | declare -A cache |
| 18 | declare -A modcache | 37 | declare -A modcache |