Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 DEPS = [ | |
| 6 'bot_update', | |
| 7 'chromium', | |
| 8 'gclient', | |
| 9 'path', | |
| 10 'platform', | |
| 11 'properties', | |
| 12 'python', | |
| 13 'step', | |
| 14 'step_history', | |
| 15 ] | |
| 16 | |
| 17 | |
| 18 # List of the benchmark that we run during the profiling step. | |
| 19 _BENCHMARKS_TO_RUN = { | |
| 20 'peacekeeper.dom', | |
| 21 'peacekeeper.array', | |
| 22 'peacekeeper.html5', | |
| 23 'peacekeeper.string', | |
| 24 'peacekeeper.render', | |
| 25 'dromaeo.domcoreattr', | |
| 26 'dromaeo.domcoremodify', | |
| 27 'dromaeo.domcorequery', | |
| 28 'dromaeo.domcoretraverse', | |
| 29 'dromaeo.jslibattrjquery', | |
| 30 'dromaeo.jslibattrprototype', | |
| 31 'dromaeo.jslibeventjquery', | |
| 32 'dromaeo.jslibeventprototype', | |
| 33 'dromaeo.jslibmodifyjquery', | |
| 34 'dromaeo.jslibmodifyprototype', | |
| 35 'dromaeo.jslibstylejquery', | |
| 36 'dromaeo.jslibstyleprototype', | |
| 37 'dromaeo.jslibtraversejquery', | |
| 38 'dromaeo.jslibtraverseprototype', | |
| 39 'sunspider', | |
| 40 'jsgamebench', | |
| 41 'kraken', | |
| 42 } | |
| 43 | |
| 44 | |
| 45 # Run a telemetry benchmark under the Windows PGO profiler. | |
| 46 def RunTelemetryBenchmark(api, testname): | |
| 47 args = [ | |
| 48 '--profiler=win_pgo_profiler', | |
| 49 '--use-live-sites', | |
| 50 testname, | |
| 51 ] | |
| 52 return api.python( | |
| 53 'Telemetry benchmark: %s' % testname, | |
| 54 api.path['checkout'].join('tools', | |
| 55 'perf', | |
| 56 'run_benchmark'), | |
| 57 args) | |
| 58 | |
| 59 | |
| 60 def GenSteps(api): | |
| 61 api.step.auto_resolve_conflicts = True | |
| 62 api.gclient.set_config('chromium_lkgr') | |
| 63 api.chromium.set_config('chromium', 'Release') | |
| 64 | |
| 65 if api.platform.is_win: | |
|
iannucci
2014/05/27 20:44:21
can this recipe even run on non-windows? PGO is pr
Sébastien Marchand
2014/06/05 14:54:52
PGO isn't really Windows specific (it could potent
| |
| 66 yield api.chromium.taskkill() | |
| 67 yield api.bot_update.ensure_checkout(), | |
| 68 if not api.step_history.last_step().json.output['did_run']: | |
| 69 yield api.gclient.checkout(), | |
| 70 | |
| 71 # First step: compilation of the instrumented build. | |
| 72 api.chromium.apply_config('chrome_pgo_instrument') | |
| 73 yield api.chromium.runhooks() | |
| 74 yield api.chromium.compile(targets=['chrome']) | |
| 75 | |
| 76 # Remove the profile files from the previous builds. | |
| 77 yield api.python.inline( | |
|
iannucci
2014/05/27 20:44:21
I think theres api.path.rmcontents which does (bas
Sébastien Marchand
2014/06/12 15:13:31
Done, this is a little bit ugly because glob.glob(
| |
| 78 'Remove previous profile files.', | |
| 79 """ | |
| 80 import glob | |
| 81 import os | |
| 82 import sys | |
| 83 for filename in glob.glob(os.path.join(sys.argv[1],'*.pgc')): | |
| 84 os.remove(filename) | |
| 85 """, | |
| 86 args=[api.chromium.c.build_dir] | |
| 87 ) | |
| 88 | |
| 89 # Second step: profiling of the instrumented build. | |
| 90 for benchmark in _BENCHMARKS_TO_RUN: | |
| 91 yield RunTelemetryBenchmark(api, benchmark) | |
| 92 | |
| 93 # Third step: Compilation of the optimized build, this will use the profile | |
| 94 # data files produced by the previous step. | |
| 95 api.chromium.apply_config('chrome_pgo_optimize') | |
| 96 yield api.chromium.runhooks() | |
| 97 yield api.chromium.compile(targets=['chrome']) | |
|
iannucci
2014/05/27 20:44:21
should probably plan to upload the artifacts to go
Sébastien Marchand
2014/06/05 14:54:52
I'm not sure at this point... The purpose of this
| |
| 98 | |
| 99 | |
| 100 def _sanitize_nonalpha(text): | |
| 101 return ''.join(c if c.isalnum() else '_' for c in text) | |
|
iannucci
2014/05/27 20:44:21
You can nest this inside the GenTests function :)
Sébastien Marchand
2014/06/05 14:54:52
Done.
| |
| 102 | |
| 103 | |
| 104 def GenTests(api): | |
| 105 mastername = 'chromium.fyi' | |
| 106 buildername = 'Chromium Win PGO Builder' | |
| 107 | |
| 108 test = ( | |
|
iannucci
2014/05/27 20:44:21
nit: I would just yield this directly instead of h
Sébastien Marchand
2014/06/05 14:54:52
Done.
| |
| 109 api.test('full_%s_%s' % (_sanitize_nonalpha(mastername), | |
| 110 _sanitize_nonalpha(buildername))) + | |
| 111 api.properties.generic(mastername=mastername, buildername=buildername) + | |
| 112 api.platform('win', 32) | |
| 113 ) | |
| 114 | |
| 115 yield test | |
| OLD | NEW |