From 045f844868b9788c88ce8fe0ddbc7a6d92b8577d Mon Sep 17 00:00:00 2001 From: Baofeng Tian Date: Wed, 10 Jan 2024 17:03:40 +0800 Subject: [PATCH] tools: sof_perf_analyzer: remove skip to first trace option CI performance test is failing in recent daily build, this is due to timestamp are aligned between kernel and SOF, details are listed in below link. The firmware timestamp is in sync with the host side now, and becomes much more deterministic. The condition to use --skip-to-first-trace option in CI is eliminated (see the help info for the reason it is used in CI test). Based on this, skip-to-first-trace are not needed anymore, hence remove it from the script. Link: https://github.com/thesofproject/sof/pull/8480 Signed-off-by: Baofeng Tian --- case-lib/lib.sh | 4 ++-- tools/sof_perf_analyzer.py | 15 +-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 79c811ff..2f1a6f2e 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -966,9 +966,9 @@ perf_analyze() dlogi "Checking SOF component performance" if [ -e "$LOG_ROOT/mtrace.txt" ]; then if [ -e "$LOG_ROOT/dmesg.txt" ]; then - perf_cmd="sof_perf_analyzer.py --skip-to-first-trace --kmsg=$LOG_ROOT/dmesg.txt --out2html $LOG_ROOT/sof_perf.html $LOG_ROOT/mtrace.txt" + perf_cmd="sof_perf_analyzer.py --kmsg=$LOG_ROOT/dmesg.txt --out2html $LOG_ROOT/sof_perf.html $LOG_ROOT/mtrace.txt" else - perf_cmd="sof_perf_analyzer.py --skip-to-first-trace --out2html $LOG_ROOT/sof_perf.html $LOG_ROOT/mtrace.txt" + perf_cmd="sof_perf_analyzer.py --out2html $LOG_ROOT/sof_perf.html $LOG_ROOT/mtrace.txt" fi dlogc "$perf_cmd" eval "$perf_cmd" || { diff --git a/tools/sof_perf_analyzer.py b/tools/sof_perf_analyzer.py index 471ed773..601963d7 100755 --- a/tools/sof_perf_analyzer.py +++ b/tools/sof_perf_analyzer.py @@ -155,15 +155,7 @@ def process_trace_file(): ts_shift = 0 with open(args.filename, 'r', encoding='utf8') as file: trace_item_gen = make_trace_item(file) - trace_prev = None - try: - if args.skip_to_first_trace: - trace_prev = skip_to_first_trace(trace_item_gen) - else: - trace_prev = next(trace_item_gen) - except StopIteration as si: - si.args = ('No valid trace in provided file',) - raise + trace_prev = next(trace_item_gen) for trace_curr in trace_item_gen: # pylint: disable=W0603 old_ts_shift = ts_shift @@ -279,11 +271,6 @@ def parse_args(): help='Output SOF performance statistics to csv file') parser.add_argument('--out2html', type=pathlib.Path, required=False, help='Output SOF performance statistics to html file') - parser.add_argument('-s', '--skip-to-first-trace', action="store_true", default=False, - help='''In CI test, some traces from previous test case will appear in -the mtrace of current test case, this flag is used to denote if we -want to skip until the first line with a timestamp between 0 and 1s. -For CI test, set the flag to True''') return parser.parse_args()