| Index: tools/run-bisect-perf-regression.py
|
| diff --git a/tools/run-bisect-perf-regression.py b/tools/run-bisect-perf-regression.py
|
| index 364d39f3afd258a67677da306fbf793119c31446..a546e3acddfec25ba5dbc5dace9b74ee20cfe52a 100755
|
| --- a/tools/run-bisect-perf-regression.py
|
| +++ b/tools/run-bisect-perf-regression.py
|
| @@ -5,13 +5,12 @@
|
|
|
| """Run Performance Test Bisect Tool
|
|
|
| -This script is used by a try bot to run the src/tools/bisect-perf-regression.py
|
| -script with the parameters specified in src/tools/auto_bisect/bisect.cfg.
|
| -It will check out a copy of the depot in a subdirectory 'bisect' of the working
|
| -directory provided, and run the bisect-perf-regression.py script there.
|
| +This script is used by a try bot to run the bisect script with the parameters
|
| +specified in the bisect config file. It checks out a copy of the depot in
|
| +a subdirectory 'bisect' of the working directory provided, annd runs the
|
| +bisect scrip there.
|
| """
|
|
|
| -import imp
|
| import optparse
|
| import os
|
| import platform
|
| @@ -19,14 +18,10 @@ import subprocess
|
| import sys
|
| import traceback
|
|
|
| +from auto_bisect import bisect_perf_regression
|
| from auto_bisect import bisect_utils
|
| from auto_bisect import math_utils
|
|
|
| -bisect = imp.load_source('bisect-perf-regression',
|
| - os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),
|
| - 'bisect-perf-regression.py'))
|
| -
|
| -
|
| CROS_BOARD_ENV = 'BISECT_CROS_BOARD'
|
| CROS_IP_ENV = 'BISECT_CROS_IP'
|
|
|
| @@ -230,7 +225,7 @@ def _CreateBisectOptionsFromConfig(config):
|
| else:
|
| opts_dict['target_platform'] = 'android'
|
|
|
| - return bisect.BisectOptions.FromDict(opts_dict)
|
| + return bisect_perf_regression.BisectOptions.FromDict(opts_dict)
|
|
|
|
|
| def _RunPerformanceTest(config, path_to_file):
|
| @@ -238,18 +233,18 @@ def _RunPerformanceTest(config, path_to_file):
|
|
|
| Args:
|
| config: Contents of the config file, a dictionary.
|
| - path_to_file: Path to the bisect-perf-regression.py script.
|
| + path_to_file: Path to the bisect script (bisect_perf_regression.py).
|
|
|
| Attempts to build and run the current revision with and without the
|
| current patch, with the parameters passed in.
|
| """
|
| # Bisect script expects to be run from the src directory
|
| - os.chdir(os.path.join(path_to_file, '..'))
|
| + os.chdir(os.path.join(path_to_file, os.path.pardir))
|
|
|
| bisect_utils.OutputAnnotationStepStart('Building With Patch')
|
|
|
| opts = _CreateBisectOptionsFromConfig(config)
|
| - b = bisect.BisectPerformanceMetrics(None, opts)
|
| + b = bisect_perf_regression.BisectPerformanceMetrics(None, opts)
|
|
|
| if bisect_utils.RunGClient(['runhooks']):
|
| raise RuntimeError('Failed to run gclient runhooks')
|
| @@ -345,11 +340,11 @@ def _SetupAndRunPerformanceTest(config, path_to_file, path_to_goma):
|
|
|
| Args:
|
| config: The config read from run-perf-test.cfg.
|
| - path_to_file: Path to the bisect-perf-regression.py script.
|
| + path_to_file: Path to the bisect script (bisect_perf_regression.py).
|
| path_to_goma: Path to goma directory.
|
|
|
| Returns:
|
| - The exit code of bisect-perf-regression.py: 0 on success, otherwise 1.
|
| + An exit code: 0 on success, otherwise 1.
|
| """
|
| try:
|
| with Goma(path_to_goma) as _:
|
| @@ -367,14 +362,13 @@ def _SetupAndRunPerformanceTest(config, path_to_file, path_to_goma):
|
| def _RunBisectionScript(
|
| config, working_directory, path_to_file, path_to_goma, path_to_extra_src,
|
| dry_run):
|
| - """Attempts to execute bisect-perf-regression.py with the given parameters.
|
| + """Attempts to execute the bisect script with the given parameters.
|
|
|
| Args:
|
| config: A dict containing the parameters to pass to the script.
|
| - working_directory: A working directory to provide to the
|
| - bisect-perf-regression.py script, where it will store it's own copy of
|
| - the depot.
|
| - path_to_file: Path to the bisect-perf-regression.py script.
|
| + working_directory: A working directory to provide to the bisect script,
|
| + where it will store it's own copy of the depot.
|
| + path_to_file: Path to the bisect script (bisect_perf_regression.py).
|
| path_to_goma: Path to goma directory.
|
| path_to_extra_src: Path to extra source file.
|
| dry_run: Do a dry run, skipping sync, build, and performance testing steps.
|
| @@ -465,7 +459,7 @@ def _RunBisectionScript(
|
| return_code = subprocess.call(cmd)
|
|
|
| if return_code:
|
| - print ('Error: bisect-perf-regression.py returned with error %d\n'
|
| + print ('Error: bisect_perf_regression.py returned with error %d\n'
|
| % return_code)
|
|
|
| return return_code
|
|
|