dotnet-monitor
dotnet-monitor copied to clipboard
Enable collection of stacks from a running process
- Similar to dotnet-stacks
- Talk to @davmason about
DoStackSnapshot
, should return stacks for all threads - Could serve up as a new API
https://github.com/dotnet/samples/tree/main/core/profiling/stacksampling
That is a good starting point, but it is not super performant. It suspends the runtime and samples all threads on a regular basis, but runtime suspension can be costly. We don't have a super good story for doing it the performant way, you would have to pause threads one by one (SuspendThread on Windows, signal handler on Linux) and then work through all the potential deadlocks that happen if you suspend a thread that's holding the allocation lock or loader lock