Profiling FAQ #5: Why are there two copies of my function in Instrumentation mode function report?

The most common reason for this to occur in Instrumentation mode is that the dll you instrumented is appearing in two different processes. We don't aggregate data from multiple processes. You can see this easily by using vsperfreport.exe -summary:function foo.vsp. If you get foo_1234_FunctionSummary.CSV and foo_5678_FunctionSummary.CSV, that just means your instrumented dlls were loaded in 2 processes with IDs of 1234 and 5678. In the IDE, you can add the Process ID column to verify that the two copies of the function have different IDs.

This can happen easily in ASP.Net if you crash the w3wp.exe process while the monitor is still running. A second w3wp.exe process will start up with a new process ID. It also happens if you have multiple worker processes on a machine running the same app.