Does anyone know about a profiler library in C# that I could embed in my source code that would do sample-based profiling? I.e. periodically get the instruction pointer location, store it in memory and allow to save it to a file and analyze later, presumably by some desktop application?
I know there are lots of traditional profiler applications (like JetBrains, Ants etc.), but I want to profile a C# program running on a non-desktop platform, where none of these profilers can be used. I want my application to sample itself, not an external profiler.