Instrument Recording Failure - CPU counter failed

Hi,

I’m encountering an issue while using xctrace & instruments to profile an application on macOS. Specifically, when trying to record a trace using the CPU Profiler template, I get the following errors:

Failed to start the recording: configureHardwareCounters: Failed set kpc configuration: Operation not permitted.
Unexpected failure: Couriers have returned unexpectedly.
  • macOS Version: 15.3.1
  • Chip: Apple M4 Pro
  • Xcode Version: Xcode 16.2

Hi there! This should be resolved in 15.4 Beta and it requires an OS update. Please verify and let us know if the issue is fixed.

Is there a way to profile my software without having to use a beta macOS version? Can I for example download the old and working version of Instruments.app somewhere until 15.4 has been released and I've had time to install it?

Unfortunately no, this specific problem was not an issue in Instruments but rather software that runs on the macOS, so it's independent from the tools version.

Maybe my problem was that I used "CPU Profiler" instead of "Time Profiler".

Anyways, 15.4 is out now and with that installed everything works fine :)

Instrument Recording Failure - CPU counter failed
 
 
Q