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 | 6 | if [[ $# < 1 ]]; then |
| 7 | 7 | echo "Usage:" |
| 8 | − echo " $0 <vmlinux> [base path] [modules path]" | |
| 8 | + echo " $0 -r <release> | <vmlinux> [base path] [modules path]" | |
| 9 | 9 | exit 1 |
| 10 | 10 | fi |
| 11 | 11 | |
| 12 | −vmlinux=$1 | |
| 13 | −basepath=${2-auto} | |
| 14 | −modpath=$3 | |
| 15 | −release="" | |
| 12 | +if [[ $1 == "-r" ]] ; then | |
| 13 | + vmlinux="" | |
| 14 | + basepath="auto" | |
| 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 | 36 | declare -A cache |
| 18 | 37 | declare -A modcache |