Check if "instrumentation" and "sampling" are set together
Setting these simultaneously is an error. Test: Check error generation in a test module Change-Id: I2ee127fa1b7157fa5f4489d2541ff023c64f9ba5
This commit is contained in:
@@ -124,13 +124,14 @@ func (props *PgoProperties) isPGO(ctx BaseModuleContext) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sampling not supported yet
|
// Sampling not supported yet
|
||||||
//
|
|
||||||
// TODO When sampling support is turned on, check that instrumentation and
|
|
||||||
// sampling are not simultaneously specified
|
|
||||||
if isSampling {
|
if isSampling {
|
||||||
ctx.PropertyErrorf("pgo.sampling", "\"sampling\" is not supported yet)")
|
ctx.PropertyErrorf("pgo.sampling", "\"sampling\" is not supported yet)")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if isSampling && isInstrumentation {
|
||||||
|
ctx.PropertyErrorf("pgo", "Exactly one of \"instrumentation\" and \"sampling\" properties must be set")
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user