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

Unified Diff: tools/run_perf.py

Issue 779923002: Make JSTests ready for Android measurements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 | « test/js-perf-test/JSTests.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/run_perf.py
diff --git a/tools/run_perf.py b/tools/run_perf.py
index 0a24c08e0775ad75057e3bfc9049c9ad97d7cd16..b8b49aa724e262225b9e28f431cd1978d77378a0 100755
--- a/tools/run_perf.py
+++ b/tools/run_perf.py
@@ -219,7 +219,9 @@ class Graph(Node):
self.graphs = parent.graphs[:] + [suite["name"]]
self.flags = parent.flags[:] + suite.get("flags", [])
self.test_flags = parent.test_flags[:] + suite.get("test_flags", [])
- self.resources = parent.resources[:] + suite.get("resources", [])
+
+ # Values independent of parent node.
+ self.resources = suite.get("resources", [])
# Descrete values (with parent defaults).
self.binary = suite.get("binary", parent.binary)
@@ -519,9 +521,10 @@ class AndroidPlatform(Platform): # pragma: no cover
cwd=AndroidPlatform.DEVICE_DIR,
)
- def _PushFile(self, host_dir, file_name):
+ def _PushFile(self, host_dir, file_name, target_rel="."):
file_on_host = os.path.join(host_dir, file_name)
- file_on_device = AndroidPlatform.DEVICE_DIR + file_name
+ file_on_device = os.path.join(
+ AndroidPlatform.DEVICE_DIR, target_rel, file_name)
# Only push files not yet pushed in one execution.
if file_on_host in self.pushed:
@@ -535,26 +538,34 @@ class AndroidPlatform(Platform): # pragma: no cover
def PreTests(self, node, path):
suite_dir = os.path.abspath(os.path.dirname(path))
if node.path:
- bench_dir = os.path.join(suite_dir,
- os.path.normpath(os.path.join(*node.path)))
+ bench_rel = os.path.normpath(os.path.join(*node.path))
+ bench_abs = os.path.join(suite_dir, bench_rel)
else:
- bench_dir = suite_dir
+ bench_rel = "."
+ bench_abs = suite_dir
self._PushFile(self.shell_dir, node.binary)
if isinstance(node, Runnable):
- self._PushFile(bench_dir, node.main)
+ self._PushFile(bench_abs, node.main, bench_rel)
for resource in node.resources:
- self._PushFile(bench_dir, resource)
+ self._PushFile(bench_abs, resource, bench_rel)
def Run(self, runnable, count):
cache = cache_control.CacheControl(self.device)
cache.DropRamCaches()
binary_on_device = AndroidPlatform.DEVICE_DIR + runnable.binary
cmd = [binary_on_device] + runnable.GetCommandFlags()
+
+ # Relative path to benchmark directory.
+ if runnable.path:
+ bench_rel = os.path.normpath(os.path.join(*runnable.path))
+ else:
+ bench_rel = "."
+
try:
output = self.device.RunShellCommand(
cmd,
- cwd=AndroidPlatform.DEVICE_DIR,
+ cwd=os.path.join(AndroidPlatform.DEVICE_DIR, bench_rel),
timeout=runnable.timeout,
retries=0,
)
« no previous file with comments | « test/js-perf-test/JSTests.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698