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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 def __init__(self, **kwargs): | 42 def __init__(self, **kwargs): |
43 super(PGOApi, self).__init__(**kwargs) | 43 super(PGOApi, self).__init__(**kwargs) |
44 | 44 |
45 def _compile_instrumented_image(self, bot_config): | 45 def _compile_instrumented_image(self, bot_config): |
46 """ | 46 """ |
47 Generates the instrumented version of the binaries. | 47 Generates the instrumented version of the binaries. |
48 """ | 48 """ |
49 self.m.chromium.set_config(bot_config['chromium_config_instrument'], | 49 self.m.chromium.set_config(bot_config['chromium_config_instrument'], |
50 **bot_config.get('chromium_config_kwargs')) | 50 **bot_config.get('chromium_config_kwargs')) |
| 51 for c in bot_config.get('chromium_apply_config', []): |
| 52 self.m.chromium.apply_config(c) |
51 self.m.chromium.runhooks(name='Runhooks: Instrumentation phase.') | 53 self.m.chromium.runhooks(name='Runhooks: Instrumentation phase.') |
52 # Remove the profile files from the previous builds. | 54 # Remove the profile files from the previous builds. |
53 self.m.file.rmwildcard('*.pg[cd]', str(self.m.chromium.output_dir)) | 55 self.m.file.rmwildcard('*.pg[cd]', str(self.m.chromium.output_dir)) |
54 self.m.chromium.compile(name='Compile: Instrumentation phase.', | 56 self.m.chromium.compile(name='Compile: Instrumentation phase.', |
55 force_clobber=bot_config.get('clobber', False)) | 57 force_clobber=bot_config.get('clobber', False)) |
56 | 58 |
57 def _run_pgo_benchmarks(self): | 59 def _run_pgo_benchmarks(self): |
58 """ | 60 """ |
59 Run a suite of telemetry benchmarks to generate some profiling data. | 61 Run a suite of telemetry benchmarks to generate some profiling data. |
60 """ | 62 """ |
(...skipping 15 matching lines...) Expand all Loading... |
76 # benchmark. | 78 # benchmark. |
77 step_result = self.m.step.active_result | 79 step_result = self.m.step.active_result |
78 step_result.presentation.status = self.m.step.WARNING | 80 step_result.presentation.status = self.m.step.WARNING |
79 | 81 |
80 def _compile_optimized_image(self, bot_config): | 82 def _compile_optimized_image(self, bot_config): |
81 """ | 83 """ |
82 Generates the optimized version of the binaries. | 84 Generates the optimized version of the binaries. |
83 """ | 85 """ |
84 self.m.chromium.set_config(bot_config['chromium_config_optimize'], | 86 self.m.chromium.set_config(bot_config['chromium_config_optimize'], |
85 **bot_config.get('chromium_config_kwargs')) | 87 **bot_config.get('chromium_config_kwargs')) |
| 88 for c in bot_config.get('chromium_apply_config', []): |
| 89 self.m.chromium.apply_config(c) |
86 self.m.chromium.runhooks(name='Runhooks: Optimization phase.') | 90 self.m.chromium.runhooks(name='Runhooks: Optimization phase.') |
87 | 91 |
88 # Increase the stack size of pgomgr.exe. | 92 # Increase the stack size of pgomgr.exe. |
89 # | 93 # |
90 # TODO(sebmarchand): Remove this once the bug has been fixed. | 94 # TODO(sebmarchand): Remove this once the bug has been fixed. |
91 self.m.python('increase pgomgr.exe stack size', | 95 self.m.python('increase pgomgr.exe stack size', |
92 self.resource('increase_pgomgr_stack_size.py'), | 96 self.resource('increase_pgomgr_stack_size.py'), |
93 args=[self.m.path['depot_tools'].join( | 97 args=[self.m.path['depot_tools'].join( |
94 'win_toolchain', 'vs2013_files', 'VC', 'bin', 'amd64_x86')], | 98 'win_toolchain', 'vs2013_files', 'VC', 'bin', 'amd64_x86')], |
95 cwd=self.m.path['slave_build']) | 99 cwd=self.m.path['slave_build']) |
(...skipping 27 matching lines...) Expand all Loading... |
123 | 127 |
124 # Third step: Compilation of the optimized build, this will use the | 128 # Third step: Compilation of the optimized build, this will use the |
125 # profile data files produced by the previous step. | 129 # profile data files produced by the previous step. |
126 self._compile_optimized_image(bot_config) | 130 self._compile_optimized_image(bot_config) |
127 except self.m.step.StepFailure as e: | 131 except self.m.step.StepFailure as e: |
128 if bot_config.get('fail_silently'): | 132 if bot_config.get('fail_silently'): |
129 step_result = self.m.step.active_result | 133 step_result = self.m.step.active_result |
130 step_result.presentation.status = self.m.step.WARNING | 134 step_result.presentation.status = self.m.step.WARNING |
131 else: | 135 else: |
132 raise e | 136 raise e |
OLD | NEW |