Merge "Support instrumenting all PGO-enabled modules"

am: ad4692d5af

Change-Id: I4fad8cae6b95bfcbed8e5598b6c331d60bd7fb0c
This commit is contained in:
Pirama Arumuga Nainar 2018-01-26 03:02:45 +00:00 committed by android-build-merger
commit 4bae924254

View file

@ -197,7 +197,7 @@ func (pgo *pgo) begin(ctx BaseModuleContext) {
}
// This module should be instrumented if ANDROID_PGO_INSTRUMENT is set
// and includes a benchmark listed for this module
// and includes 'all', 'ALL' or a benchmark listed for this module.
//
// TODO Validate that each benchmark instruments at least one module
pgo.Properties.ShouldProfileModule = false
@ -207,10 +207,14 @@ func (pgo *pgo) begin(ctx BaseModuleContext) {
pgoBenchmarksMap[b] = true
}
for _, b := range pgo.Properties.Pgo.Benchmarks {
if pgoBenchmarksMap[b] == true {
pgo.Properties.ShouldProfileModule = true
break
if pgoBenchmarksMap["all"] == true || pgoBenchmarksMap["ALL"] == true {
pgo.Properties.ShouldProfileModule = true
} else {
for _, b := range pgo.Properties.Pgo.Benchmarks {
if pgoBenchmarksMap[b] == true {
pgo.Properties.ShouldProfileModule = true
break
}
}
}
}