Cleanup to match the profiling code in ctests.
Cleanup to match the profiling code in ctests.

pyrovski/papi,arm-hpc/papi,pyrovski/papi,arm-hpc/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,arm-hpc/papi