| 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 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 | 1165 |
| 1166 # Look for "based on bleeding_edge" and parse out revision | 1166 # Look for "based on bleeding_edge" and parse out revision |
| 1167 if 'based on bleeding_edge' in revision_info['subject']: | 1167 if 'based on bleeding_edge' in revision_info['subject']: |
| 1168 try: | 1168 try: |
| 1169 bleeding_edge_revision = revision_info['subject'].split( | 1169 bleeding_edge_revision = revision_info['subject'].split( |
| 1170 'bleeding_edge revision r')[1] | 1170 'bleeding_edge revision r')[1] |
| 1171 bleeding_edge_revision = int(bleeding_edge_revision.split(')')[0]) | 1171 bleeding_edge_revision = int(bleeding_edge_revision.split(')')[0]) |
| 1172 git_revision = self.source_control.ResolveToRevision( | 1172 git_revision = self.source_control.ResolveToRevision( |
| 1173 bleeding_edge_revision, 'v8_bleeding_edge', 1, | 1173 bleeding_edge_revision, 'v8_bleeding_edge', 1, |
| 1174 cwd=v8_bleeding_edge_dir) | 1174 cwd=v8_bleeding_edge_dir) |
| 1175 return git_revision |
| 1175 except IndexError, ValueError: | 1176 except IndexError, ValueError: |
| 1176 pass | 1177 pass |
| 1177 | 1178 |
| 1178 if not git_revision: | 1179 if not git_revision: |
| 1179 # Wasn't successful, try the old way of looking for "Prepare push to" | 1180 # Wasn't successful, try the old way of looking for "Prepare push to" |
| 1180 git_revision = self.source_control.ResolveToRevision( | 1181 git_revision = self.source_control.ResolveToRevision( |
| 1181 int(svn_revision) - 1, 'v8_bleeding_edge', -1, | 1182 int(svn_revision) - 1, 'v8_bleeding_edge', -1, |
| 1182 cwd=v8_bleeding_edge_dir) | 1183 cwd=v8_bleeding_edge_dir) |
| 1183 | 1184 |
| 1184 if git_revision: | 1185 if git_revision: |
| 1185 revision_info = self.source_control.QueryRevisionInfo(git_revision, | 1186 revision_info = self.source_control.QueryRevisionInfo(git_revision, |
| 1186 cwd=v8_bleeding_edge_dir) | 1187 cwd=v8_bleeding_edge_dir) |
| 1187 | 1188 |
| 1188 if 'Prepare push to trunk' in revision_info['subject']: | 1189 if 'Prepare push to trunk' in revision_info['subject']: |
| 1189 return git_revision | 1190 return git_revision |
| 1190 return None | 1191 return None |
| 1191 | 1192 |
| 1192 def _GetNearestV8BleedingEdgeFromTrunk(self, revision, search_forward=True): | 1193 def _GetNearestV8BleedingEdgeFromTrunk(self, revision, search_forward=True): |
| 1193 cwd = self._GetDepotDirectory('v8') | 1194 cwd = self._GetDepotDirectory('v8') |
| 1194 cmd = ['log', '--format=%ct', '-1', revision] | 1195 cmd = ['log', '--format=%ct', '-1', revision] |
| 1195 output = CheckRunGit(cmd, cwd=cwd) | 1196 output = CheckRunGit(cmd, cwd=cwd) |
| 1196 commit_time = int(output) | 1197 commit_time = int(output) |
| 1197 commits = [] | 1198 commits = [] |
| 1198 | 1199 |
| 1199 if search_forward: | 1200 if search_forward: |
| (...skipping 2182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3382 # The perf dashboard scrapes the "results" step in order to comment on | 3383 # The perf dashboard scrapes the "results" step in order to comment on |
| 3383 # bugs. If you change this, please update the perf dashboard as well. | 3384 # bugs. If you change this, please update the perf dashboard as well. |
| 3384 bisect_utils.OutputAnnotationStepStart('Results') | 3385 bisect_utils.OutputAnnotationStepStart('Results') |
| 3385 print 'Error: %s' % e.message | 3386 print 'Error: %s' % e.message |
| 3386 if opts.output_buildbot_annotations: | 3387 if opts.output_buildbot_annotations: |
| 3387 bisect_utils.OutputAnnotationStepClosed() | 3388 bisect_utils.OutputAnnotationStepClosed() |
| 3388 return 1 | 3389 return 1 |
| 3389 | 3390 |
| 3390 if __name__ == '__main__': | 3391 if __name__ == '__main__': |
| 3391 sys.exit(main()) | 3392 sys.exit(main()) |
| OLD | NEW |