[pgo] Allow profile gather and use flags to coexist for sampling PGO
Bug: 79161490 Test: presubmit Change-Id: I90df9c04dbe2a423c06e9a966fe9bcaed0a84a65
This commit is contained in:
10
cc/pgo.go
10
cc/pgo.go
@@ -290,15 +290,17 @@ func (pgo *pgo) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
|
|
||||||
// Add flags to profile this module based on its profile_kind
|
// Add flags to profile this module based on its profile_kind
|
||||||
if props.ShouldProfileModule && props.isInstrumentation() {
|
if props.ShouldProfileModule && props.isInstrumentation() {
|
||||||
return props.addInstrumentationProfileGatherFlags(ctx, flags)
|
props.addInstrumentationProfileGatherFlags(ctx, flags)
|
||||||
|
// Instrumentation PGO use and gather flags cannot coexist.
|
||||||
|
return flags
|
||||||
} else if props.ShouldProfileModule && props.isSampling() {
|
} else if props.ShouldProfileModule && props.isSampling() {
|
||||||
return props.addSamplingProfileGatherFlags(ctx, flags)
|
props.addSamplingProfileGatherFlags(ctx, flags)
|
||||||
} else if ctx.DeviceConfig().SamplingPGO() {
|
} else if ctx.DeviceConfig().SamplingPGO() {
|
||||||
return props.addSamplingProfileGatherFlags(ctx, flags)
|
props.addSamplingProfileGatherFlags(ctx, flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ctx.Config().IsEnvTrue("ANDROID_PGO_NO_PROFILE_USE") {
|
if !ctx.Config().IsEnvTrue("ANDROID_PGO_NO_PROFILE_USE") {
|
||||||
return props.addProfileUseFlags(ctx, flags)
|
props.addProfileUseFlags(ctx, flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
return flags
|
return flags
|
||||||
|
Reference in New Issue
Block a user