History

scripts/decode_stacktrace.sh: guess path to vmlinux by release name

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

Konstantin Khlebnikov committed 6 years ago

Commit f90dde41 parent 431151b1 file · +24 −5Browse files

Showing the changes to scripts/decode_stacktrace.sh (1 of 1 file). Show all

Unified · Split

scripts/decode_stacktrace.sh+24−5
@@ -5,14 +5,33 @@ · 4 unmodified lines
55
66 if [[ $# < 1 ]]; then
77 echo "Usage:"
8− echo " $0 <vmlinux> [base path] [modules path]"
8+ echo " $0 -r <release> | <vmlinux> [base path] [modules path]"
99 exit 1
1010 fi
1111
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
1635
1736 declare -A cache
1837 declare -A modcache

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t