Skip to content

Commit

Permalink
scripts: decode_stacktrace: fix ARM architecture decoding
Browse files Browse the repository at this point in the history
Fix the stack decoder for the ARM architecture.
An ARM stack is designed as :

[   81.547704] [<c023eb04>] (bucket_find_contain) from [<c023ec88>] (check_sync+0x40/0x4f8)
[   81.559668] [<c023ec88>] (check_sync) from [<c023f8c4>] (debug_dma_sync_sg_for_cpu+0x128/0x194)
[   81.571583] [<c023f8c4>] (debug_dma_sync_sg_for_cpu) from [<c0327dec>] (__videobuf_s

The current script doesn't expect the symbols to be bound by
parenthesis, and triggers the following errors :

  awk: cmd. line:1: error: Unmatched ( or \(: / (check_sync$/
  [   81.547704] (bucket_find_contain) from (check_sync+0x40/0x4f8)

Fix it by chopping starting and ending parenthesis from the each symbol
name.

As a side note, this probably comes from the function
dump_backtrace_entry(), which is implemented differently for each
architecture.  That makes a single decoding script a bit a challenge.

Signed-off-by: Robert Jarzmik <[email protected]>
Cc: Sasha Levin <[email protected]>
Cc: Russell King <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rjarzmik authored and torvalds committed Sep 4, 2015
1 parent fa70900 commit e260fe0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/decode_stacktrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ declare -A cache

parse_symbol() {
# The structure of symbol at this point is:
# [name]+[offset]/[total length]
# ([name]+[offset]/[total length])
#
# For example:
# do_basic_setup+0x9c/0xbf

# Remove the englobing parenthesis
symbol=${symbol#\(}
symbol=${symbol%\)}

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

0 comments on commit e260fe0

Please sign in to comment.