| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Process crashes from Chrome crash server and find culprits for them.""" | 5 """Process crashes from Chrome crash server and find culprits for them.""" |
| 6 | 6 |
| 7 from common import chromium_deps | 7 from common import chromium_deps |
| 8 from crash import detect_regression_range | 8 from crash import detect_regression_range |
| 9 from crash import findit_for_crash | 9 from crash import findit_for_crash |
| 10 from crash.fracas_parser import FracasParser | 10 from crash.fracas_parser import FracasParser |
| 11 from crash.project_classifier import ProjectClassifier |
| 12 from crash.component_classifier import ComponentClassifier |
| 11 | 13 |
| 12 | 14 |
| 13 def FindCulpritForChromeCrash(signature, platform, | 15 def FindCulpritForChromeCrash(signature, platform, |
| 14 stack_trace, crashed_version, historic_metadata): | 16 stack_trace, crashed_version, historic_metadata): |
| 15 """Finds culprits for a Chrome crash. | 17 """Finds culprits for a Chrome crash. |
| 16 | 18 |
| 17 Args: | 19 Args: |
| 18 platform (str): The platform name, could be 'win', 'mac', 'linux', | 20 platform (str): The platform name, could be 'win', 'mac', 'linux', |
| 19 'android', 'ios', etc. | 21 'android', 'ios', etc. |
| 20 signature (str): The signature of a crash on the Chrome crash server. | 22 signature (str): The signature of a crash on the Chrome crash server. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 75 |
| 74 if regression_versions: | 76 if regression_versions: |
| 75 last_good_version, first_bad_version = regression_versions | 77 last_good_version, first_bad_version = regression_versions |
| 76 # Get regression deps and crash deps. | 78 # Get regression deps and crash deps. |
| 77 regression_deps_rolls = chromium_deps.GetDEPSRollsDict( | 79 regression_deps_rolls = chromium_deps.GetDEPSRollsDict( |
| 78 last_good_version, first_bad_version, platform) | 80 last_good_version, first_bad_version, platform) |
| 79 | 81 |
| 80 culprit_results = findit_for_crash.FindItForCrash( | 82 culprit_results = findit_for_crash.FindItForCrash( |
| 81 stacktrace, regression_deps_rolls, crash_deps) | 83 stacktrace, regression_deps_rolls, crash_deps) |
| 82 | 84 |
| 83 # TODO(katesonia): Enable dependency classifier and component classifier. | 85 crash_stack = stacktrace.crash_stack |
| 84 suspected_project = '' | 86 suspected_project = ProjectClassifier().Classify( |
| 85 suspected_components = [] | 87 culprit_results, crash_stack) |
| 88 suspected_components = ComponentClassifier().Classify( |
| 89 culprit_results, crash_stack) |
| 86 | 90 |
| 87 return ( | 91 return ( |
| 88 { | 92 { |
| 89 'found': (bool(suspected_project) or bool(suspected_components) or | 93 'found': (bool(suspected_project) or bool(suspected_components) or |
| 90 bool(culprit_results)), | 94 bool(culprit_results)), |
| 91 'suspected_project': suspected_project, | 95 'suspected_project': suspected_project, |
| 92 'suspected_components': suspected_components, | 96 'suspected_components': suspected_components, |
| 93 'culprits': culprit_results, | 97 'culprits': culprit_results, |
| 94 }, | 98 }, |
| 95 { | 99 { |
| 96 'found_suspects': bool(culprit_results), | 100 'found_suspects': bool(culprit_results), |
| 97 'has_regression_range': bool(regression_versions), | 101 'has_regression_range': bool(regression_versions), |
| 98 'solution': 'core_algorithm', | 102 'solution': 'core_algorithm', |
| 99 } | 103 } |
| 100 ) | 104 ) |
| OLD | NEW |