The last week or so I've been playing with the CLR Profiling API, as a pet project for the summer.
I started thinking about how ANTS and DotTrace implement line-level profiling. I can't see anything related to this in the Profiling API, so I assume they've got something proprietary.
I'm looking for pointers or thoughts on how this is implemented by them.
Do they inject MSIL code when the code is being JIT'ed?
CLR Profiling API support out of the box only tracing on Enter & Leave level. This can be done using ICorProfilerInfo::SetEnterLeaveFunctionHooks
In order to trace at finer level weaving of IL is required. You can use these open source profilers code as references:
Both weave code during JITCompilationStarted callback.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With