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.

Instrument Recording Failure - CPU counter failed
 
 
Q