Chromium Code Reviews| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 """ | 49 """ |
| 50 Generates the instrumented version of the binaries. | 50 Generates the instrumented version of the binaries. |
| 51 """ | 51 """ |
| 52 self.m.chromium.set_config(bot_config['chromium_config_instrument'], | 52 self.m.chromium.set_config(bot_config['chromium_config_instrument'], |
| 53 **bot_config.get('chromium_config_kwargs')) | 53 **bot_config.get('chromium_config_kwargs')) |
| 54 self.m.chromium.runhooks(name='Runhooks: Instrumentation phase.') | 54 self.m.chromium.runhooks(name='Runhooks: Instrumentation phase.') |
| 55 self.m.chromium.run_mb( | 55 self.m.chromium.run_mb( |
| 56 self.m.properties['mastername'], | 56 self.m.properties['mastername'], |
| 57 self.m.properties['buildername'], | 57 self.m.properties['buildername'], |
| 58 use_goma=False, | 58 use_goma=False, |
| 59 phase=1) | 59 phase=0) |
|
shenghuazhang
2016/10/08 00:21:08
The 'win_pgo' config keys are set to be '0', '1'.
Dirk Pranke
2016/10/11 00:18:23
Nope; this'd break the old branches, i.e., this mo
shenghuazhang
2016/10/12 22:42:04
Oh yeah I see. This is very clear, I will change i
| |
| 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 for benchmark in _BENCHMARKS_TO_RUN: |
| 69 try: | 69 try: |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 88 """ | 88 """ |
| 89 Generates the optimized version of the binaries. | 89 Generates the optimized version of the binaries. |
| 90 """ | 90 """ |
| 91 self.m.chromium.set_config(bot_config['chromium_config_optimize'], | 91 self.m.chromium.set_config(bot_config['chromium_config_optimize'], |
| 92 **bot_config.get('chromium_config_kwargs')) | 92 **bot_config.get('chromium_config_kwargs')) |
| 93 self.m.chromium.runhooks(name='Runhooks: Optimization phase.') | 93 self.m.chromium.runhooks(name='Runhooks: Optimization phase.') |
| 94 self.m.chromium.run_mb( | 94 self.m.chromium.run_mb( |
| 95 self.m.properties['mastername'], | 95 self.m.properties['mastername'], |
| 96 self.m.properties['buildername'], | 96 self.m.properties['buildername'], |
| 97 use_goma=False, | 97 use_goma=False, |
| 98 phase=2) | 98 phase=1) |
|
shenghuazhang
2016/10/08 00:21:08
Relates here
Dirk Pranke
2016/10/11 00:18:23
same answer :).
shenghuazhang
2016/10/12 22:42:04
Done.
| |
| 99 self.m.chromium.compile(name='Compile: Optimization phase.') | 99 self.m.chromium.compile(name='Compile: Optimization phase.') |
| 100 | 100 |
| 101 def compile_pgo(self, bot_config): | 101 def compile_pgo(self, bot_config): |
| 102 """ | 102 """ |
| 103 Do a PGO build. This takes care of building an instrumented image, profiling | 103 Do a PGO build. This takes care of building an instrumented image, profiling |
| 104 it and then compiling the optimized version of it. | 104 it and then compiling the optimized version of it. |
| 105 """ | 105 """ |
| 106 self.m.gclient.set_config(bot_config['gclient_config']) | 106 self.m.gclient.set_config(bot_config['gclient_config']) |
| 107 | 107 |
| 108 # Augment the DEPS path if needed. | 108 # Augment the DEPS path if needed. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 120 | 120 |
| 121 # First step: compilation of the instrumented build. | 121 # First step: compilation of the instrumented build. |
| 122 self._compile_instrumented_image(bot_config) | 122 self._compile_instrumented_image(bot_config) |
| 123 | 123 |
| 124 # Second step: profiling of the instrumented build. | 124 # Second step: profiling of the instrumented build. |
| 125 self._run_pgo_benchmarks() | 125 self._run_pgo_benchmarks() |
| 126 | 126 |
| 127 # Third step: Compilation of the optimized build, this will use the | 127 # Third step: Compilation of the optimized build, this will use the |
| 128 # profile data files produced by the previous step. | 128 # profile data files produced by the previous step. |
| 129 self._compile_optimized_image(bot_config) | 129 self._compile_optimized_image(bot_config) |
| OLD | NEW |