| 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 args = [ | 68 for benchmark in _BENCHMARKS_TO_RUN: |
| 69 '--browser-type', self.m.chromium.c.build_config_fs.lower(), | 69 try: |
| 70 '--target-cpu', self.m.chromium.c.gyp_env.GYP_DEFINES['target_arch'], | 70 args = [ |
| 71 '--build-dir', self.m.chromium.output_dir, | 71 '--checkout-dir', self.m.path['checkout'], |
| 72 ] | 72 '--browser-type', self.m.chromium.c.build_config_fs.lower(), |
| 73 self.m.python( | 73 '--target-bits', self.m.chromium.c.TARGET_BITS, |
| 74 'Profiling benchmarks.', | 74 '--build-dir', self.m.chromium.output_dir, |
| 75 self.m.path['checkout'].join('build', 'win', | 75 '--benchmark', benchmark, |
| 76 'run_pgo_profiling_benchmarks.py'), | 76 ] |
| 77 args) | 77 self.m.python( |
| 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 |
| 78 | 86 |
| 79 def _compile_optimized_image(self, bot_config): | 87 def _compile_optimized_image(self, bot_config): |
| 80 """ | 88 """ |
| 81 Generates the optimized version of the binaries. | 89 Generates the optimized version of the binaries. |
| 82 """ | 90 """ |
| 83 self.m.chromium.set_config(bot_config['chromium_config_optimize'], | 91 self.m.chromium.set_config(bot_config['chromium_config_optimize'], |
| 84 **bot_config.get('chromium_config_kwargs')) | 92 **bot_config.get('chromium_config_kwargs')) |
| 85 self.m.chromium.runhooks(name='Runhooks: Optimization phase.') | 93 self.m.chromium.runhooks(name='Runhooks: Optimization phase.') |
| 86 self.m.chromium.run_mb( | 94 self.m.chromium.run_mb( |
| 87 self.m.properties['mastername'], | 95 self.m.properties['mastername'], |
| (...skipping 24 matching lines...) Expand all Loading... |
| 112 | 120 |
| 113 # First step: compilation of the instrumented build. | 121 # First step: compilation of the instrumented build. |
| 114 self._compile_instrumented_image(bot_config) | 122 self._compile_instrumented_image(bot_config) |
| 115 | 123 |
| 116 # Second step: profiling of the instrumented build. | 124 # Second step: profiling of the instrumented build. |
| 117 self._run_pgo_benchmarks() | 125 self._run_pgo_benchmarks() |
| 118 | 126 |
| 119 # Third step: Compilation of the optimized build, this will use the | 127 # Third step: Compilation of the optimized build, this will use the |
| 120 # profile data files produced by the previous step. | 128 # profile data files produced by the previous step. |
| 121 self._compile_optimized_image(bot_config) | 129 self._compile_optimized_image(bot_config) |
| OLD | NEW |