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
5 5
6if [[ $# < 1 ]]; then6if [[ $# < 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 19 exit 1
10fi10fi
11 11
12vmlinux=$112if [[ $1 == "-r" ]] ; then
13basepath=${2-auto}13 vmlinux=""
14modpath=$314 basepath="auto"
15release=""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
29else
30 vmlinux=$1
31 basepath=${2-auto}
32 modpath=$3
33 release=""
34fi
16 35
17declare -A cache36declare -A cache
18declare -A modcache37declare -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