rstack icon indicating copy to clipboard operation
rstack copied to clipboard

Added a simple unit test for testing process stack trace capture

Open Fluxie opened this issue 1 year ago • 0 comments

I'm adding support to proxide proxy for capturing the stack traces of the client process that makes requests through the proxy when the client process and the proxide proxy reside on the same host. I have already implemented a preliminary support here: https://github.com/Rantanen/proxide/pull/36.

However, the current approach is a bit inefficient as it always captures the stack traces of all the threads of the client process even though only the stack trace of the thread associated with the request being proxy-ed is enough. Thus I want to add support for capturing stack traces of individual threads at a time to rstack.

To do this, I wanted to start this by adding support for unit testing as I like to execute code during development time with unit tests. => This merge request.

My current plan for adding the support for capturing individual threads is to create a struct call ProcessAttachment which would have a method for capturing stack traces of individual threads. The ProcessAttachment struct would be created by calling a new method called "attach" which would be added to the TraceOptions struct.

Does this plan/idea sound reasonable to you?

Fluxie avatar Jan 24 '24 10:01 Fluxie