Skip to content

Commit

Permalink
scripts/decode_stacktrace.sh: handle RIP address with segment
Browse files Browse the repository at this point in the history
decode line:

  RIP: 0010:khugepaged+0x2a2/0x2280

into

  RIP: 0010:khugepaged (mm/khugepaged.c:1885)

Link: http://lkml.kernel.org/r/154660071227.52726.15645307951282727605.stgit@buzz
Signed-off-by: Konstantin Khlebnikov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
koct9i authored and torvalds committed Mar 6, 2019
1 parent 5c0198b commit 1d6693f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/decode_stacktrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ parse_symbol() {
symbol=${symbol#\(}
symbol=${symbol%\)}

# Strip segment
local segment
if [[ $symbol == *:* ]] ; then
segment=${symbol%%:*}:
symbol=${symbol#*:}
fi

# Strip the symbol name so that we could look it up
local name=${symbol%+*}

Expand Down Expand Up @@ -84,7 +91,7 @@ parse_symbol() {
code=${code//$'\n'/' '}

# Replace old address with pretty line numbers
symbol="$name ($code)"
symbol="$segment$name ($code)"
}

decode_code() {
Expand Down

0 comments on commit 1d6693f

Please sign in to comment.