Tuesday, March 21, 2017

Performance Profiler in Visual Studio Not Showing Function Names

In Visual Studio 2015 while doing performance profiling, I ran into the problem of memory addresses of functions being shown instead of their names.

During operations I got these errors:

VSP2340: Environment variables were not properly set during profiling run and managed symbols may not resolve.  Please use vsperfclrenv before profiling.

and

Error        DA0002: It appears that the file was collected without properly setting the environment variables with VSPerfCLREnv.cmd. Symbols for managed binaries may not resolve.        C:\Git\gm.marketing.marketplace\MarketPlace.Web\Report170320(2).vsp    0   

Both of these issues should not happen if you are using the profiler inside Visual Studio.

The root cause was not running Visual Studio in Admin mode from the start.
Here's an example scenario to get functions names in Visual Studio 2015.

Start Visual Studio in Admin mode:


 Select from the tool bar "Analyze" > "Performance Profiler..." and then "Start"



 Select the appropriate method.  I've been using "Instrumentation" lately.



 Select your projects and then "Next"



Check "Enable Tier Interaction Profiling"

Then, "Next", and finally, "Finish"

IE should launch, and run through your test scenario.
 Then select "Stop profiling".



The Summary report will appear:

Then, if you select the "Functions" report, your functions should appear with a friendly name.

No comments: