Description
I've been needing to profile a ruby application that uses a variety of ruby extensions (written in C & rust) and also knowing how time is spent in the native extension a lot of the logic resides there.
I've taken inspiration from https://www.benfrederickson.com/profiling-native-python-extensions-with-py-spy/ and their source code to figure out how I could do it with rbspy. I have a prototype that works, and I have 2 questions:
When I get a StackTrace from ruby I also get a thread id, but it does not seem to match any thread id from remoteprocess::Process::threads
in RubySpy
. Is that expected? Is there a way to get a current thread ID that matches one from remoteprocess
?
Would there be any interest in merging this into main here? Right now my changes live in my fork. I've made it such this capability is only turned on if a feature flag is set to true.