Skip to content

Commit 3947c34

Browse files
committed
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: thesofproject/sof#8480 Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
1 parent a4d3f24 commit 3947c34

2 files changed

Lines changed: 3 additions & 27 deletions

File tree

case-lib/lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,9 +966,9 @@ perf_analyze()
966966
dlogi "Checking SOF component performance"
967967
if [ -e "$LOG_ROOT/mtrace.txt" ]; then
968968
if [ -e "$LOG_ROOT/dmesg.txt" ]; then
969-
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"
969+
perf_cmd="sof_perf_analyzer.py --kmsg=$LOG_ROOT/dmesg.txt --out2html $LOG_ROOT/sof_perf.html $LOG_ROOT/mtrace.txt"
970970
else
971-
perf_cmd="sof_perf_analyzer.py --skip-to-first-trace --out2html $LOG_ROOT/sof_perf.html $LOG_ROOT/mtrace.txt"
971+
perf_cmd="sof_perf_analyzer.py --out2html $LOG_ROOT/sof_perf.html $LOG_ROOT/mtrace.txt"
972972
fi
973973
dlogc "$perf_cmd"
974974
eval "$perf_cmd" || {

tools/sof_perf_analyzer.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,6 @@ def dispatch_trace_item(trace_item: TraceItem):
9696
if trace_item.func == 'comp_copy':
9797
collect_perf_info(trace_item)
9898

99-
def skip_to_first_trace(trace_item_gen: TraceItemGenerator):
100-
'''The current sof-test test case may collect some traces belonging to previous
101-
test case due to mtrace is configured in deferred mode. This function consumes
102-
those traces from the generator, and return the first trace item of current test.
103-
'''
104-
while item := next(trace_item_gen):
105-
# On test running, the SOF firmware is reloaded to DSP, timer is reset to 0.
106-
# The first trace must have a timestamp with integral part equals to 0.
107-
if int(item.timestamp) == 0:
108-
return item
109-
11099
def make_trace_item(fileio: TextIO) -> TraceItemGenerator:
111100
'''Filter and parse a line of trace in string form into TraceItem object, for example:
112101
'[ 2.566046] <inf> component: comp_copy: comp:0 0x40000 perf comp_copy samples
@@ -155,15 +144,7 @@ def process_trace_file():
155144
ts_shift = 0
156145
with open(args.filename, 'r', encoding='utf8') as file:
157146
trace_item_gen = make_trace_item(file)
158-
trace_prev = None
159-
try:
160-
if args.skip_to_first_trace:
161-
trace_prev = skip_to_first_trace(trace_item_gen)
162-
else:
163-
trace_prev = next(trace_item_gen)
164-
except StopIteration as si:
165-
si.args = ('No valid trace in provided file',)
166-
raise
147+
trace_prev = next(trace_item_gen)
167148
for trace_curr in trace_item_gen:
168149
# pylint: disable=W0603
169150
old_ts_shift = ts_shift
@@ -279,11 +260,6 @@ def parse_args():
279260
help='Output SOF performance statistics to csv file')
280261
parser.add_argument('--out2html', type=pathlib.Path, required=False,
281262
help='Output SOF performance statistics to html file')
282-
parser.add_argument('-s', '--skip-to-first-trace', action="store_true", default=False,
283-
help='''In CI test, some traces from previous test case will appear in
284-
the mtrace of current test case, this flag is used to denote if we
285-
want to skip until the first line with a timestamp between 0 and 1s.
286-
For CI test, set the flag to True''')
287263

288264
return parser.parse_args()
289265

0 commit comments

Comments
 (0)