Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1212)

Unified Diff: build/android/pylib/android_commands.py

Issue 91573003: Make page_cycler.py fully measure memory for each page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tony and Quinten's comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/perf/measurements/media.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 6f9b99cc2405f9eab6760fe5d71d4fa5c5a9196c..355e4ffd26f193f7cfdcd22d885b405cce9b97cc 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -253,6 +253,7 @@ class AndroidCommands(object):
self._actual_push_size = 0
self._external_storage = ''
self._util_wrapper = ''
+ self._purge_ashmem_binary_was_pushed = False
def _LogShell(self, cmd):
"""Logs the adb shell command."""
@@ -1435,16 +1436,23 @@ class AndroidCommands(object):
logging.warning('Could not find disk IO stats.')
return None
+ def _PushPurgeAshmemBinaryIfNeeded(self):
+ """Pushes the ashmem binary once at construction if needed."""
+ if not self._purge_ashmem_binary_was_pushed:
+ host_path = host_path_finder.GetMostRecentHostPath('purge_ashmem')
+ if not host_path:
+ raise Exception('Could not find the purge_ashmem binary.')
+ device_path = os.path.join(constants.TEST_EXECUTABLE_DIR, 'purge_ashmem')
+ self.PushIfNeeded(host_path, device_path)
+ self._purge_ashmem_binary_was_pushed = True
+
def PurgeUnpinnedAshmem(self):
bulach 2013/11/28 13:31:24 I think both _PushPurgeAshmemBinaryIfNeeded and Pu
Philippe 2013/11/28 17:03:04 Yeah, agreed :)
"""Purges the unpinned ashmem memory for the whole system.
This can be used to make memory measurements more stable in particular.
"""
- host_path = host_path_finder.GetMostRecentHostPath('purge_ashmem')
- if not host_path:
- raise Exception('Could not find the purge_ashmem binary.')
+ self._PushPurgeAshmemBinaryIfNeeded()
device_path = os.path.join(constants.TEST_EXECUTABLE_DIR, 'purge_ashmem')
- self.PushIfNeeded(host_path, device_path)
if self.RunShellCommand(device_path, log_result=True):
return
raise Exception('Error while purging ashmem.')
« no previous file with comments | « no previous file | tools/perf/measurements/media.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698