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) | |
|
iannucci
2014/06/19 21:37:17
personally, I would format this like
return api.p
Sébastien Marchand
2014/07/03 19:13:17
Shorter and more readable, I like that.
| |
| 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') | |
|
iannucci
2014/06/19 21:37:17
flip the order of these two lines. Since 'chromium
Sébastien Marchand
2014/07/03 19:13:17
Done.
| |
| 64 | |
| 65 yield api.chromium.taskkill() | |
| 66 yield api.bot_update.ensure_checkout(), | |
|
iannucci
2014/06/19 21:37:17
you'll want to remove these trailing commas
Sébastien Marchand
2014/07/03 19:13:17
Oops, thanks.
| |
| 67 if not api.step_history.last_step().json.output['did_run']: | |
|
iannucci
2014/06/19 21:37:17
we can just assert that this always uses bot_updat
| |
| 68 yield api.gclient.checkout(), | |
| 69 | |
| 70 # First step: compilation of the instrumented build. | |
| 71 api.chromium.apply_config('chrome_pgo_instrument') | |
|
iannucci
2014/06/19 21:37:17
you should probably just set this on line 63
Sébastien Marchand
2014/07/03 19:13:17
Done.
| |
| 72 yield api.chromium.runhooks() | |
| 73 yield api.chromium.compile(targets=['chrome']) | |
|
iannucci
2014/06/19 21:37:17
targets won't be necessary since you set it in the
Sébastien Marchand
2014/07/03 19:13:17
Done.
| |
| 74 | |
| 75 # Remove the profile files from the previous builds. | |
| 76 yield api.path.rmcontents('previous profile files', | |
| 77 api.chromium.c.build_dir, | |
|
iannucci
2014/06/19 21:37:17
I'm wondering if it wouldn't be better to just hav
Sébastien Marchand
2014/07/03 19:13:17
Done.Looks like there's a rmwildcard function now
| |
| 78 '*.pgc') | |
| 79 | |
| 80 # Second step: profiling of the instrumented build. | |
| 81 for benchmark in _BENCHMARKS_TO_RUN: | |
| 82 yield RunTelemetryBenchmark(api, benchmark) | |
| 83 | |
| 84 # Third step: Compilation of the optimized build, this will use the profile | |
| 85 # data files produced by the previous step. | |
| 86 api.chromium.apply_config('chrome_pgo_optimize') | |
|
iannucci
2014/06/19 21:37:17
you'll want 'set_config' here, also will need to p
Sébastien Marchand
2014/07/03 19:13:17
Done.
| |
| 87 yield api.chromium.runhooks() | |
|
iannucci
2014/06/19 21:37:17
do we really need to run hooks again? that's sad :
Sébastien Marchand
2014/07/03 19:13:17
Yep, we have to regenerate the build (.ninja) file
| |
| 88 yield api.chromium.compile(targets=['chrome']) | |
|
iannucci
2014/06/19 21:37:17
same re: targets
Sébastien Marchand
2014/07/03 19:13:17
Done.
| |
| 89 | |
| 90 | |
| 91 def GenTests(api): | |
|
iannucci
2014/06/19 21:37:17
it would be good to train the tests and include th
| |
| 92 mastername = 'chromium.fyi' | |
| 93 buildername = 'Chromium Win PGO Builder' | |
| 94 | |
| 95 def _sanitize_nonalpha(text): | |
| 96 return ''.join(c if c.isalnum() else '_' for c in text) | |
| 97 | |
| 98 yield ( | |
| 99 api.test('full_%s_%s' % (_sanitize_nonalpha(mastername), | |
| 100 _sanitize_nonalpha(buildername))) + | |
| 101 api.properties.generic(mastername=mastername, buildername=buildername) + | |
| 102 api.platform('win', 32) | |
| 103 ) | |
| OLD | NEW |