Setup PGO for dex2oat and related libraries
Bug: http://b/63768402
Setup PGO for libart-compiler.so, dexlayout.so, and the dex2oat binary.
The setup for vixl is done in an accompanying CL. An instrumented copy
of dex2oat can be produced for the device using:
ANDROID_PGO_INSTRUMENT=dex2oat make
Profiles for the instrumented libraries can be produced by running them
on a representative workload.
Currently, profile use is disabled (via enable_profile_use: false).
This can be turned on once a profile is checked in.
Test: Build with ANDROID_PGO_INSTRUMENT=dex2oat and verify profiles get
generated.
Change-Id: Iea056ebd4a9fe8c805ffc2211394d6e1d726264c
diff --git a/compiler/Android.bp b/compiler/Android.bp
index 164f9c1..d4d72f3 100644
--- a/compiler/Android.bp
+++ b/compiler/Android.bp
@@ -249,6 +249,13 @@
shared_libs: [
"libart",
],
+
+ pgo: {
+ instrumentation: true,
+ profile_file: "dex2oat.profdata",
+ benchmarks: ["dex2oat"],
+ enable_profile_use: false,
+ }
}
art_cc_library {
diff --git a/dex2oat/Android.bp b/dex2oat/Android.bp
index 6bebf7d..dc71b9b 100644
--- a/dex2oat/Android.bp
+++ b/dex2oat/Android.bp
@@ -129,6 +129,18 @@
static_libs: [
"libart-dex2oat",
],
+
+ pgo: {
+ instrumentation: true,
+ profile_file: "dex2oat.profdata",
+ benchmarks: ["dex2oat"],
+ enable_profile_use: false,
+ cflags: [
+ // Ignore frame-size increase resulting from instrumentation.
+ "-Wno-frame-larger-than=",
+ "-DART_PGO_INSTRUMENTATION",
+ ],
+ }
}
art_cc_binary {
diff --git a/dexlayout/Android.bp b/dexlayout/Android.bp
index a02f75a..4f5d810 100644
--- a/dexlayout/Android.bp
+++ b/dexlayout/Android.bp
@@ -34,6 +34,13 @@
name: "libart-dexlayout",
defaults: ["libart-dexlayout-defaults"],
shared_libs: ["libart"],
+
+ pgo: {
+ instrumentation: true,
+ profile_file: "dex2oat.profdata",
+ benchmarks: ["dex2oat"],
+ enable_profile_use: false,
+ }
}
art_cc_library {