From 95c3f049fbd6a7376392b55a9fc9c427414738f9 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Mon, 17 Aug 2015 12:37:58 +0100 Subject: [PATCH] trace_cmd: handle trace headers and thread names with spaces --- wlauto/utils/trace_cmd.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wlauto/utils/trace_cmd.py b/wlauto/utils/trace_cmd.py index 9e5162ae..8887cc97 100644 --- a/wlauto/utils/trace_cmd.py +++ b/wlauto/utils/trace_cmd.py @@ -173,9 +173,11 @@ def regex_body_parser(regex, flags=0): EVENT_PARSER_MAP = { } -TRACE_EVENT_REGEX = re.compile(r'^\s+(?P\S+)\s+\[(?P\d+)\]\s+(?P[\d.]+):\s+' +TRACE_EVENT_REGEX = re.compile(r'^\s+(?P\S+.*?\S+)\s+\[(?P\d+)\]\s+(?P[\d.]+):\s+' r'(?P[^:]+):\s+(?P.*?)\s*$') +HEADER_REGEX = re.compile(r'^\s*(?:version|cpus)\s*=\s*([\d.]+)\s*$') + DROPPED_EVENTS_REGEX = re.compile(r'CPU:(?P\d+) \[\d*\s*EVENTS DROPPED\]') @@ -217,6 +219,11 @@ class TraceCmdTrace(object): yield DroppedEventsEvent(match.group('cpu_id')) continue + match = HEADER_REGEX.search(line) + if match: + logger.debug(line.strip()) + continue + match = TRACE_EVENT_REGEX.search(line) if not match: logger.warning('Invalid trace event: "{}"'.format(line))