Commit 31d22168 authored by George Burgess IV's avatar George Burgess IV Committed by Commit Bot

[AFDO] Refactor default profile code

This was previously split out to support defining different profiles
for Chrome and Chromium. Since we no longer need to do this, it's
simplest to have this all inline. (In particular, this refactor makes
using this profile on Linux like, 2 lines of diff.)

No functionality change is intended.

Bug: 805098
Test: `rgrep fprofile-sample-use out | wc -l` gives a high number
Change-Id: Ice635b71942f10ef1aed9e2fd9872ac06f598803
Reviewed-on: https://chromium-review.googlesource.com/1024637Reviewed-by: default avataragrieve <agrieve@chromium.org>
Commit-Queue: George Burgess <gbiv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554571}
parent 473aa8de
......@@ -52,14 +52,6 @@ if (is_android) {
}
}
# This is the result of profiling Chromium. Blindly applying it to arbitrary
# downstream projects and hoping it'll grant a speedup seems fragile. (Not
# to mention that it resides in a Chromium-specific directory.)
if (build_with_chromium) {
clang_default_afdo_profile =
rebase_path("//chrome/android/profiles/afdo.prof")
}
if (!defined(extra_chrome_shared_library_configs)) {
extra_chrome_shared_library_configs = []
}
......
......@@ -111,8 +111,12 @@ declare_args() {
# Some configurations have default sample profiles. If this is true and
# clang_sample_profile_path is empty, we'll fall back to the default.
#
# We currently only have default profiles for Chromium in-tree, so we disable
# this by default for all downstream projects, since these profiles are likely
# nonsensical for said projects.
clang_use_default_sample_profile =
is_official_build && defined(clang_default_afdo_profile)
build_with_chromium && is_official_build && is_android
# Turn this on to have the compiler output extra timing information.
compiler_timing = false
......@@ -1999,9 +2003,10 @@ if (is_clang && current_toolchain == default_toolchain) {
if (clang_sample_profile_path != "") {
_clang_sample_profile = clang_sample_profile_path
} else if (clang_use_default_sample_profile) {
assert(defined(clang_default_afdo_profile),
"This platform has no default sample profiles")
_clang_sample_profile = clang_default_afdo_profile
assert(build_with_chromium,
"Our default profiles currently only apply to Chromium")
assert(is_android, "The current platform has no default profile")
_clang_sample_profile = rebase_path("//chrome/android/profiles/afdo.prof")
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment