mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-27 14:14:37 +08:00
trace: Improve the trace test number recognition
The awk tool can be confused by return character (ASCII 13) in its input since it thinks there is a separate field. These can appear if the terminal is in raw mode, perhaps due to a previous U-Boot crash with sandbox. This is very confusing. Remove these so that the trace test passes. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
83cc112e82
commit
f91281b1eb
@ -45,7 +45,9 @@ check_results() {
|
||||
# between calls 2 and 3, where tracing is paused.
|
||||
# This code gets the sign of the difference between each number and
|
||||
# its predecessor.
|
||||
counts="$(tr -d , <${tmp} | awk '/traced function calls/ { diff = $1 - upto; upto = $1; printf "%d ", diff < 0 ? -1 : (diff > 0 ? 1 : 0)}')"
|
||||
counts="$(tr -d ',\r' <${tmp} | awk \
|
||||
'/traced function calls/ { diff = $1 - upto; upto = $1; \
|
||||
printf "%d ", diff < 0 ? -1 : (diff > 0 ? 1 : 0)}')"
|
||||
|
||||
if [ "${counts}" != "1 1 0 1 " ]; then
|
||||
fail "trace collection error: ${counts}"
|
||||
|
Loading…
Reference in New Issue
Block a user