diff options
author | Joel Fernandes <joelaf@google.com> | 2017-06-16 09:56:32 -0700 |
---|---|---|
committer | KP Singh <kpsingh@google.com> | 2017-06-21 22:06:27 +0200 |
commit | a38f1d59a8927bf305a106478c2cf1cadbd564be (patch) | |
tree | 039526cfabc7d3683c4fccaf7b6cc5f424308530 | |
parent | c32717c10198902f40bbdc4e34b252e28c0c4b4d (diff) | |
download | trappy-a38f1d59a8927bf305a106478c2cf1cadbd564be.tar.gz |
systrace: Fix broken regex
The regex is broken for strings like this:
C|594|HW_VSYNC_ON_0|1
This is because the "1" (data) is optional and so the greedy operator globs everything causing
func = "HW_VSYNC_ON_0|1" and data = NaN
Change the data to be greedy until '|' is encountered so with that:
func = "HW_VSYNC_ON_0" and data = "1".
Change-Id: I3695a8da8ad10598192cea08ca92e27271565ccf
Signed-off-by: Joel Fernandes <joelaf@google.com>
Reviewed-by: KP Singh <kpsingh@google.com>
-rw-r--r-- | trappy/systrace.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/trappy/systrace.py b/trappy/systrace.py index 0a7f42b..ab2e29c 100644 --- a/trappy/systrace.py +++ b/trappy/systrace.py @@ -17,7 +17,7 @@ from trappy.ftrace import GenericFTrace import re SYSTRACE_EVENT = re.compile( - r'^(?P<event>[A-Z])(\|(?P<pid>\d+)\|(?P<func>.*)(\|(?P<data>\d+))?)?') + r'^(?P<event>[A-Z])(\|(?P<pid>\d+)\|(?P<func>[^|]*)(\|(?P<data>.*))?)?') class drop_before_trace(object): """Object that, when called, returns True if the line is not part of |