]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - scripts/decode_stacktrace.sh
scripts/decode_stacktrace.sh: strip unexpected CR from lines
authorBjorn Andersson <quic_bjorande@quicinc.com>
Mon, 25 Dec 2023 17:40:35 +0000 (09:40 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 Dec 2023 20:22:31 +0000 (12:22 -0800)
commit436efd9e4b657b8b659c7f482f7106e521b09891
tree1f02af6882b71459884512e28398f8b55a2d8e29
parent55efe4abf927aca3692870a1851067f309e9a374
scripts/decode_stacktrace.sh: strip unexpected CR from lines

When the kernel log is acquired over a serial cable it is not uncommon for
the log to contain carriage return characters, in addition to the expected
line feeds.

When this output is feed into decode_stacktrace.sh, handle_line() fails to
strip the trailing ']' off the module name, which results in find_module()
not being able to find the referred to kernel module.  This is reported to
the user as:

  WARNING! Modules path isn't set, but is needed to parse this symbol

The solution is to reconfigure the serial port, or to strip the carriage
returns from the log, but this isn't obvious from the error reported by
the script.

Instead, make decode_stacktrace.sh more user friendly by stripping the
trailing carriage return.

Link: https://lkml.kernel.org/r/20231225-decode-stacktrace-cr-v1-1-9f306f38cdde@quicinc.com
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/decode_stacktrace.sh