diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2025-04-05 09:04:35 +0300 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2025-04-05 09:04:35 +0300 |
| commit | 946661e3bef8efa11ba8079d4ebafe6fc3b0aaad (patch) | |
| tree | a90605abb7bb65503a2d3f93a79e19a01aaa5e89 /scripts/decode_stacktrace.sh | |
| parent | fd10709e28d2fa9015667aee56d92099fc97aa0d (diff) | |
| parent | 4d395cb071a343196ca524d3694790f06978fe91 (diff) | |
| download | linux-946661e3bef8efa11ba8079d4ebafe6fc3b0aaad.tar.xz | |
Merge branch 'next' into for-linus
Prepare input updates for 6.15 merge window.
Diffstat (limited to 'scripts/decode_stacktrace.sh')
| -rwxr-xr-x | scripts/decode_stacktrace.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index 46fa18b80fc1..17abc4e7a985 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh @@ -286,6 +286,18 @@ handle_line() { last=$(( $last - 1 )) fi + # Extract info after the symbol if present. E.g.: + # func_name+0x54/0x80 (P) + # ^^^ + # The regex assumes only uppercase letters will be used. To be + # extended if needed. + local info_str="" + if [[ ${words[$last]} =~ \([A-Z]*\) ]]; then + info_str=${words[$last]} + unset words[$last] + last=$(( $last - 1 )) + fi + if [[ ${words[$last]} =~ \[([^]]+)\] ]]; then module=${words[$last]} # some traces format is "(%pS)", which like "(foo+0x0/0x1 [bar])" @@ -313,9 +325,9 @@ handle_line() { # Add up the line number to the symbol if [[ -z ${module} ]] then - echo "${words[@]}" "$symbol" + echo "${words[@]}" "$symbol ${info_str}" else - echo "${words[@]}" "$symbol $module" + echo "${words[@]}" "$symbol $module ${info_str}" fi } |
