| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 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 """Performance Test Bisect Tool |
| 7 | 7 |
| 8 This script bisects a series of changelists using binary search. It starts at | 8 This script bisects a series of changelists using binary search. It starts at |
| 9 a bad revision where a performance metric has regressed, and asks for a last | 9 a bad revision where a performance metric has regressed, and asks for a last |
| 10 known-good revision. It will then binary search across this revision range by | 10 known-good revision. It will then binary search across this revision range by |
| (...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 | 1402 |
| 1403 def _RunPostSync(self, _depot): | 1403 def _RunPostSync(self, _depot): |
| 1404 """Performs any work after syncing. | 1404 """Performs any work after syncing. |
| 1405 | 1405 |
| 1406 Args: | 1406 Args: |
| 1407 depot: Depot name. | 1407 depot: Depot name. |
| 1408 | 1408 |
| 1409 Returns: | 1409 Returns: |
| 1410 True if successful. | 1410 True if successful. |
| 1411 """ | 1411 """ |
| 1412 if self.opts.target_platform == 'android': | 1412 if 'android' in self.opts.target_platform: |
| 1413 if not builder.SetupAndroidBuildEnvironment(self.opts, | 1413 if not builder.SetupAndroidBuildEnvironment(self.opts, |
| 1414 path_to_src=self.src_cwd): | 1414 path_to_src=self.src_cwd): |
| 1415 return False | 1415 return False |
| 1416 | 1416 |
| 1417 return self.RunGClientHooks() | 1417 return self.RunGClientHooks() |
| 1418 | 1418 |
| 1419 @staticmethod | 1419 @staticmethod |
| 1420 def ShouldSkipRevision(depot, revision): | 1420 def ShouldSkipRevision(depot, revision): |
| 1421 """Checks whether a particular revision can be safely skipped. | 1421 """Checks whether a particular revision can be safely skipped. |
| 1422 | 1422 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 | 1533 |
| 1534 if sync_client: | 1534 if sync_client: |
| 1535 self.PerformPreBuildCleanup() | 1535 self.PerformPreBuildCleanup() |
| 1536 | 1536 |
| 1537 # When using gclient to sync, you need to specify the depot you | 1537 # When using gclient to sync, you need to specify the depot you |
| 1538 # want so that all the dependencies sync properly as well. | 1538 # want so that all the dependencies sync properly as well. |
| 1539 # i.e. gclient sync src@<SHA1> | 1539 # i.e. gclient sync src@<SHA1> |
| 1540 if sync_client == 'gclient' and revision: | 1540 if sync_client == 'gclient' and revision: |
| 1541 revision = '%s@%s' % (bisect_utils.DEPOT_DEPS_NAME[depot]['src'], | 1541 revision = '%s@%s' % (bisect_utils.DEPOT_DEPS_NAME[depot]['src'], |
| 1542 revision) | 1542 revision) |
| 1543 if depot == 'chromium' and self.opts.target_platform == 'android-chrome': |
| 1544 return self._SyncRevisionsForAndroidChrome(revision) |
| 1543 | 1545 |
| 1544 return source_control.SyncToRevision(revision, sync_client) | 1546 return source_control.SyncToRevision(revision, sync_client) |
| 1545 | 1547 |
| 1548 def _SyncRevisionsForAndroidChrome(self, revision): |
| 1549 """Syncs android-chrome and chromium repos to particular revision. |
| 1550 |
| 1551 This is a special case for android-chrome as the gclient sync for chromium |
| 1552 overwrites the android-chrome revision to TOT. Therefore both the repos |
| 1553 are synced to known revisions. |
| 1554 |
| 1555 Args: |
| 1556 revision: Git hash of the Chromium to sync. |
| 1557 |
| 1558 Returns: |
| 1559 True if successful, False otherwise. |
| 1560 """ |
| 1561 revisions_list = [revision] |
| 1562 current_android_rev = source_control.GetCurrentRevision( |
| 1563 self.depot_registry.GetDepotDir('android-chrome')) |
| 1564 revisions_list.append( |
| 1565 '%s@%s' % (bisect_utils.DEPOT_DEPS_NAME['android-chrome']['src'], |
| 1566 current_android_rev)) |
| 1567 return not bisect_utils.RunGClientAndSync(revisions_list) |
| 1568 |
| 1546 def _CheckIfRunPassed(self, current_value, known_good_value, known_bad_value): | 1569 def _CheckIfRunPassed(self, current_value, known_good_value, known_bad_value): |
| 1547 """Given known good and bad values, decide if the current_value passed | 1570 """Given known good and bad values, decide if the current_value passed |
| 1548 or failed. | 1571 or failed. |
| 1549 | 1572 |
| 1550 Args: | 1573 Args: |
| 1551 current_value: The value of the metric being checked. | 1574 current_value: The value of the metric being checked. |
| 1552 known_bad_value: The reference value for a "failed" run. | 1575 known_bad_value: The reference value for a "failed" run. |
| 1553 known_good_value: The reference value for a "passed" run. | 1576 known_good_value: The reference value for a "passed" run. |
| 1554 | 1577 |
| 1555 Returns: | 1578 Returns: |
| (...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2769 # bugs. If you change this, please update the perf dashboard as well. | 2792 # bugs. If you change this, please update the perf dashboard as well. |
| 2770 bisect_utils.OutputAnnotationStepStart('Results') | 2793 bisect_utils.OutputAnnotationStepStart('Results') |
| 2771 print 'Runtime Error: %s' % e | 2794 print 'Runtime Error: %s' % e |
| 2772 if opts.output_buildbot_annotations: | 2795 if opts.output_buildbot_annotations: |
| 2773 bisect_utils.OutputAnnotationStepClosed() | 2796 bisect_utils.OutputAnnotationStepClosed() |
| 2774 return 1 | 2797 return 1 |
| 2775 | 2798 |
| 2776 | 2799 |
| 2777 if __name__ == '__main__': | 2800 if __name__ == '__main__': |
| 2778 sys.exit(main()) | 2801 sys.exit(main()) |
| OLD | NEW |