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:
Pirama Arumuga Nainar
2017-10-05 10:25:00 -07:00
parent 49b53d5c7c
commit 6fc8d9126c

View File

@@ -124,13 +124,14 @@ func (props *PgoProperties) isPGO(ctx BaseModuleContext) bool {
}
// Sampling not supported yet
//
// TODO When sampling support is turned on, check that instrumentation and
// sampling are not simultaneously specified
if isSampling {
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
}