Xctrace issue in M1 processor

Hi I am getting the below error while doing memory profiling(launching instruments using xctrace command) in M1 processor.

Run issues were detected (trace is still ready to be viewed):

  • [Error] Failed to start the recording: ktrace cannot trace the system under Rosetta translation

  • [Error] Unexpected failure: Data source agent failed to arm.

  • [Error] Unexpected failure: Couriers have returned unexpectedly.

Recording failed with errors. Saving output file...

I am launching below command via jenkins: xcrun xctrace record --template 'Leaks' --launch <app_name> --output 'recording.trace'.

Hi there!

Is it possible that your shell is running x86? To verify that, please run arch command and verify the output. My suspicion is that xctrace gets run in Rosetta translation because you launched it from a shell that is running x86 as well. Running xctrace or Instruments under Rosetta translation is generally not supported.

Kacper

Hi , Thanks for the reply. Yes, your suspicion is correct as I am executing the command via shell it is with X86. So can you please suggest if is there any alternative for launching instrument command via shell(as we have to launch it through Jenkins) for M1 machines?

You can use the mentioned arch command to run a selected architecture of a universal binary. This should allow you to force to run it under AS, even if your shell is running x86 architecture.

Kacper

Xctrace issue in M1 processor
 
 
Q