From ddb59440a88d74f3cc10dc22978ee6f93a69fc71 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 20 Sep 2022 11:08:54 -0400 Subject: [PATCH] logextract: Improve detection of clock and tmc uart parameters Signed-off-by: Kevin O'Connor --- scripts/logextract.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/logextract.py b/scripts/logextract.py index 0aad1e44..acf75bcb 100755 --- a/scripts/logextract.py +++ b/scripts/logextract.py @@ -216,10 +216,10 @@ clock_r = re.compile(r"^clocksync state: mcu_freq=(?P[0-9]+) .*" + r" (?P[0-9]+) (?P[^ ]+)\)") repl_seq_r = re.compile(r": seq: 1" + shortseq_s) clock_s = r"(?P[0-9]+)" -repl_clock_r = re.compile(r"clock=" + clock_s + r"(?: |$)") +repl_clock_r = re.compile(r"clock=" + clock_s) repl_uart_r = re.compile(r"tmcuart_(?:response|send) oid=[0-9]+" + r" (?:read|write)=(?P(?:'[^']*'" - + r'|"[^"]*"))(?: |$)') + + r'|"[^"]*"))') # MCU shutdown message parsing class MCUStream: @@ -240,12 +240,12 @@ class MCUStream: if seq is not None: line = repl_seq_r.sub(r"\g<0>(%d)" % (seq,), line) def clock_update(m): - return m.group(0).rstrip() + "(%.6f) " % ( + return m.group(0).rstrip() + "(%.6f)" % ( self.trans_clock(int(m.group('clock')), ts),) line = repl_clock_r.sub(clock_update, line) def uart_update(m): msg = TMCUartHelper().parse_msg(ast.literal_eval(m.group('msg'))) - return m.group(0).rstrip() + "%s " % (msg,) + return m.group(0).rstrip() + msg line = repl_uart_r.sub(uart_update, line) if self.name != 'mcu': line = "mcu '%s': %s" % (self.name, line)