1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-21 20:38:57 +00:00

utils/trace_cmd: reduce regex use

Do not attempt to regex match each line for dropped events/preamble. Use
substring search to detect them first, and only use regex on relevant
lines.
This commit is contained in:
Sergei Trofimov 2017-07-20 11:01:14 +01:00
parent 93dba8b35d
commit 33874a8f71

View File

@ -274,11 +274,14 @@ class TraceCmdTrace(object):
elif TRACE_MARKER_STOP in line:
break
if 'EVENTS DROPPED' in line:
match = DROPPED_EVENTS_REGEX.search(line)
if match:
yield DroppedEventsEvent(match.group('cpu_id'))
continue
if line.startswith('version') or line.startswith('cpus') or\
line.startswith('CPU:'):
matched = False
for rx in [HEADER_REGEX, EMPTY_CPU_REGEX]:
match = rx.search(line)