Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# Performance Profiler Instrumentation Not Working

I have a Visual Studio project that contains a C# windows application which references an F# class. When I run the Visual Studio 2010 performance profiler in instrumentation mode I get no instrumentation information for the F# class other than where it was called by the C# application.

When I run in sampling mode it works fine.

I’ve tried running the project in VS2012 and get the same issue.

How do I get Visual Studio to show the instrumentation info for the F# class?

like image 657
Keith Harrison Avatar asked Oct 06 '22 17:10

Keith Harrison


1 Answers

When you run in instrumentation mode, the profiler injects a bit of code at the entry/exit points of every method to record the performance data; however, it only injects this profiling code into the assembly you're actually profiling (e.g., your C# application) and not any of the referenced assemblies.

So, you need to profile the F# assembly directly. I'll assume it's a library, in which case you need to specify your C# application as the start program -- so the profiler will start the C# app but will actually instrument and profile the F# library. See the MSDN article How to: Specify the Binary to Start for the settings to do this.

like image 158
Jack P. Avatar answered Oct 10 '22 03:10

Jack P.