Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce application tracing profiler #267

Merged
merged 4 commits into from
Nov 29, 2023
Merged

Introduce application tracing profiler #267

merged 4 commits into from
Nov 29, 2023

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Nov 29, 2023

The current Metal.@profile is more of a GPU kernel debugger/optimizer, capturing frame captures and requiring Xcode to view the generated traces. For high-level tracing, Instruments is a better application, so this PR renames the current functionality to Metal.@capture, and introduces a new Metal.@profile that runs under xctrace (relying on some bleeding-edge ObjectiveC.jl CoreFoundation wrappers to properly detect when the tracing has started).

@maleadt
Copy link
Member Author

maleadt commented Nov 29, 2023

@staticfloat: running under xctrace doesn't seem to work on CI:

(kernel) Failed to query kext info (MAC policy error 0x1).
Failed to read loaded kext info from kernel - (libkern/kext) internal error.
Instrument with name 'GPU' cannot be found

Does this ring a bell? Does the sandbox prevent kext access? I guess it's best to leave that disabled, but I was wondering.

@maleadt maleadt merged commit c9ee025 into main Nov 29, 2023
1 check passed
@maleadt maleadt deleted the tb/profiling branch November 29, 2023 15:32
@staticfloat
Copy link

Does the sandbox prevent kext access?

It runs inside of a Seatbelt configuration, which limits many things that it can do. We can likely figure out which kernel features are being denied and add those in, as long as they don't pose a security risk; read-only access to what kexts are loaded should be fine, but loading arbitrary kext's.... probably not a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants