| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 from recipe_engine import recipe_api | 5 from recipe_engine import recipe_api |
| 6 | 6 |
| 7 | 7 |
| 8 # List of the benchmark that we run during the profiling step. | 8 # List of the benchmark that we run during the profiling step. |
| 9 # | 9 # |
| 10 # TODO(sebmarchand): Move this into a BenchmarkSuite in telemetry, this way | 10 # TODO(sebmarchand): Move this into a BenchmarkSuite in telemetry, this way |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 use_goma=False, | 58 use_goma=False, |
| 59 phase=1) | 59 phase=1) |
| 60 # Remove the profile files from the previous builds. | 60 # Remove the profile files from the previous builds. |
| 61 self.m.file.rmwildcard('*.pg[cd]', str(self.m.chromium.output_dir)) | 61 self.m.file.rmwildcard('*.pg[cd]', str(self.m.chromium.output_dir)) |
| 62 self.m.chromium.compile(name='Compile: Instrumentation phase.') | 62 self.m.chromium.compile(name='Compile: Instrumentation phase.') |
| 63 | 63 |
| 64 def _run_pgo_benchmarks(self): | 64 def _run_pgo_benchmarks(self): |
| 65 """ | 65 """ |
| 66 Run a suite of telemetry benchmarks to generate some profiling data. | 66 Run a suite of telemetry benchmarks to generate some profiling data. |
| 67 """ | 67 """ |
| 68 for benchmark in _BENCHMARKS_TO_RUN: | 68 args = [ |
| 69 try: | 69 '--browser-type', self.m.chromium.c.build_config_fs.lower(), |
| 70 args = [ | 70 '--target-cpu', self.m.chromium.c.gyp_env.GYP_DEFINES['target_arch'], |
| 71 '--checkout-dir', self.m.path['checkout'], | 71 '--build-dir', self.m.chromium.output_dir, |
| 72 '--browser-type', self.m.chromium.c.build_config_fs.lower(), | 72 ] |
| 73 '--target-bits', self.m.chromium.c.TARGET_BITS, | 73 self.m.python( |
| 74 '--build-dir', self.m.chromium.output_dir, | 74 'Profiling benchmarks.', |
| 75 '--benchmark', benchmark, | 75 self.m.path['checkout'].join('build', 'win', |
| 76 ] | 76 'run_pgo_profiling_benchmarks.py'), |
| 77 self.m.python( | 77 args) |
| 78 'Telemetry benchmark: %s' % benchmark, | |
| 79 self.resource('run_benchmark.py'), | |
| 80 args) | |
| 81 except self.m.step.StepFailure: | |
| 82 # Turn the failures into warning, we shouldn't stop the build for a | |
| 83 # benchmark. | |
| 84 step_result = self.m.step.active_result | |
| 85 step_result.presentation.status = self.m.step.WARNING | |
| 86 | 78 |
| 87 def _compile_optimized_image(self, bot_config): | 79 def _compile_optimized_image(self, bot_config): |
| 88 """ | 80 """ |
| 89 Generates the optimized version of the binaries. | 81 Generates the optimized version of the binaries. |
| 90 """ | 82 """ |
| 91 self.m.chromium.set_config(bot_config['chromium_config_optimize'], | 83 self.m.chromium.set_config(bot_config['chromium_config_optimize'], |
| 92 **bot_config.get('chromium_config_kwargs')) | 84 **bot_config.get('chromium_config_kwargs')) |
| 93 self.m.chromium.runhooks(name='Runhooks: Optimization phase.') | 85 self.m.chromium.runhooks(name='Runhooks: Optimization phase.') |
| 94 self.m.chromium.run_mb( | 86 self.m.chromium.run_mb( |
| 95 self.m.properties['mastername'], | 87 self.m.properties['mastername'], |
| (...skipping 24 matching lines...) Expand all Loading... |
| 120 | 112 |
| 121 # First step: compilation of the instrumented build. | 113 # First step: compilation of the instrumented build. |
| 122 self._compile_instrumented_image(bot_config) | 114 self._compile_instrumented_image(bot_config) |
| 123 | 115 |
| 124 # Second step: profiling of the instrumented build. | 116 # Second step: profiling of the instrumented build. |
| 125 self._run_pgo_benchmarks() | 117 self._run_pgo_benchmarks() |
| 126 | 118 |
| 127 # Third step: Compilation of the optimized build, this will use the | 119 # Third step: Compilation of the optimized build, this will use the |
| 128 # profile data files produced by the previous step. | 120 # profile data files produced by the previous step. |
| 129 self._compile_optimized_image(bot_config) | 121 self._compile_optimized_image(bot_config) |
| OLD | NEW |