From 7f8e7fed4bc7ac08fffb21f9943fdb90bbfb1104 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Thu, 20 Jul 2017 15:52:31 +0100 Subject: [PATCH] utils/trace_cmd: fix event parsing Make event preamble parsing more robust in cases there are multiple instances of ' [' (e.g. as part of thread name) by splitting exactly once from the right. The right-most columns are the timestamp and the cpu id, and much more restricted (and therefore predictable) in their formatting. --- wlauto/utils/trace_cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wlauto/utils/trace_cmd.py b/wlauto/utils/trace_cmd.py index 77556b35..f3301b77 100644 --- a/wlauto/utils/trace_cmd.py +++ b/wlauto/utils/trace_cmd.py @@ -308,7 +308,7 @@ class TraceCmdTrace(object): if not found: continue - thread_string, rest = parts[0].split(' [') + thread_string, rest = parts[0].rsplit(' [', 1) cpu_id, ts_string = rest.split('] ') body = parts[2].strip()