Draft: Add Perf JITDump support
Hi!
I would like to be able to profile JavaScriptCore with sysprof, but I am not sure what the right approach is.
I prototyped adding a new sysprof collector API, but there is a lot of data here, and it doesn't really need to be added until after collection is done.
This demo patch does work, although symbolication must happen on the same machine right after collecting the sysprof capture. It reads the Perf-formatted jit dump from JSC directly while symbolicating the capture. I saw that there is a way to save a symbolicated dump, so perhaps this approach would work alongside that. It certainly isn't ideal though, it would be nice to have sysprof directly capture this data.
I would prefer not to add a custom sampler to JSC (like GJS does). We could accept a new FD as an environment variable and write this jit dump data (in any format needed) there too.
Before going any further, I wanted to reach out to see what the best approach is.
Here is a screenshot (for example, the Baseline: frames are JS JIT frames)
