Store results from perf.py as json file
Change-Id: I9b03ffacea4dff35bafc326c1db2532ac7784a3a
diff --git a/tools/utils.py b/tools/utils.py
index 249c10b..4bd6910 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -68,8 +68,10 @@
R8_SRC_JAR = os.path.join(LIBS, 'r8-src.jar')
R8LIB_EXCLUDE_DEPS_JAR = os.path.join(LIBS, 'r8lib-exclude-deps.jar')
R8_FULL_EXCLUDE_DEPS_JAR = os.path.join(LIBS, 'r8-full-exclude-deps.jar')
-THREADING_MODULE_BLOCKING_JAR = os.path.join(LIBS, 'threading-module-blocking.jar')
-THREADING_MODULE_SINGLE_THREADED_JAR = os.path.join(LIBS, 'threading-module-single-threaded.jar')
+THREADING_MODULE_BLOCKING_JAR = os.path.join(LIBS,
+ 'threading-module-blocking.jar')
+THREADING_MODULE_SINGLE_THREADED_JAR = os.path.join(
+ LIBS, 'threading-module-single-threaded.jar')
R8_TESTS_JAR = os.path.join(LIBS, 'r8tests.jar')
R8_TESTBASE_JAR = os.path.join(LIBS, 'r8test_base.jar')
R8LIB_TESTBASE_JAR = os.path.join(LIBS, 'r8libtestbase-cf.jar')
@@ -82,7 +84,8 @@
LIBRARY_DESUGAR_CONVERSIONS_ZIP = os.path.join(
CUSTOM_CONVERSION_DIR, 'library_desugar_conversions.jar')
KEEPANNO_ANNOTATIONS_JAR = os.path.join(LIBS, 'keepanno-annotations.jar')
-KEEPANNO_ANNOTATIONS_DOC = os.path.join('d8_r8', 'keepanno', 'build', 'docs', 'javadoc')
+KEEPANNO_ANNOTATIONS_DOC = os.path.join('d8_r8', 'keepanno', 'build', 'docs',
+ 'javadoc')
DESUGAR_CONFIGURATION = os.path.join('src', 'library_desugar',
'desugar_jdk_libs.json')
@@ -397,6 +400,7 @@
PrintCmd(cmd)
subprocess.check_call(cmd)
+
def check_dir_args(source, destination):
# We require that the dirname of the paths coincide, e.g., src/dirname and dst/dirname
# The target is then stripped so the upload command will be: cp -R src/dirname dst/
@@ -407,10 +411,11 @@
f'{source} and {destination}')
if len(destination_parent.strip()) == 0:
raise Exception(
- 'Attempt to upload directory to empty destination directory: '
- + destination)
+ 'Attempt to upload directory to empty destination directory: ' +
+ destination)
return destination_parent
+
def upload_directory_to_cloud_storage(source, destination, parallel=True):
destination_parent = check_dir_args(source, destination)
cmd = [get_gsutil()]
@@ -421,6 +426,7 @@
PrintCmd(cmd)
subprocess.check_call(cmd)
+
def rsync_directory_to_cloud_storage(source, destination, parallel=True):
check_dir_args(source, destination)
cmd = [get_gsutil()]
@@ -431,6 +437,7 @@
PrintCmd(cmd)
subprocess.check_call(cmd)
+
def delete_file_from_cloud_storage(destination):
cmd = [get_gsutil(), 'rm', destination]
PrintCmd(cmd)