| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 def _compile_instrumented_image(self, bot_config): | 51 def _compile_instrumented_image(self, bot_config): |
| 52 """ | 52 """ |
| 53 Generates the instrumented version of the binaries. | 53 Generates the instrumented version of the binaries. |
| 54 """ | 54 """ |
| 55 self.m.chromium.set_config(bot_config['chromium_config_instrument'], | 55 self.m.chromium.set_config(bot_config['chromium_config_instrument'], |
| 56 **bot_config.get('chromium_config_kwargs')) | 56 **bot_config.get('chromium_config_kwargs')) |
| 57 self.m.chromium.runhooks(name='Runhooks: Instrumentation phase.') | 57 self.m.chromium.runhooks(name='Runhooks: Instrumentation phase.') |
| 58 # Remove the profile files from the previous builds. | 58 # Remove the profile files from the previous builds. |
| 59 self.m.file.rmwildcard('*.pg[cd]', str(self.m.chromium.output_dir)) | 59 self.m.file.rmwildcard('*.pg[cd]', str(self.m.chromium.output_dir)) |
| 60 self.m.chromium.compile(name='Compile: Instrumentation phase.', | 60 self.m.chromium.compile(name='Compile: Instrumentation phase.') |
| 61 force_clobber=bot_config.get('clobber', False)) | |
| 62 | 61 |
| 63 def _run_pgo_benchmarks(self): | 62 def _run_pgo_benchmarks(self): |
| 64 """ | 63 """ |
| 65 Run a suite of telemetry benchmarks to generate some profiling data. | 64 Run a suite of telemetry benchmarks to generate some profiling data. |
| 66 """ | 65 """ |
| 67 for benchmark in _BENCHMARKS_TO_RUN: | 66 for benchmark in _BENCHMARKS_TO_RUN: |
| 68 try: | 67 try: |
| 69 args = [ | 68 args = [ |
| 70 '--checkout-dir', self.m.path['checkout'], | 69 '--checkout-dir', self.m.path['checkout'], |
| 71 '--browser-type', self.m.chromium.c.build_config_fs.lower(), | 70 '--browser-type', self.m.chromium.c.build_config_fs.lower(), |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 111 |
| 113 # First step: compilation of the instrumented build. | 112 # First step: compilation of the instrumented build. |
| 114 self._compile_instrumented_image(bot_config) | 113 self._compile_instrumented_image(bot_config) |
| 115 | 114 |
| 116 # Second step: profiling of the instrumented build. | 115 # Second step: profiling of the instrumented build. |
| 117 self._run_pgo_benchmarks() | 116 self._run_pgo_benchmarks() |
| 118 | 117 |
| 119 # Third step: Compilation of the optimized build, this will use the | 118 # Third step: Compilation of the optimized build, this will use the |
| 120 # profile data files produced by the previous step. | 119 # profile data files produced by the previous step. |
| 121 self._compile_optimized_image(bot_config) | 120 self._compile_optimized_image(bot_config) |
| OLD | NEW |