Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: scripts/slave/recipes/chromium_pgo.py

Issue 302763003: First version of the PGO recipe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Fix the kwargs passed to set_config Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipes/chromium_pgo.py
diff --git a/scripts/slave/recipes/chromium_pgo.py b/scripts/slave/recipes/chromium_pgo.py
new file mode 100644
index 0000000000000000000000000000000000000000..7e06b11dfac0bcfec407658fdb039cd369169980
--- /dev/null
+++ b/scripts/slave/recipes/chromium_pgo.py
@@ -0,0 +1,92 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+DEPS = [
+ 'bot_update',
+ 'chromium',
+ 'gclient',
+ 'path',
+ 'platform',
+ 'properties',
+ 'python',
+ 'step',
+]
+
+
+# List of the benchmark that we run during the profiling step.
+_BENCHMARKS_TO_RUN = {
+ 'peacekeeper.dom',
+ 'peacekeeper.array',
+ 'peacekeeper.html5',
+ 'peacekeeper.string',
+ 'peacekeeper.render',
+ 'dromaeo.domcoreattr',
+ 'dromaeo.domcoremodify',
+ 'dromaeo.domcorequery',
+ 'dromaeo.domcoretraverse',
+ 'dromaeo.jslibattrjquery',
+ 'dromaeo.jslibattrprototype',
+ 'dromaeo.jslibeventjquery',
+ 'dromaeo.jslibeventprototype',
+ 'dromaeo.jslibmodifyjquery',
+ 'dromaeo.jslibmodifyprototype',
+ 'dromaeo.jslibstylejquery',
+ 'dromaeo.jslibstyleprototype',
+ 'dromaeo.jslibtraversejquery',
+ 'dromaeo.jslibtraverseprototype',
+ 'sunspider',
+ 'jsgamebench',
+ 'kraken',
+}
+
+
+# Run a telemetry benchmark under the Windows PGO profiler.
+def RunTelemetryBenchmark(api, testname):
+ return api.python(
+ 'Telemetry benchmark: %s' % testname,
+ api.path['checkout'].join('tools', 'perf', 'run_benchmark'),
+ ['--profiler=win_pgo_profiler', '--use-live-sites', testname]
+ )
+
+
+def GenSteps(api):
+ api.step.auto_resolve_conflicts = True
+ api.chromium.set_config('chrome_pgo_instrument', BUILD_CONFIG='Release')
+ api.gclient.set_config('chromium_lkgr')
+
+ yield api.chromium.taskkill()
+ yield api.bot_update.ensure_checkout()
+
+ # First step: compilation of the instrumented build.
+ yield api.chromium.runhooks()
+ yield api.chromium.compile()
+
+ # Remove the profile files from the previous builds.
+ yield api.path.rmwildcard('*.pgc',
+ str(api.chromium.output_dir))
+
+ # Second step: profiling of the instrumented build.
+ for benchmark in _BENCHMARKS_TO_RUN:
+ yield RunTelemetryBenchmark(api, benchmark)
+
+ # Third step: Compilation of the optimized build, this will use the profile
+ # data files produced by the previous step.
+ api.chromium.set_config('chrome_pgo_optimize', BUILD_CONFIG='Release')
+ yield api.chromium.runhooks()
+ yield api.chromium.compile()
+
+
+def GenTests(api):
+ mastername = 'chromium.fyi'
+ buildername = 'Chromium Win PGO Builder'
+
+ def _sanitize_nonalpha(text):
+ return ''.join(c if c.isalnum() else '_' for c in text)
+
+ yield (
+ api.test('full_%s_%s' % (_sanitize_nonalpha(mastername),
+ _sanitize_nonalpha(buildername))) +
+ api.properties.generic(mastername=mastername, buildername=buildername) +
+ api.platform('win', 32)
+ )

Powered by Google App Engine
This is Rietveld 408576698