Closed jberryman closed 2 years ago
Very interesting question, I'm learning some new stuff! The best way to find out is to try 😃 but I don't have a haskell setup at the moment. Based on what I can find/understand, if GHC isn't using call
instructions then uretprobe
s aren't gonna work, which means wachy isn't gonna work. However, you could still use raw uprobes (e.g. with bpftrace) to understand how frequently a function is called and print its arguments.
You could potentially figure out a way to automatically instrument the jmp
s to "simulate" uretprobes, but I don't know how reliable that would be (and does tracing latency that way even make sense with haskell's lazy evaluation?). Alas, I don't use haskell so don't see this making its way into wachy any time soon. But if anyone is interested in implementing/exploring it please reach out!
I wondered the same about dynamic languages that expose USDT probes like php: https://www.php.net/manual/en/features.dtrace.dtrace.php#features.dtrace.static-probes Tools like bcc use it to do stuff: https://github.com/iovisor/bcc/blob/master/tools/lib/ucalls.py#L79
Do you think it could be applicable in wachy's context?
That's cool. I think you could get something like wachy to work, the issues I see are
That said, I could still see it being useful in some scenarios. However, like with haskell, I am not doing much perf work with those languages and it would be a nontrivial set of changes to get it working in wachy. So if anyone is interested in implementing it I'm more than happy to help them out, but don't see it happening any time soon!
This looks really cool! Sorry for the dumb question but I was wondering if this would work with compiled languages that don't make use of the native stack pointer register? In particular I'm looking at GHC haskell which afaiu compiles most everything into tail calls
jmp
s, and doesn't actually use the native stack pointer register for haskell code. It does support dwarf debug symbols however.Thanks for open-sourcing this!