Bug 1425163 - Use cat /proc/meminfo rather than trying to pull it from device; r=bc
authorGeoff Brown <gbrown@mozilla.com>
Thu, 14 Dec 2017 09:46:04 -0600
changeset 396380 41d8dd58a696f81cb6e9d3ffff830ae83716fe5e
parent 396379 a6be61a6cc392e628a62ad7b0d49432eef0f33fa
child 396381 c0c23bc582a15fbf3ce879661f3528630ef1f7bc
push id33090
push userbtara@mozilla.com
push dateThu, 14 Dec 2017 22:34:07 +0000
treeherdermozilla-central@04433cdc9395 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbc
bugs1425163
milestone59.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 1425163 - Use cat /proc/meminfo rather than trying to pull it from device; r=bc
testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
--- a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
+++ b/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
@@ -638,21 +638,23 @@ class DeviceManagerADB(DeviceManager):
                     [int(g or 0) for g in m.groups()[1:]])
             ret["uptime"] = uptime
         if directive == "process" or directive == "all":
             data = self.shellCheckOutput(["ps"], timeout=self.short_timeout)
             ret["process"] = data.split('\n')
         if directive == "systime" or directive == "all":
             ret["systime"] = self.shellCheckOutput(["date"], timeout=self.short_timeout)
         if directive == "memtotal" or directive == "all":
-            meminfo = {}
-            for line in self.pullFile("/proc/meminfo").splitlines():
-                key, value = line.split(":")
-                meminfo[key] = value.strip()
-            ret["memtotal"] = meminfo["MemTotal"]
+            out = self.shellCheckOutput(["cat", "/proc/meminfo"], timeout=self.short_timeout)
+            out = out.replace('\r\n', '\n').splitlines(True)
+            for line in out:
+                parts = line.split(":")
+                if len(parts) == 2 and parts[0] == "MemTotal":
+                    ret["memtotal"] = parts[1].strip()
+                    break
         if directive == "disk" or directive == "all":
             data = self.shellCheckOutput(
                 ["df", "/data", "/system", "/sdcard"], timeout=self.short_timeout)
             ret["disk"] = data.split('\n')
         self._logger.debug("getInfo: %s" % ret)
         return ret
 
     def uninstallApp(self, appName, installPath=None):