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 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 # "Version 3.X.Y (based on bleeding_edge revision rZ)" | 1875 # "Version 3.X.Y (based on bleeding_edge revision rZ)" |
1876 # So we can just try parsing that out first and fall back to the old way. | 1876 # So we can just try parsing that out first and fall back to the old way. |
1877 v8_dir = self.depot_registry.GetDepotDir('v8') | 1877 v8_dir = self.depot_registry.GetDepotDir('v8') |
1878 v8_bleeding_edge_dir = self.depot_registry.GetDepotDir('v8_bleeding_edge') | 1878 v8_bleeding_edge_dir = self.depot_registry.GetDepotDir('v8_bleeding_edge') |
1879 | 1879 |
1880 revision_info = source_control.QueryRevisionInfo(revision, cwd=v8_dir) | 1880 revision_info = source_control.QueryRevisionInfo(revision, cwd=v8_dir) |
1881 version_re = re.compile("Version (?P<values>[0-9,.]+)") | 1881 version_re = re.compile("Version (?P<values>[0-9,.]+)") |
1882 regex_results = version_re.search(revision_info['subject']) | 1882 regex_results = version_re.search(revision_info['subject']) |
1883 if regex_results: | 1883 if regex_results: |
1884 git_revision = None | 1884 git_revision = None |
1885 # TODO (prasadv): Support the v8 git migration based subject | |
1886 # "based on <githash>" | |
1887 # Look for "based on bleeding_edge" and parse out revision | |
1888 if 'based on bleeding_edge' in revision_info['subject']: | 1885 if 'based on bleeding_edge' in revision_info['subject']: |
1889 try: | 1886 try: |
1890 bleeding_edge_revision = revision_info['subject'].split( | 1887 bleeding_edge_revision = revision_info['subject'].split( |
1891 'bleeding_edge revision r')[1] | 1888 'bleeding_edge revision r')[1] |
1892 bleeding_edge_revision = int(bleeding_edge_revision.split(')')[0]) | 1889 bleeding_edge_revision = int(bleeding_edge_revision.split(')')[0]) |
1893 bleeding_edge_url = ('https://v8.googlecode.com/svn/branches/' | 1890 bleeding_edge_url = ('https://v8.googlecode.com/svn/branches/' |
1894 'bleeding_edge@%s' % bleeding_edge_revision) | 1891 'bleeding_edge@%s' % bleeding_edge_revision) |
1895 cmd = ['log', | 1892 cmd = ['log', |
1896 '--format=%H', | 1893 '--format=%H', |
1897 '--grep', | 1894 '--grep', |
1898 bleeding_edge_url, | 1895 bleeding_edge_url, |
1899 '-1', | 1896 '-1', |
1900 bleeding_edge_branch] | 1897 bleeding_edge_branch] |
1901 output = bisect_utils.CheckRunGit(cmd, cwd=v8_dir) | 1898 output = bisect_utils.CheckRunGit(cmd, cwd=v8_dir) |
1902 if output: | 1899 if output: |
1903 git_revision = output.strip() | 1900 git_revision = output.strip() |
1904 return git_revision | 1901 return git_revision |
1905 except (IndexError, ValueError): | 1902 except (IndexError, ValueError): |
1906 pass | 1903 pass |
| 1904 else: |
| 1905 # V8 rolls description changed after V8 git migration, new description |
| 1906 # includes "Version 3.X.Y (based on <git hash>)" |
| 1907 try: |
| 1908 rxp = re.compile('based on (?P<git_revision>[a-fA-F0-9]+)') |
| 1909 re_results = rxp.search(revision_info['subject']) |
| 1910 if re_results: |
| 1911 return re_results.group('git_revision') |
| 1912 except (IndexError, ValueError): |
| 1913 pass |
1907 if not git_revision: | 1914 if not git_revision: |
1908 # Wasn't successful, try the old way of looking for "Prepare push to" | 1915 # Wasn't successful, try the old way of looking for "Prepare push to" |
1909 git_revision = source_control.ResolveToRevision( | 1916 git_revision = source_control.ResolveToRevision( |
1910 int(commit_position) - 1, 'v8_bleeding_edge', | 1917 int(commit_position) - 1, 'v8_bleeding_edge', |
1911 bisect_utils.DEPOT_DEPS_NAME, -1, cwd=v8_bleeding_edge_dir) | 1918 bisect_utils.DEPOT_DEPS_NAME, -1, cwd=v8_bleeding_edge_dir) |
1912 | 1919 |
1913 if git_revision: | 1920 if git_revision: |
1914 revision_info = source_control.QueryRevisionInfo(git_revision, | 1921 revision_info = source_control.QueryRevisionInfo(git_revision, |
1915 cwd=v8_bleeding_edge_dir) | 1922 cwd=v8_bleeding_edge_dir) |
1916 | 1923 |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2937 bisect_utils.OutputAnnotationStepStart('Results') | 2944 bisect_utils.OutputAnnotationStepStart('Results') |
2938 print 'Error: ', e.message | 2945 print 'Error: ', e.message |
2939 logging.warn('A RuntimeError was caught: %s', e.message) | 2946 logging.warn('A RuntimeError was caught: %s', e.message) |
2940 if opts.output_buildbot_annotations: | 2947 if opts.output_buildbot_annotations: |
2941 bisect_utils.OutputAnnotationStepClosed() | 2948 bisect_utils.OutputAnnotationStepClosed() |
2942 return 1 | 2949 return 1 |
2943 | 2950 |
2944 | 2951 |
2945 if __name__ == '__main__': | 2952 if __name__ == '__main__': |
2946 sys.exit(main()) | 2953 sys.exit(main()) |
OLD | NEW |