RFC: GetTime() timestamp for iOS ARM #1245
Copy link
Copy link
Open
Description
This is a follow-up to #1237 (merged here: #1239).
Right now, we are using mach_absolute_time() for iOS timestamps:
tracy/public/client/TracyProfiler.hpp
Lines 201 to 202 in 6f9504c
| # if defined TARGET_OS_IOS && TARGET_OS_IOS == 1 | |
| if( HardwareSupportsInvariantTSC() ) return mach_absolute_time(); |
We should be able to use ARM64's CNTKCTL_EL0 instruction on iOS.
According to Apple's XNU kernel, access to the CNTKCTL register(s) from user-space (EL0 ring) is granted:
https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/arm64/machine_routines.c#L2606-L2612
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
Hanflipped commentedon Dec 30, 2025
Hi! I noticed you previously contributed changes related to MetalTracy.hmm.
Recently I’ve been running into an issue where CPU and GPU timing cannot be aligned in Tracy when using the Metal GPU context,Have you ever encountered a similar CPU↔GPU time alignment problem with the Metal integration? If so, could you share any hints on what the correct synchronization/calibration approach is
The problem is 1247
Thanks a lot for your time!
slomp commentedon Dec 30, 2025
@Hanflipped Let's control the variables here.
Is the problem you are experiencing with Metal related to this current issue here (or rather, to this PR #1239 that was recently merged)?
Or did it start happening prior to that?
Can you pinpoint the Tracy version or commit hash of when you started experiencing the issue?
Hanflipped commentedon Dec 31, 2025
Hi, @slomp ,It’s not related to this current issue (or PR #1239). I was already seeing it before that.
The version I’m building is tag v0.13.0.