Different test results by using of Performance Tools

I crated a very simple project (WinForms). The project has only one form and one button. When you press the button two simple functions are invoked: f1 and f2.


Then I created a performance instrumentation session, which lunches the executable through the project. The result seems to be ok.
For example the tab functions show following list:

-WindowsApplication1.Form1..ctor()

-WindowsApplication1.Dispose (bool)

-WindowsApplication1.f1 ()

-WindowsApplication1.f2()

-WindowsApplication1.Form1.InitializeComponent()

-WindowsApplication1.Program.Main()

After this I created a new solution without of any project with a performance session which lunches the previously compiled executable directly (not through project in the same solution).

In this case the tab functions shows following list of functions:

-WindowsApplication1.Form1..ctor()

-WindowsApplication1.Dispose (bool)

-WindowsApplication1.Form1.InitializeComponent()

-WindowsApplication1.Program.Main()


This means that functions f1() and f2() have never been called.

Remarks: The same results are shown by using of instrumentation.

Question 1:Can anybody provide an explanation of this? Is this a bug or feature?

[5556 byte] By [DamirDobric] at [2008-2-16]
# 1
I'm not sure I understand what's different between your two scenarios. If you used sampling mode on the second scenario, however, this post might be helpful:

Profiling FAQ #1: Why doesn't my Sampling Call Tree look like my Instrumentation Call Tree

AngryRichardMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Performance Tools (Profiler)...
# 2
I think I understand the difference, please confirm if the following is what you are doing:
1. WinForms project and the performance session are in teh same solution and you use Add Target Project option to collect performance data.

2. WinForms project is built separately and then you use Add Target Binary and point it to the project binary.

If that is correct, can you tell me where your functions f1 and f2 are? Are they in the same WinForms binary or in a separate class library or something?

-Munjal

MunjalD at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Performance Tools (Profiler)...

Visual Studio Team System

Site Classified