mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-31 15:12:25 +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:
		| @@ -274,11 +274,14 @@ class TraceCmdTrace(object): | |||||||
|                     elif TRACE_MARKER_STOP in line: |                     elif TRACE_MARKER_STOP in line: | ||||||
|                         break |                         break | ||||||
|  |  | ||||||
|  |                 if 'EVENTS DROPPED' in line: | ||||||
|                     match = DROPPED_EVENTS_REGEX.search(line) |                     match = DROPPED_EVENTS_REGEX.search(line) | ||||||
|                     if match: |                     if match: | ||||||
|                         yield DroppedEventsEvent(match.group('cpu_id')) |                         yield DroppedEventsEvent(match.group('cpu_id')) | ||||||
|                         continue |                         continue | ||||||
|  |  | ||||||
|  |                 if line.startswith('version') or line.startswith('cpus') or\ | ||||||
|  |                         line.startswith('CPU:'): | ||||||
|                     matched = False |                     matched = False | ||||||
|                     for rx in [HEADER_REGEX, EMPTY_CPU_REGEX]: |                     for rx in [HEADER_REGEX, EMPTY_CPU_REGEX]: | ||||||
|                         match = rx.search(line) |                         match = rx.search(line) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user