Commit be0d0065 authored by bulach@chromium.org's avatar bulach@chromium.org

Android: further "user build" perf test automation.

Use "GetProtectedFileContents" for obtaining memory usage and fetch perf test data from instrumentation tests.

BUG=175127


Review URL: https://chromiumcodereview.appspot.com/12212137

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182028 0039d316-1c4b-4281-b951-d872f2087c98
parent 7c0c95eb
...@@ -1068,7 +1068,8 @@ class AndroidCommands(object): ...@@ -1068,7 +1068,8 @@ class AndroidCommands(object):
usage_dict = collections.defaultdict(int) usage_dict = collections.defaultdict(int)
smaps = collections.defaultdict(dict) smaps = collections.defaultdict(dict)
current_smap = '' current_smap = ''
for line in self.GetFileContents('/proc/%s/smaps' % pid, log_result=False): for line in self.GetProtectedFileContents('/proc/%s/smaps' % pid,
log_result=False):
items = line.split() items = line.split()
# See man 5 proc for more details. The format is: # See man 5 proc for more details. The format is:
# address perms offset dev inode pathname # address perms offset dev inode pathname
...@@ -1088,8 +1089,8 @@ class AndroidCommands(object): ...@@ -1088,8 +1089,8 @@ class AndroidCommands(object):
# Presumably the process died between ps and calling this method. # Presumably the process died between ps and calling this method.
logging.warning('Could not find memory usage for pid ' + str(pid)) logging.warning('Could not find memory usage for pid ' + str(pid))
for line in self.GetFileContents('/d/nvmap/generic-0/clients', for line in self.GetProtectedFileContents('/d/nvmap/generic-0/clients',
log_result=False): log_result=False):
match = re.match(NVIDIA_MEMORY_INFO_RE, line) match = re.match(NVIDIA_MEMORY_INFO_RE, line)
if match and match.group('pid') == pid: if match and match.group('pid') == pid:
usage_bytes = int(match.group('usage_bytes')) usage_bytes = int(match.group('usage_bytes'))
......
...@@ -365,7 +365,7 @@ class TestRunner(BaseTestRunner): ...@@ -365,7 +365,7 @@ class TestRunner(BaseTestRunner):
# Obtain the relevant perf data. The data is dumped to a # Obtain the relevant perf data. The data is dumped to a
# JSON formatted file. # JSON formatted file.
json_string = self.adb.GetFileContents( json_string = self.adb.GetProtectedFileContents(
'/data/data/com.google.android.apps.chrome/files/PerfTestData.txt') '/data/data/com.google.android.apps.chrome/files/PerfTestData.txt')
if json_string: if json_string:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment