perf/core: Fix !CONFIG_PERF_EVENTS build warnings and failures