aboutsummaryrefslogtreecommitdiffstats
path: root/cc/pgo.go
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2018-01-29 09:18:45 -0800
committerPirama Arumuga Nainar <pirama@google.com>2018-01-29 10:02:27 -0800
commit28316d4e3b0b959b1aca7a255fe94cba00ca1758 (patch)
tree35d00851722d7df92b0b24bd4c01b886b5f9f519 /cc/pgo.go
parentad4692d5af06b879d82f244574e710a6f4ccf93f (diff)
downloadbuild_soong-28316d4e3b0b959b1aca7a255fe94cba00ca1758.tar.gz
build_soong-28316d4e3b0b959b1aca7a255fe94cba00ca1758.tar.bz2
build_soong-28316d4e3b0b959b1aca7a255fe94cba00ca1758.zip
Store missing profile files into a Make variable
Bug: http://b/72642679 Store missing profile files and the modules that refer to them in the SOONG_MODULES_MISSING_PGO_PROFILE_FILE variable passed to Make. The contents of this variable will be written to $DIST_DIR/pgo_profile_file_missing.txt as part of the 'dist' target. Test: 'm dist' and verify creation of pgo_profile_file_missing.txt. Change-Id: I237cd0398be418be2b7db6fa65ece5ef347ecbc1
Diffstat (limited to 'cc/pgo.go')
-rw-r--r--cc/pgo.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/cc/pgo.go b/cc/pgo.go
index 758c3d6d..3ce67be7 100644
--- a/cc/pgo.go
+++ b/cc/pgo.go
@@ -38,6 +38,10 @@ const profileSamplingFlag = "-gline-tables-only"
const profileUseInstrumentFormat = "-fprofile-use=%s"
const profileUseSamplingFormat = "-fprofile-sample-use=%s"
+func recordMissingProfileFile(ctx ModuleContext, missing string) {
+ getNamedMapForConfig(ctx.Config(), modulesMissingProfileFile).Store(missing, true)
+}
+
type PgoProperties struct {
Pgo struct {
Instrumentation *bool
@@ -96,6 +100,10 @@ func (props *PgoProperties) getPgoProfileFile(ctx ModuleContext) android.Optiona
}
}
+ // Record that this module's profile file is absent
+ missing := *props.Pgo.Profile_file + ":" + ctx.ModuleDir() + "/Android.bp:" + ctx.ModuleName()
+ recordMissingProfileFile(ctx, missing)
+
return android.OptionalPathForPath(nil)
}