Add an extra guard around perf enablement 

Authored cyanogen