OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Performance Test Bisect Tool | 6 """Chromium auto-bisect tool |
7 | 7 |
8 This script bisects a series of changelists using binary search. It starts at | 8 This script bisects a range of commits using binary search. It starts by getting |
9 a bad revision where a performance metric has regressed, and asks for a last | 9 reference values for the specified "good" and "bad" commits. Then, for revisions |
10 known-good revision. It will then binary search across this revision range by | 10 in between, it will get builds, run tests and classify intermediate revisions as |
11 syncing, building, and running a performance test. If the change is | 11 "good" or "bad" until an adjacent "good" and "bad" revision is found; this is |
12 suspected to occur as a result of WebKit/V8 changes, the script will | 12 the culprit. |
13 further bisect changes to those depots and attempt to narrow down the revision | |
14 range. | |
15 | 13 |
16 Example usage using SVN revisions: | 14 If the culprit is a roll if a depedency repository (e.g. v8), it will then |
| 15 expand the revision range and continue the bisect until a culprit revision in |
| 16 the dependency repository is found. |
17 | 17 |
18 ./tools/bisect_perf_regression.py -c\ | 18 Example usage using git commit hashes, bisecting a performance test based on |
19 "out/Release/performance_ui_tests --gtest_filter=ShutdownTest.SimpleUserQuit"\ | 19 the mean value of a particular metric: |
20 -g 168222 -b 168232 -m shutdown/simple-user-quit | |
21 | 20 |
22 Be aware that if you're using the git workflow and specify an SVN revision, | 21 ./tools/auto_bisect/bisect_perf_regression.py |
23 the script will attempt to find the git SHA1 where SVN changes up to that | 22 --command "out/Release/performance_ui_tests \ |
24 revision were merged in. | 23 --gtest_filter=ShutdownTest.SimpleUserQuit"\ |
| 24 --metric shutdown/simple-user-quit |
| 25 --good_revision 1f6e67861535121c5c819c16a666f2436c207e7b\ |
| 26 --bad-revision b732f23b4f81c382db0b23b9035f3dadc7d925bb\ |
25 | 27 |
26 Example usage using git hashes: | 28 Example usage using git commit positions, bisecting a functional test based on |
| 29 whether it passes or fails. |
27 | 30 |
28 ./tools/bisect_perf_regression.py -c\ | 31 ./tools/auto_bisect/bisect_perf_regression.py\ |
29 "out/Release/performance_ui_tests --gtest_filter=ShutdownTest.SimpleUserQuit"\ | 32 --command "out/Release/content_unittests -single-process-tests \ |
30 -g 1f6e67861535121c5c819c16a666f2436c207e7b\ | 33 --gtest_filter=GpuMemoryBufferImplTests"\ |
31 -b b732f23b4f81c382db0b23b9035f3dadc7d925bb\ | 34 --good_revision 408222\ |
32 -m shutdown/simple-user-quit | 35 --bad_revision 408232\ |
| 36 --bisect_mode return_code\ |
| 37 --builder_type full |
| 38 |
| 39 In practice, the auto-bisect tool is usually run on tryserver.chromium.perf |
| 40 try bots, and is started by tools/run-bisect-perf-regression.py using |
| 41 config parameters from tools/auto_bisect/bisect.cfg. |
33 """ | 42 """ |
34 | 43 |
35 import copy | 44 import copy |
36 import errno | 45 import errno |
37 import hashlib | 46 import hashlib |
38 import logging | 47 import logging |
39 import argparse | 48 import argparse |
40 import os | 49 import os |
41 import re | 50 import re |
42 import shlex | 51 import shlex |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 NOTE: There's still a chance that this is actually a regression, but you may | 119 NOTE: There's still a chance that this is actually a regression, but you may |
111 need to bisect a different platform.""" | 120 need to bisect a different platform.""" |
112 | 121 |
113 # Git branch name used to run bisect try jobs. | 122 # Git branch name used to run bisect try jobs. |
114 BISECT_TRYJOB_BRANCH = 'bisect-tryjob' | 123 BISECT_TRYJOB_BRANCH = 'bisect-tryjob' |
115 # Git master branch name. | 124 # Git master branch name. |
116 BISECT_MASTER_BRANCH = 'master' | 125 BISECT_MASTER_BRANCH = 'master' |
117 # File to store 'git diff' content. | 126 # File to store 'git diff' content. |
118 BISECT_PATCH_FILE = 'deps_patch.txt' | 127 BISECT_PATCH_FILE = 'deps_patch.txt' |
119 # SVN repo where the bisect try jobs are submitted. | 128 # SVN repo where the bisect try jobs are submitted. |
120 SVN_REPO_URL = 'svn://svn.chromium.org/chrome-try/try-perf' | 129 PERF_SVN_REPO_URL = 'svn://svn.chromium.org/chrome-try/try-perf' |
| 130 FULL_SVN_REPO_URL = 'svn://svn.chromium.org/chrome-try/try' |
121 | 131 |
122 | 132 |
123 class RunGitError(Exception): | 133 class RunGitError(Exception): |
124 | 134 |
125 def __str__(self): | 135 def __str__(self): |
126 return '%s\nError executing git command.' % self.args[0] | 136 return '%s\nError executing git command.' % self.args[0] |
127 | 137 |
128 | 138 |
129 def GetSHA1HexDigest(contents): | 139 def GetSHA1HexDigest(contents): |
130 """Returns SHA1 hex digest of the given string.""" | 140 """Returns SHA1 hex digest of the given string.""" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 # the DEPS file with the following format: | 191 # the DEPS file with the following format: |
182 # 'depot_name': 'revision', | 192 # 'depot_name': 'revision', |
183 vars_body = re_results.group('vars_body') | 193 vars_body = re_results.group('vars_body') |
184 rxp = re.compile(r"'(?P<depot_body>[\w_-]+)':[\s]+'(?P<rev_body>[\w@]+)'", | 194 rxp = re.compile(r"'(?P<depot_body>[\w_-]+)':[\s]+'(?P<rev_body>[\w@]+)'", |
185 re.MULTILINE) | 195 re.MULTILINE) |
186 re_results = rxp.findall(vars_body) | 196 re_results = rxp.findall(vars_body) |
187 | 197 |
188 return dict(re_results) | 198 return dict(re_results) |
189 | 199 |
190 | 200 |
191 def _WaitUntilBuildIsReady(fetch_build_func, bot_name, builder_type, | 201 def _WaitUntilBuildIsReady(fetch_build_func, builder_name, builder_type, |
192 build_request_id, max_timeout): | 202 build_request_id, max_timeout): |
193 """Waits until build is produced by bisect builder on try server. | 203 """Waits until build is produced by bisect builder on try server. |
194 | 204 |
195 Args: | 205 Args: |
196 fetch_build_func: Function to check and download build from cloud storage. | 206 fetch_build_func: Function to check and download build from cloud storage. |
197 bot_name: Builder bot name on try server. | 207 builder_name: Builder bot name on try server. |
198 builder_type: Builder type, e.g. "perf" or "full". Refer to the constants | 208 builder_type: Builder type, e.g. "perf" or "full". Refer to the constants |
199 |fetch_build| which determine the valid values that can be passed. | 209 |fetch_build| which determine the valid values that can be passed. |
200 build_request_id: A unique ID of the build request posted to try server. | 210 build_request_id: A unique ID of the build request posted to try server. |
201 max_timeout: Maximum time to wait for the build. | 211 max_timeout: Maximum time to wait for the build. |
202 | 212 |
203 Returns: | 213 Returns: |
204 Downloaded archive file path if exists, otherwise None. | 214 Downloaded archive file path if exists, otherwise None. |
205 """ | 215 """ |
206 # Build number on the try server. | 216 # Build number on the try server. |
207 build_num = None | 217 build_num = None |
208 # Interval to check build on cloud storage. | 218 # Interval to check build on cloud storage. |
209 poll_interval = 60 | 219 poll_interval = 60 |
210 # Interval to check build status on try server in seconds. | 220 # Interval to check build status on try server in seconds. |
211 status_check_interval = 600 | 221 status_check_interval = 600 |
212 last_status_check = time.time() | 222 last_status_check = time.time() |
213 start_time = time.time() | 223 start_time = time.time() |
214 while True: | 224 while True: |
215 # Checks for build on gs://chrome-perf and download if exists. | 225 # Checks for build on gs://chrome-perf and download if exists. |
216 res = fetch_build_func() | 226 res = fetch_build_func() |
217 if res: | 227 if res: |
218 return (res, 'Build successfully found') | 228 return (res, 'Build successfully found') |
219 elapsed_status_check = time.time() - last_status_check | 229 elapsed_status_check = time.time() - last_status_check |
220 # To avoid overloading try server with status check requests, we check | 230 # To avoid overloading try server with status check requests, we check |
221 # build status for every 10 minutes. | 231 # build status for every 10 minutes. |
222 if elapsed_status_check > status_check_interval: | 232 if elapsed_status_check > status_check_interval: |
223 last_status_check = time.time() | 233 last_status_check = time.time() |
224 if not build_num: | 234 if not build_num: |
225 # Get the build number on try server for the current build. | 235 # Get the build number on try server for the current build. |
226 build_num = request_build.GetBuildNumFromBuilder( | 236 build_num = request_build.GetBuildNumFromBuilder( |
227 build_request_id, bot_name, builder_type) | 237 build_request_id, builder_name, builder_type) |
228 # Check the status of build using the build number. | 238 # Check the status of build using the build number. |
229 # Note: Build is treated as PENDING if build number is not found | 239 # Note: Build is treated as PENDING if build number is not found |
230 # on the the try server. | 240 # on the the try server. |
231 build_status, status_link = request_build.GetBuildStatus( | 241 build_status, status_link = request_build.GetBuildStatus( |
232 build_num, bot_name, builder_type) | 242 build_num, builder_name, builder_type) |
233 if build_status == request_build.FAILED: | 243 if build_status == request_build.FAILED: |
234 return (None, 'Failed to produce build, log: %s' % status_link) | 244 return (None, 'Failed to produce build, log: %s' % status_link) |
235 elapsed_time = time.time() - start_time | 245 elapsed_time = time.time() - start_time |
236 if elapsed_time > max_timeout: | 246 if elapsed_time > max_timeout: |
237 return (None, 'Timed out: %ss without build' % max_timeout) | 247 return (None, 'Timed out: %ss without build' % max_timeout) |
238 | 248 |
239 logging.info('Time elapsed: %ss without build.', elapsed_time) | 249 logging.info('Time elapsed: %ss without build.', elapsed_time) |
240 time.sleep(poll_interval) | 250 time.sleep(poll_interval) |
241 # For some reason, mac bisect bots were not flushing stdout periodically. | 251 # For some reason, mac bisect bots were not flushing stdout periodically. |
242 # As a result buildbot command is timed-out. Flush stdout on all platforms | 252 # As a result buildbot command is timed-out. Flush stdout on all platforms |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 output, returncode = bisect_utils.RunGit(['checkout', '-b', new_branch]) | 583 output, returncode = bisect_utils.RunGit(['checkout', '-b', new_branch]) |
574 if returncode: | 584 if returncode: |
575 raise RunGitError('Failed to checkout branch: %s.' % output) | 585 raise RunGitError('Failed to checkout branch: %s.' % output) |
576 | 586 |
577 output, returncode = bisect_utils.RunGit( | 587 output, returncode = bisect_utils.RunGit( |
578 ['branch', '--set-upstream-to', parent_branch]) | 588 ['branch', '--set-upstream-to', parent_branch]) |
579 if returncode: | 589 if returncode: |
580 raise RunGitError('Error in git branch --set-upstream-to') | 590 raise RunGitError('Error in git branch --set-upstream-to') |
581 | 591 |
582 | 592 |
583 def _BuilderTryjob(git_revision, bot_name, bisect_job_name, patch=None): | 593 def _GetBuilderName(builder_type, target_platform): |
584 """Attempts to run a tryjob from the current directory. | 594 """Gets builder bot name and build time in seconds based on platform.""" |
| 595 # TODO(prasadv, qyearsley): Make this a method of BuildArchive |
| 596 # (which may be renamed to BuilderTryBot or Builder). |
| 597 if builder_type == fetch_build.FULL_BUILDER: |
| 598 # The following builder is on tryserver.chromium.linux. |
| 599 # TODO(qyearsley): Change this name when more platforms are supported. |
| 600 return 'bisect_builder' |
| 601 if builder_type == fetch_build.PERF_BUILDER: |
| 602 if bisect_utils.IsWindowsHost(): |
| 603 return 'win_perf_bisect_builder' |
| 604 if bisect_utils.IsLinuxHost(): |
| 605 if target_platform == 'android': |
| 606 return 'android_perf_bisect_builder' |
| 607 return 'linux_perf_bisect_builder' |
| 608 if bisect_utils.IsMacHost(): |
| 609 return 'mac_perf_bisect_builder' |
| 610 raise NotImplementedError('Unsupported platform "%s".' % sys.platform) |
| 611 raise NotImplementedError('Unsupported builder type "%s".' % builder_type) |
| 612 |
| 613 |
| 614 def _GetBuilderBuildTime(): |
| 615 """Returns the time to wait for a build after requesting one.""" |
| 616 # TODO(prasadv, qyearsley): Make this a method of BuildArchive |
| 617 # (which may be renamed to BuilderTryBot or Builder). |
| 618 if bisect_utils.IsWindowsHost(): |
| 619 return MAX_WIN_BUILD_TIME |
| 620 if bisect_utils.IsLinuxHost(): |
| 621 return MAX_LINUX_BUILD_TIME |
| 622 if bisect_utils.IsMacHost(): |
| 623 return MAX_MAC_BUILD_TIME |
| 624 raise NotImplementedError('Unsupported Platform "%s".' % sys.platform) |
| 625 |
| 626 |
| 627 def _StartBuilderTryJob( |
| 628 builder_type, git_revision, builder_name, job_name, patch=None): |
| 629 """Attempts to run a try job from the current directory. |
585 | 630 |
586 Args: | 631 Args: |
587 git_revision: A Git hash revision. | 632 builder_type: One of the builder types in fetch_build, e.g. "perf". |
588 bot_name: Name of the bisect bot to be used for try job. | 633 git_revision: A git commit hash. |
589 bisect_job_name: Bisect try job name. | 634 builder_name: Name of the bisect bot to be used for try job. |
590 patch: A DEPS patch (used while bisecting 3rd party repositories). | 635 bisect_job_name: Try job name, used to identify which bisect |
| 636 job was responsible for requesting a build. |
| 637 patch: A DEPS patch (used while bisecting dependency repositories), |
| 638 or None if we're bisecting the top-level repository. |
591 """ | 639 """ |
| 640 # TODO(prasadv, qyearsley): Make this a method of BuildArchive |
| 641 # (which may be renamed to BuilderTryBot or Builder). |
592 try: | 642 try: |
593 # Temporary branch for running tryjob. | 643 # Temporary branch for running tryjob. |
594 _PrepareBisectBranch(BISECT_MASTER_BRANCH, BISECT_TRYJOB_BRANCH) | 644 _PrepareBisectBranch(BISECT_MASTER_BRANCH, BISECT_TRYJOB_BRANCH) |
595 patch_content = '/dev/null' | 645 patch_content = '/dev/null' |
596 # Create a temporary patch file, if it fails raise an exception. | 646 # Create a temporary patch file. |
597 if patch: | 647 if patch: |
598 WriteStringToFile(patch, BISECT_PATCH_FILE) | 648 WriteStringToFile(patch, BISECT_PATCH_FILE) |
599 patch_content = BISECT_PATCH_FILE | 649 patch_content = BISECT_PATCH_FILE |
600 | 650 |
601 try_cmd = ['try', | 651 try_command = [ |
602 '-b', bot_name, | 652 'try', |
603 '-r', git_revision, | 653 '--bot=%s' % builder_name, |
604 '-n', bisect_job_name, | 654 '--revision=%s' % git_revision, |
605 '--svn_repo=%s' % SVN_REPO_URL, | 655 '--name=%s' % job_name, |
606 '--diff=%s' % patch_content | 656 '--svn_repo=%s' % _TryJobSvnRepo(builder_type), |
607 ] | 657 '--diff=%s' % patch_content, |
| 658 ] |
608 # Execute try job to build revision. | 659 # Execute try job to build revision. |
609 output, returncode = bisect_utils.RunGit(try_cmd) | 660 print try_command |
| 661 output, return_code = bisect_utils.RunGit(try_command) |
610 | 662 |
611 if returncode: | 663 command_string = ' '.join(['git'] + try_command) |
612 raise RunGitError('Could not execute tryjob: %s.\n Error: %s' % ( | 664 if return_code: |
613 'git %s' % ' '.join(try_cmd), output)) | 665 raise RunGitError('Could not execute tryjob: %s.\n' |
| 666 'Error: %s' % (command_string, output)) |
614 logging.info('Try job successfully submitted.\n TryJob Details: %s\n%s', | 667 logging.info('Try job successfully submitted.\n TryJob Details: %s\n%s', |
615 'git %s' % ' '.join(try_cmd), output) | 668 command_string, output) |
616 finally: | 669 finally: |
617 # Delete patch file if exists | 670 # Delete patch file if exists. |
618 try: | 671 try: |
619 os.remove(BISECT_PATCH_FILE) | 672 os.remove(BISECT_PATCH_FILE) |
620 except OSError as e: | 673 except OSError as e: |
621 if e.errno != errno.ENOENT: | 674 if e.errno != errno.ENOENT: |
622 raise | 675 raise |
623 # Checkout master branch and delete bisect-tryjob branch. | 676 # Checkout master branch and delete bisect-tryjob branch. |
624 bisect_utils.RunGit(['checkout', '-f', BISECT_MASTER_BRANCH]) | 677 bisect_utils.RunGit(['checkout', '-f', BISECT_MASTER_BRANCH]) |
625 bisect_utils.RunGit(['branch', '-D', BISECT_TRYJOB_BRANCH]) | 678 bisect_utils.RunGit(['branch', '-D', BISECT_TRYJOB_BRANCH]) |
626 | 679 |
627 | 680 |
| 681 def _TryJobSvnRepo(builder_type): |
| 682 """Returns an SVN repo to use for try jobs based on the builder type.""" |
| 683 if builder_type == fetch_build.PERF_BUILDER: |
| 684 return PERF_SVN_REPO_URL |
| 685 if builder_type == fetch_build.FULL_BUILDER: |
| 686 return FULL_SVN_REPO_URL |
| 687 raise NotImplementedError('Unknown builder type "%s".' % builder_type) |
| 688 |
| 689 |
628 class BisectPerformanceMetrics(object): | 690 class BisectPerformanceMetrics(object): |
629 """This class contains functionality to perform a bisection of a range of | 691 """This class contains functionality to perform a bisection of a range of |
630 revisions to narrow down where performance regressions may have occurred. | 692 revisions to narrow down where performance regressions may have occurred. |
631 | 693 |
632 The main entry-point is the Run method. | 694 The main entry-point is the Run method. |
633 """ | 695 """ |
634 | 696 |
635 def __init__(self, opts, src_cwd): | 697 def __init__(self, opts, src_cwd): |
636 """Constructs a BisectPerformancesMetrics object. | 698 """Constructs a BisectPerformancesMetrics object. |
637 | 699 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 revision: A git commit hash. | 886 revision: A git commit hash. |
825 build_dir: The directory to download the build into. | 887 build_dir: The directory to download the build into. |
826 deps_patch: A patch which changes a dependency repository revision in | 888 deps_patch: A patch which changes a dependency repository revision in |
827 the DEPS, if applicable. | 889 the DEPS, if applicable. |
828 deps_patch_sha: The SHA1 hex digest of the above patch. | 890 deps_patch_sha: The SHA1 hex digest of the above patch. |
829 | 891 |
830 Returns: | 892 Returns: |
831 File path of the downloaded file if successful, otherwise None. | 893 File path of the downloaded file if successful, otherwise None. |
832 """ | 894 """ |
833 bucket_name, remote_path = fetch_build.GetBucketAndRemotePath( | 895 bucket_name, remote_path = fetch_build.GetBucketAndRemotePath( |
834 revision, target_arch=self.opts.target_arch, | 896 revision, builder_type=self.opts.builder_type, |
| 897 target_arch=self.opts.target_arch, |
835 target_platform=self.opts.target_platform, | 898 target_platform=self.opts.target_platform, |
836 deps_patch_sha=deps_patch_sha) | 899 deps_patch_sha=deps_patch_sha) |
837 output_dir = os.path.abspath(build_dir) | 900 output_dir = os.path.abspath(build_dir) |
838 fetch_build_func = lambda: fetch_build.FetchFromCloudStorage( | 901 fetch_build_func = lambda: fetch_build.FetchFromCloudStorage( |
839 bucket_name, remote_path, output_dir) | 902 bucket_name, remote_path, output_dir) |
840 | 903 |
841 is_available = fetch_build.BuildIsAvailable(bucket_name, remote_path) | 904 is_available = fetch_build.BuildIsAvailable(bucket_name, remote_path) |
842 if is_available: | 905 if is_available: |
843 return fetch_build_func() | 906 return fetch_build_func() |
844 | 907 |
(...skipping 27 matching lines...) Expand all Loading... |
872 return None | 935 return None |
873 | 936 |
874 # Create a unique ID for each build request posted to try server builders. | 937 # Create a unique ID for each build request posted to try server builders. |
875 # This ID is added to "Reason" property of the build. | 938 # This ID is added to "Reason" property of the build. |
876 build_request_id = GetSHA1HexDigest( | 939 build_request_id = GetSHA1HexDigest( |
877 '%s-%s-%s' % (git_revision, deps_patch, time.time())) | 940 '%s-%s-%s' % (git_revision, deps_patch, time.time())) |
878 | 941 |
879 # Revert any changes to DEPS file. | 942 # Revert any changes to DEPS file. |
880 bisect_utils.CheckRunGit(['reset', '--hard', 'HEAD'], cwd=self.src_cwd) | 943 bisect_utils.CheckRunGit(['reset', '--hard', 'HEAD'], cwd=self.src_cwd) |
881 | 944 |
882 bot_name = self._GetBuilderName(self.opts.target_platform) | 945 builder_name = _GetBuilderName( |
883 build_timeout = self._GetBuilderBuildTime() | 946 self.opts.builder_type, self.opts.target_platform) |
| 947 build_timeout = _GetBuilderBuildTime() |
884 | 948 |
885 try: | 949 try: |
886 _BuilderTryjob(git_revision, bot_name, build_request_id, deps_patch) | 950 _StartBuilderTryJob(self.opts.builder_type, git_revision, builder_name, |
| 951 job_name=build_request_id, patch=deps_patch) |
887 except RunGitError as e: | 952 except RunGitError as e: |
888 logging.warn('Failed to post builder try job for revision: [%s].\n' | 953 logging.warn('Failed to post builder try job for revision: [%s].\n' |
889 'Error: %s', git_revision, e) | 954 'Error: %s', git_revision, e) |
890 return None | 955 return None |
891 | 956 |
892 archive_filename, error_msg = _WaitUntilBuildIsReady( | 957 archive_filename, error_msg = _WaitUntilBuildIsReady( |
893 fetch_build_func, bot_name, self.opts.builder_type, build_request_id, | 958 fetch_build_func, builder_name, self.opts.builder_type, |
894 build_timeout) | 959 build_request_id, build_timeout) |
895 if not archive_filename: | 960 if not archive_filename: |
896 logging.warn('%s [revision: %s]', error_msg, git_revision) | 961 logging.warn('%s [revision: %s]', error_msg, git_revision) |
897 return archive_filename | 962 return archive_filename |
898 | 963 |
899 @staticmethod | |
900 def _GetBuilderName(target_platform, builder_type=fetch_build.PERF_BUILDER): | |
901 """Gets builder bot name and build time in seconds based on platform.""" | |
902 if builder_type != fetch_build.PERF_BUILDER: | |
903 raise NotImplementedError('No builder names for non-perf builds yet.') | |
904 if bisect_utils.IsWindowsHost(): | |
905 return 'win_perf_bisect_builder' | |
906 if bisect_utils.IsLinuxHost(): | |
907 if target_platform == 'android': | |
908 return 'android_perf_bisect_builder' | |
909 return 'linux_perf_bisect_builder' | |
910 if bisect_utils.IsMacHost(): | |
911 return 'mac_perf_bisect_builder' | |
912 raise NotImplementedError('Unsupported Platform "%s".' % sys.platform) | |
913 | |
914 @staticmethod | |
915 def _GetBuilderBuildTime(): | |
916 """Returns the time to wait for a build after requesting one.""" | |
917 if bisect_utils.IsWindowsHost(): | |
918 return MAX_WIN_BUILD_TIME | |
919 if bisect_utils.IsLinuxHost(): | |
920 return MAX_LINUX_BUILD_TIME | |
921 if bisect_utils.IsMacHost(): | |
922 return MAX_MAC_BUILD_TIME | |
923 raise NotImplementedError('Unsupported Platform "%s".' % sys.platform) | |
924 | |
925 def _UnzipAndMoveBuildProducts(self, downloaded_file, build_dir, | 964 def _UnzipAndMoveBuildProducts(self, downloaded_file, build_dir, |
926 build_type='Release'): | 965 build_type='Release'): |
927 """Unzips the build archive and moves it to the build output directory. | 966 """Unzips the build archive and moves it to the build output directory. |
928 | 967 |
929 The build output directory is whereever the binaries are expected to | 968 The build output directory is whereever the binaries are expected to |
930 be in order to start Chrome and run tests. | 969 be in order to start Chrome and run tests. |
931 | 970 |
932 TODO: Simplify and clarify this method if possible. | 971 TODO: Simplify and clarify this method if possible. |
933 | 972 |
934 Args: | 973 Args: |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 return 'full-build-win32' | 1036 return 'full-build-win32' |
998 if bisect_utils.IsLinuxHost(): | 1037 if bisect_utils.IsLinuxHost(): |
999 return 'full-build-linux' | 1038 return 'full-build-linux' |
1000 if bisect_utils.IsMacHost(): | 1039 if bisect_utils.IsMacHost(): |
1001 return 'full-build-mac' | 1040 return 'full-build-mac' |
1002 raise NotImplementedError('Unknown platform "%s".' % sys.platform) | 1041 raise NotImplementedError('Unknown platform "%s".' % sys.platform) |
1003 | 1042 |
1004 def IsDownloadable(self, depot): | 1043 def IsDownloadable(self, depot): |
1005 """Checks if build can be downloaded based on target platform and depot.""" | 1044 """Checks if build can be downloaded based on target platform and depot.""" |
1006 if (self.opts.target_platform in ['chromium', 'android'] | 1045 if (self.opts.target_platform in ['chromium', 'android'] |
1007 and self.opts.builder_type == fetch_build.PERF_BUILDER): | 1046 and self.opts.builder_type): |
1008 return (depot == 'chromium' or | 1047 return (depot == 'chromium' or |
1009 'chromium' in bisect_utils.DEPOT_DEPS_NAME[depot]['from'] or | 1048 'chromium' in bisect_utils.DEPOT_DEPS_NAME[depot]['from'] or |
1010 'v8' in bisect_utils.DEPOT_DEPS_NAME[depot]['from']) | 1049 'v8' in bisect_utils.DEPOT_DEPS_NAME[depot]['from']) |
1011 return False | 1050 return False |
1012 | 1051 |
1013 def UpdateDepsContents(self, deps_contents, depot, git_revision, deps_key): | 1052 def UpdateDepsContents(self, deps_contents, depot, git_revision, deps_key): |
1014 """Returns modified version of DEPS file contents. | 1053 """Returns modified version of DEPS file contents. |
1015 | 1054 |
1016 Args: | 1055 Args: |
1017 deps_contents: DEPS file content. | 1056 deps_contents: DEPS file content. |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2781 # bugs. If you change this, please update the perf dashboard as well. | 2820 # bugs. If you change this, please update the perf dashboard as well. |
2782 bisect_utils.OutputAnnotationStepStart('Results') | 2821 bisect_utils.OutputAnnotationStepStart('Results') |
2783 print 'Runtime Error: %s' % e | 2822 print 'Runtime Error: %s' % e |
2784 if opts.output_buildbot_annotations: | 2823 if opts.output_buildbot_annotations: |
2785 bisect_utils.OutputAnnotationStepClosed() | 2824 bisect_utils.OutputAnnotationStepClosed() |
2786 return 1 | 2825 return 1 |
2787 | 2826 |
2788 | 2827 |
2789 if __name__ == '__main__': | 2828 if __name__ == '__main__': |
2790 sys.exit(main()) | 2829 sys.exit(main()) |
OLD | NEW |