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

state of jitdump on macOS? #417

Open
tmm1 opened this issue Nov 17, 2024 · 3 comments
Open

state of jitdump on macOS? #417

tmm1 opened this issue Nov 17, 2024 · 3 comments

Comments

@tmm1
Copy link
Contributor

tmm1 commented Nov 17, 2024

hi, have been using (and loving) samply for a few weeks. it's really an incredible tool, thank you.

my goal is to profile nodejs and electron processes. the former already works quite well on linux, thanks to all the work done towards jitdump support.

i also see several mentions of jitdump macos support, in the changelog and in commits like 2732e49

my understanding is that jitdumps are ELF-based, but it appears that's still the standard format ingested on macos? thus, programs are expected to output jitdumps the same way on both linux and macos, along with the map files in /tmp.

in the case of nodejs, it appears the jitdump code is all gated away to be linux-specific atm: https://github.com/nodejs/node/blob/985262a4a8221d993df82e134623d8437d92b4c5/deps/v8/src/diagnostics/perf-jit.cc#L32-L33

am i correct that the first step here would be to enable this codepath inside nodejs on darwin? what else would be required.

EDIT: found https://bugzilla-dev.allizom.org/show_bug.cgi?id=1827214 so it looks like I am on the right track

@tmm1
Copy link
Contributor Author

tmm1 commented Nov 17, 2024

I was able to start emitting perf-pid.map and jit-pid.dump files.

The map files are working in samply 🎉

The jitdumps are being picked by the dyld preload, and I confirmed that samply is able to parse the file to see the load/unwind sections. However, symbolization doesn't work for some reason. Any pointers?

@tmm1
Copy link
Contributor Author

tmm1 commented Nov 20, 2024

the patch to v8 is quite trivial: tmm1/node@3542e4e

@tmm1
Copy link
Contributor Author

tmm1 commented Nov 20, 2024

samply also works on macOS with JavaScriptCore via logJITCodeForPerf. for example, using bun:

BUN_JSC_logJITCodeForPerf=1 samply record bun ...

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

No branches or pull requests

1 participant