diff --git a/scripts/process_logs/process_logs b/scripts/process_logs/process_logs index 169d1bbd70..0d33baca65 100755 --- a/scripts/process_logs/process_logs +++ b/scripts/process_logs/process_logs @@ -443,6 +443,7 @@ class OutputLogFile: f.write(line) f.write('\n') + class OutputLog: def __init__(self, config): self.filename = parse_format_string(config.get("filename", "output.log")) @@ -677,6 +678,11 @@ class NodeRequestData: self._match_req_idr = re.compile("'reqIdr': (\[(?:\['\w+', \d+\](?:, )?)*\])").search self._match_pp_seq_no = re.compile("'ppSeqNo': (\d+)").search self._match_view_no = re.compile("'viewNo': (\d+)").search + self._match_prepare = re.compile("PREPARE\s?\((\d+), (\d+)\)").search + self._match_auth_request = re.compile("signature on (?:[\w\s]*) request (\d+)").search + self._pattern_req = "\('\w+', (\d+)\)" + self._match_propagate_req = re.compile("propagating request {} from client".format(self._pattern_req)).search + self._match_forward_req = re.compile("forwarding request {} to".format(self._pattern_req)).search self._pattern_req_list = "\[(?:\('\w+', \d+\)(?:, )?)*\]" self._match_ordered_req_list = re.compile("requests ordered ({})".format(self._pattern_req_list)).search self._match_discarded_req_list = re.compile("discarded ({})".format(self._pattern_req_list)).search @@ -745,6 +751,37 @@ class NodeRequestData: if not m: return return m.group(1) + def _process_prepare(self, message): + if "PREPARE" not in message.body: + return + m = self._match_prepare(message.body) + if not m: return + message.set_attribute("viewNo", m.group(1)) + message.set_attribute("ppSeqNo", m.group(2)) + + def _process_auth_request(self, message): + if "authenticated" not in message.body: + return + if "signature on" not in message.body: + return + m = self._match_auth_request(message.body) + if not m: return + message.set_attribute("reqId", m.group(1)) + + def _process_propagate_req(self, message): + if "propagating request" not in message.body: + return + m = self._match_propagate_req(message.body) + if not m: return + message.set_attribute("reqId", m.group(1)) + + def _process_forward_req(self, message): + if "forwarding request" not in message.body: + return + m = self._match_forward_req(message.body) + if not m: return + message.set_attribute("reqId", m.group(1)) + def _set_attributes(self, message): reqId = self._parse_reqId(message) if reqId: message.set_attribute("reqId", reqId) @@ -756,6 +793,11 @@ class NodeRequestData: viewNo = self._parse_viewNo(message) if viewNo: message.set_attribute("viewNo", viewNo) + self._process_prepare(message) + self._process_auth_request(message) + self._process_propagate_req(message) + self._process_forward_req(message) + def _check_received(self, message): if "received client request" not in message.body: return