Bug 1091413 - Refrain from printing the command args with each call to process_output in mozlog's machformatter;r=jgraham
authorChris Manchester <cmanchester@mozilla.com>
Thu, 30 Oct 2014 11:37:22 -0400
changeset 213241 fdc84bee1da6a0a8a01749395acf662b9f5d0f83
parent 213240 af652f97938d6dd3807d8a7009f3010b798e0cc8
child 213242 855fcb458ecdbc09c152613bcec28aa49f2cd976
push id27745
push usercbook@mozilla.com
push dateFri, 31 Oct 2014 13:09:12 +0000
treeherdermozilla-central@6bd2071b373f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1091413
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1091413 - Refrain from printing the command args with each call to process_output in mozlog's machformatter;r=jgraham
testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
--- a/testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
+++ b/testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
@@ -39,16 +39,17 @@ class MachFormatter(base.BaseFormatter):
         self.start_time = start_time
         self.write_interval = write_interval
         self.write_times = write_times
         self.status_buffer = {}
         self.has_unexpected = {}
         self.last_time = None
         self.terminal = terminal
         self.verbose = False
+        self._known_pids = set()
 
         self.summary_values = {"tests": 0,
                                "subtests": 0,
                                "expected": 0,
                                "unexpected": defaultdict(int),
                                "skipped": 0}
         self.summary_unexpected = []
 
@@ -258,19 +259,24 @@ class MachFormatter(base.BaseFormatter):
         if "expected" in data:
             self.summary_values["unexpected"][data["status"]] += 1
         elif data["status"] == "SKIP":
             self.summary_values["skipped"] += 1
         else:
             self.summary_values["expected"] += 1
 
     def process_output(self, data):
-        return '"%s" (pid:%s command:%s)' % (data["data"],
-                                             data["process"],
-                                             data.get("command", ""))
+        rv = []
+
+        if "command" in data and data["process"] not in self._known_pids:
+            self._known_pids.add(data["process"])
+            rv.append('(pid:%s) Full command: %s' % (data["process"], data["command"]))
+
+        rv.append('(pid:%s) "%s"' % (data["process"], data["data"]))
+        return "\n".join(rv)
 
     def crash(self, data):
         test = self._get_test_id(data)
 
         if data.get("stackwalk_returncode", 0) != 0 and not data.get("stackwalk_stderr"):
             success = True
         else:
             success = False