sentry-cocoa
sentry-cocoa copied to clipboard
Track macOS apps running under Rosetta
Description
Could be nice to be able to segment sessions/transactions/profiles by apps compiled natively on Apple Silicon vs an x86 binary translated to M1 via Rosetta, and/or provide a special icon/treatment anytime we display that something ran on Silicon.
We can determine if an app is running under rosetta thusly: https://developer.apple.com/forums/thread/659846
int processIsTranslated() { // lightly edited from above source
int ret = 0;
size_t size = sizeof(ret);
if (sysctlbyname("sysctl.proc_translated", &ret, &size, NULL, 0) == -1)
{
if (errno == ENOENT)
{
return 0;
}
return -1;
}
return ret;
}