mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 20:38:57 +00:00
Fix message regex in uxperf result processor
The logcat output differs between devices. Modify the regex pattern to accommodate different output formats when matching UX_PERF markers.
This commit is contained in:
parent
1ec7961b0e
commit
73c2609a72
@ -123,14 +123,7 @@ class UxPerfParser(object):
|
|||||||
self.logger = logging.getLogger('UxPerfParser')
|
self.logger = logging.getLogger('UxPerfParser')
|
||||||
|
|
||||||
# regex for matching logcat message format:
|
# regex for matching logcat message format:
|
||||||
# date time PID-TID/package priority/tag: message
|
self.regex = re.compile(r'UX_PERF.*?:\s*(?P<message>.*\d+$)')
|
||||||
self.regex = re.compile(r'(?P<date>\d{2}-\d{2})\s+'
|
|
||||||
'(?P<time>\d{2}:\d{2}:\d{2}\.\d{3})\s+'
|
|
||||||
'(?P<PID>\d+)\s+'
|
|
||||||
'(?P<TID>\d+)\s+'
|
|
||||||
'(?P<priority>\w)\s+'
|
|
||||||
'(?P<tag>\w+)\s+:\s+'
|
|
||||||
'(?P<message>.*$)')
|
|
||||||
|
|
||||||
def parse(self, log):
|
def parse(self, log):
|
||||||
'''
|
'''
|
||||||
@ -200,14 +193,13 @@ class UxPerfParser(object):
|
|||||||
Yields tuple containing action and timestamp.
|
Yields tuple containing action and timestamp.
|
||||||
'''
|
'''
|
||||||
for line in lines:
|
for line in lines:
|
||||||
match = self.regex.match(line)
|
match = self.regex.search(line)
|
||||||
|
|
||||||
if match:
|
if match:
|
||||||
if match.group('tag') == 'UX_PERF':
|
message = match.group('message')
|
||||||
message = match.group('message')
|
action_with_suffix, timestamp = message.rsplit(' ', 1)
|
||||||
action_with_suffix, timestamp = message.rsplit(' ', 1)
|
action, _ = action_with_suffix.rsplit('_', 1)
|
||||||
action, _ = action_with_suffix.rsplit('_', 1)
|
yield action, timestamp
|
||||||
yield action, timestamp
|
|
||||||
|
|
||||||
def _group_timestamps(self, markers):
|
def _group_timestamps(self, markers):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user