History

scripts/decode_stacktrace.sh: code: preserve alignment

With lines having a code to decode, the alignment was not preserved for the first line. With this sample ... [ 52.238089][ T55] RIP: 0010:__ip_queue_xmit+0x127c/0x1820 [ 52.238401][ T55] Code: c1 83 e0 07 48 c1 e9 03 83 c0 03 (...) ... the script was producing the following output: [ 52.238089][ T55] RIP: 0010:__ip_queue_xmit (...) [ 52.238401][ T55] Code: c1 83 e0 07 48 c1 e9 03 83 c0 03 (...) That's because scripts/decodecode doesn't preserve the alignment. No need to modify it, it is enough to give only the "Code: (...)" part to this script, and print the prefix without modifications. With the same sample, we now have: [ 52.238089][ T55] RIP: 0010:__ip_queue_xmit (...) [ 52.238401][ T55] Code: c1 83 e0 07 48 c1 e9 03 83 c0 03 (...)

Matthieu Baerts (NGI0) committed 1 year ago

Commit e1831e81 parent 4a2fc481 file · +3 −1Browse files

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

Unified · Split

scripts/decode_stacktrace.sh+3−1
@@ -242,8 +242,10 @@ debuginfod_get_vmlinux() { · 241 unmodified lines
242242
243243 decode_code() {
244244 local scripts=`dirname "${BASH_SOURCE[0]}"`
245+ local lim="Code: "
245246
246− echo "$1" | $scripts/decodecode
247+ echo -n "${1%%${lim}*}"
248+ echo "${lim}${1##*${lim}}" | $scripts/decodecode
247249 }
248250
249251 handle_line() {

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