Description
I'm trying to implement continuous profiler with Diagnostics IPC StartEventPipeSession()
. The idea is to start a profiler when the app launches and only do sample-profiling of select parts of the application. O
Originally, I've tried doing this by creating a new EventPipeSession
each time I needed to profile some time span but the startup is pretty heavy (about 100 ms to start when the Microsoft-DotNETCore-SampleProfiler
provider is included in the list). Therefore, I've switched to starting the session at the beginning and subscribing to the SampleProfilerTraceEventParser.ThreadSample
only for the time needed. This way, the overall overhead is reasonable (below 5 % from my testing) and the long session startup time doesn't affect actual operations, only the app startup (and can be made in the background).
Now to the issue at hand
As the samples are captured, I'm trying to assign modules and methods. These are, however, only provided by the rundown provider when the session is being stopped. In my use-case, this would mean when the application is shut down. The relevant code is:
runtime/src/native/eventpipe/ep.c
Lines 587 to 604 in 1d5c424
I wonder what the reason for this is and whether there is a way to trigger rundown right at the beginning of the session and then rely on runtime provider during the application lifetime to get updates.