aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/gn_to_bp.py
diff options
context:
space:
mode:
authorGravatar Zhizhou Yang <zhizhouy@google.com>2017-12-11 10:37:44 -0800
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-11 19:20:08 +0000
commite18b77972b8e3eac2720429d2307cd40f1a23991 (patch)
tree0c0a6f5f8e7e070def104957fe6f88ae282af8a8 /gn/gn_to_bp.py
parent58a3fcd4b3a2f7210586f4ec74dde8ac2b231e0f (diff)
Turn on PGO for Skia on Android
This patch is to turn on PGO for skia on Android, which will provide a performance improvement of 7.6% for hwui when applied PGO for both. The patch specified a skia.profdata file, which locates in internal google_data/pgo_profile directory, to work as the profile to feed PGO. This profdata can be re-collected with PGO build system support. PGO can be turned off by setting ANDROID_PGO_NO_PROFILE_USE environment variable or set variable to false. Test: Build skia successfully and verified the performance improvement on device through benchmark. BUG=skia: Change-Id: I826f417569b2853630f6d4fcce236b5bc36547fa Reviewed-on: https://skia-review.googlesource.com/82880 Commit-Queue: Derek Sollenberger <djsollen@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com> Reviewed-by: John Reck <jreck@google.com>
Diffstat (limited to 'gn/gn_to_bp.py')
-rw-r--r--gn/gn_to_bp.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py
index 3a1238bf20..a09e46ca66 100644
--- a/gn/gn_to_bp.py
+++ b/gn/gn_to_bp.py
@@ -91,7 +91,24 @@ cc_library_static {
},
},
- defaults: ["skia_deps"],
+ defaults: ["skia_deps",
+ "skia_pgo",
+ ],
+}
+
+// Build libskia with PGO by default.
+// Location of PGO profile data is defined in build/soong/cc/pgo.go
+// and is separate from skia.
+// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
+// or set enable_profile_use property to false.
+cc_defaults {
+ name: "skia_pgo",
+ pgo: {
+ instrumentation: true,
+ profile_file: "skia/skia.profdata",
+ benchmarks: ["hwui", "skia"],
+ enable_profile_use: true,
+ },
}
cc_defaults {