From b127ff9405528c67b11e329d9fb74758787192f5 Mon Sep 17 00:00:00 2001 From: Emilia Kurdybelska Date: Tue, 7 Apr 2026 12:02:42 +0200 Subject: [PATCH] fix: tools: sof_perf_analyzer: ignore errors when decoding mtrace file Ignore faulty lines in mtrace file when analyzing it with sof_perf_analyzer.py script Signed-off-by: Emilia Kurdybelska --- case-lib/hijack.sh | 5 +---- case-lib/lib.sh | 4 ++-- tools/sof_perf_analyzer.py | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/case-lib/hijack.sh b/case-lib/hijack.sh index f1d1b8a7..4a40ff36 100644 --- a/case-lib/hijack.sh +++ b/case-lib/hijack.sh @@ -169,10 +169,7 @@ function func_exit_handler() # Only do performance analysis on test passed [ "x$exit_status" != "x0" ] || { - # On performance analysis return error, set exit code - if ! perf_analyze; then - exit_status=1 - fi + perf_analyze || dlogw 'perf_analyze failed in exit handler' } # Only run when changing topology was initiated during the test diff --git a/case-lib/lib.sh b/case-lib/lib.sh index c29482c2..d52343c9 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -1496,11 +1496,11 @@ perf_analyze() fi dlogc "$perf_cmd" eval "$perf_cmd" || { - dloge "SOF component performace analysis tool exit with error" + dlogw "SOF component performace analysis tool exit with error" return 1 } else - dloge "Firmware trace file not found" + dlogw "Firmware trace file not found" return 1 fi } diff --git a/tools/sof_perf_analyzer.py b/tools/sof_perf_analyzer.py index d75f1e13..93cf7bfa 100755 --- a/tools/sof_perf_analyzer.py +++ b/tools/sof_perf_analyzer.py @@ -173,7 +173,7 @@ def process_trace_file(): # # pylint: disable=C0103 ts_shift = 0 - with open(args.filename, 'r', encoding='utf8') as file: + with open(args.filename, 'r', encoding='utf8', errors='ignore') as file: trace_item_gen = make_trace_item(file) trace_prev = None try: