Add extra guard around perf enablement 

Authored cyanogen