Additional guard around perf enablement

Change-Id: I37aaa73110b5d91aae7a35cb8fecf4eade088661