Allow the profiler to be configured or disabled

Because bugs were found in it.

Change-Id: I2737bad8663af3c8afec8a0ea4cca5d0f5b13714