<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>mgoldin's blog</title><link>http://blogs.msdn.com/mgoldin/default.aspx</link><description>A blog about Profiler in Microsoft Visual Studio Team System 2005</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Team System MSDN Public Chat</title><link>http://blogs.msdn.com/mgoldin/archive/2005/10/18/482089.aspx</link><pubDate>Tue, 18 Oct 2005 04:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:482089</guid><dc:creator>mgoldin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/mgoldin/comments/482089.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mgoldin/commentrss.aspx?PostID=482089</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;Visual Studio Team System for Software Developer &amp;amp; Visual Studio Team System for Software Testers&lt;/SPAN&gt;&lt;/B&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;When:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt; &lt;/SPAN&gt;Wednesday&lt;SPAN style="FONT-SIZE: 9pt"&gt; &lt;/SPAN&gt;10/19/05 @ 10am PST&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;What:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt; &lt;/SPAN&gt;Join us to discuss the Profiler, Test Tools (Unit, Generic, Manual), Web &amp;amp; Load Testing, and Code Analysis (FxCop &amp;amp; PREFast).&amp;nbsp; We have questions for you, will answer questions from you, and will chat about the exciting new technology&lt;SPAN style="FONT-SIZE: 10pt"&gt;.&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Where:&lt;/STRONG&gt;&lt;FONT face="Times New Roman"&gt; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;A title=http://msdn.microsoft.com/chats href="http://msdn.microsoft.com/chats"&gt;&lt;FONT face="Times New Roman" size=3&gt;http://msdn.microsoft.com/chats&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;/SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=482089" width="1" height="1"&gt;</description></item><item><title>Total, Application, Kernel, Overhead, Other samples - what are they all about?!</title><link>http://blogs.msdn.com/mgoldin/archive/2005/08/05/total-application-kernel-overhead-other-samples-what-are-they-all-about.aspx</link><pubDate>Fri, 05 Aug 2005 21:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:448296</guid><dc:creator>mgoldin</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/mgoldin/comments/448296.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mgoldin/commentrss.aspx?PostID=448296</wfw:commentRss><description>&lt;p&gt;VS Profiler usage in Sampling mode results in generation of VSP file. This file is, naturally, full of samples that were taken during your profiling session. You can get a Properties Window of this file by pressing F4 button:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/TotalApplicationKernelOverheadOthersampl_E3B9/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/TotalApplicationKernelOverheadOthersampl_E3B9/image_thumb.png" width="382" height="538"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Today I would like to talk about all different Samples that are reported in General section of this window. Those samples were collected, some of them are used to generate profiler views, and sometimes you may want to understand better the whole picture - how many samples were taken during the session, are all of them in your application, why do you see less samples than you think you should see, etc. This may shed some light on confusing situations, if you try to compare results of VS Profiler with results provided by other tools (for example, when you use Page Fault Sampling, and you compare number of collected samples with a number of page faults reported by performance monitor).&lt;/p&gt; &lt;p&gt;So, all samples collected during the performance session are reported as Total. VS Profiler divides them into the following groups:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Application - samples taken in context of profiled application  &lt;li&gt;Kernel - samples taken in kernel mode (system wide)  &lt;li&gt;Other - samples taken in other applications, that are not profiled  &lt;li&gt;Overhead - samples taken in profiler runtime&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/TotalApplicationKernelOverheadOthersampl_E3B9/Total_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Total" border="0" alt="Total" src="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/TotalApplicationKernelOverheadOthersampl_E3B9/Total_thumb.jpg" width="355" height="234"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;From all the pieces, the Application slice is the one that is used for further analysis. Samples from other group are currently not counted in final results. &lt;/p&gt; &lt;p&gt;Some samples within the Application may be Aborted, if they happen to be taken at "bad" time (for example, during garbage collection). For the rest of samples, VS Profiler detects a call stack chain that resulted in execution of the current function.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/TotalApplicationKernelOverheadOthersampl_E3B9/Application_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Application" border="0" alt="Application" src="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/TotalApplicationKernelOverheadOthersampl_E3B9/Application_thumb.jpg" width="358" height="209"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Sometimes, profiler cannot detect a full call stack, and detects just most part of it. Those stacks are reported as Broken samples. Both, Broken and full stacks are used for generation of profiling results that are presented in Performance Tools views of Visual Studio Team System.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/TotalApplicationKernelOverheadOthersampl_E3B9/StackWalk_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="StackWalk" border="0" alt="StackWalk" src="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/TotalApplicationKernelOverheadOthersampl_E3B9/StackWalk_thumb.jpg" width="361" height="227"&gt;&lt;/a&gt;&amp;nbsp; &lt;/p&gt; &lt;p&gt;Trying to summarize all the above, we may present a samples distribution hierarchy in the following way, where only Full and Broken stacks are currenlty taken into account for final results.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Total  &lt;ul&gt; &lt;li&gt;Application  &lt;ul&gt; &lt;li&gt;Stack Walks  &lt;ul&gt; &lt;li&gt;Full stacks  &lt;li&gt;Broken stacks&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Aborted&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Kernel  &lt;li&gt;Other  &lt;li&gt;Overhead&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;And you may also get explanation of each line in Properties Window of VSP file by selecting it:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/TotalApplicationKernelOverheadOthersampl_E3B9/Properties1_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Properties1" border="0" alt="Properties1" src="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/TotalApplicationKernelOverheadOthersampl_E3B9/Properties1_thumb.jpg" width="385" height="542"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;If you want to collect more samples and have more stacks reported within you application, you may either run the application longer, or change sampling frequency (either through &lt;strong&gt;&lt;font face="Courier New"&gt;/PF&lt;/font&gt;, &lt;font face="Courier New"&gt;/SYS&lt;/font&gt;&lt;font face="Times New Roman"&gt;,&lt;/font&gt;&lt;/strong&gt;&lt;strong&gt; &lt;font face="Courier New"&gt;/TIMER&lt;/font&gt;&lt;/strong&gt; options of &lt;font face="Courier New"&gt;&lt;strong&gt;VSPerfCmd.exe&lt;/strong&gt;&lt;/font&gt; command line tool, or in Sampling property of Performance Session in VSTS).&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=448296" width="1" height="1"&gt;</description></item><item><title>Multiple profilers of managed code on the same machine. Why it is bad?</title><link>http://blogs.msdn.com/mgoldin/archive/2005/07/26/443504.aspx</link><pubDate>Tue, 26 Jul 2005 21:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:443504</guid><dc:creator>mgoldin</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/mgoldin/comments/443504.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mgoldin/commentrss.aspx?PostID=443504</wfw:commentRss><description>&lt;P&gt;It may happen that when you try to attach Visual Studio profiler to a managed application, you get the following error:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="BACKGROUND: yellow; mso-highlight: yellow"&gt;Error VSP1336 : Could not attach to process ID:1234 MyProcess.exe. Wrong setting of COR_PROFILER environment variable in target process.&amp;nbsp; Please use VSPerfClrEnv.cmd to set environment variables correctly.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;You follow the instructions precisely, use VSPerfClrEnv.cmd properly, and it doesn't help. What is wrong?&lt;/P&gt;
&lt;P&gt;The next question I would ask you is: "Did you install other profiler on your machine?" If yes, try to uninstall it, reboot the machine and use VSPerfClrEnv.cmd again.&lt;/P&gt;
&lt;P&gt;The issue here is that usage of .NET profiling services is bound to the COR_PROFILER environment variable, and each profiler sets it to its own value. Having more than one profiler in field may cause a conflict,&amp;nbsp;where profilers "fight" with each other for the right to set this environment variable. If process is created having this varialbe set by a different profiler, Visual Studio profiler detects this and generates the above error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=443504" width="1" height="1"&gt;</description></item><item><title>Why function callees sum up with more than 100% in Caller/Callee view?</title><link>http://blogs.msdn.com/mgoldin/archive/2005/06/28/why-function-callees-sum-up-with-more-than-100-in-caller-callee-view.aspx</link><pubDate>Tue, 28 Jun 2005 09:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:433236</guid><dc:creator>mgoldin</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/mgoldin/comments/433236.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mgoldin/commentrss.aspx?PostID=433236</wfw:commentRss><description>&lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;We are asked this question sometimes, especially when customers profile real world UI applications. Since it may be really confusing, I’ve decided to post the explanation of this “phenomena”. &lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;The Caller/Callee is one of views that are generated by Microsoft Visual Studio Team System 2005 during application profiling. The view is described in details in &lt;a href="https://blogs.msdn.com/ianhu/archive/2005/03/15/395853.aspx#427344"&gt;“Analyzing a performance report in Visual Studio Team System 2005 Part 2: The Function, Caller / Callee and Calltree views”&lt;/a&gt; posting or in &lt;a href="http://msdn.microsoft.com/msdnmag/issues/04/12/enterpriseperformance/default.aspx"&gt;“Make Your Apps Fly with the New Enterprise Performance Tool”&lt;/a&gt; MSDN article.&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;b&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;Why do we see callees that sum up with more than 100% of &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;Inclusive Percent samples? &lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;That I can tell you in one word – &lt;b&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;recursion&lt;/span&gt;&lt;/b&gt;.&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;Let’s try to analyze the following simple code.&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;void A(bool);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;void B();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;void C();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;void main()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;A(true);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;void A(bool CallB)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;if(CallB)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: da" lang="DA"&gt;B();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: da" lang="DA"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: da" lang="DA"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;C();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: da" lang="DA"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: da" lang="DA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: da" lang="DA"&gt;void B()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;A(false);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;void C()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;while(true)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 9pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;Actually, this code doesn’t have a pure recursion – no function calls itself. As you can see, the program will block itself having the following call stack:&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 10pt"&gt;main &lt;/span&gt;&lt;span style="font-family: wingdings; color: blue; font-size: 10pt"&gt;à&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 10pt"&gt; &lt;b&gt;A&lt;/b&gt; &lt;/span&gt;&lt;span style="font-family: wingdings; color: blue; font-size: 10pt"&gt;à&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 10pt"&gt; B &lt;/span&gt;&lt;span style="font-family: wingdings; color: blue; font-size: 10pt"&gt;à&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 10pt"&gt; &lt;b&gt;A&lt;/b&gt; &lt;/span&gt;&lt;span style="font-family: wingdings; color: blue; font-size: 10pt"&gt;à&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: blue; font-size: 10pt"&gt; C &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;So, function &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt; appears more than once on the stack. Let me refer to this as some sort of recursion. The interesting point here is that function &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt; calls different functions each time (first time it calls &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;B&lt;/span&gt;&lt;/b&gt;, and second time it calls &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;C&lt;/span&gt;&lt;/b&gt;)&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;Sample profiling of this application gives us the expected Call Tree view:&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/Whyfunctioncalleessumupwithmorethan100in_E54B/CallTree_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CallTree" border="0" alt="CallTree" src="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/Whyfunctioncalleessumupwithmorethan100in_E54B/CallTree_thumb.jpg" width="695" height="384"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;We also get the following Caller/Callee view (showing functions called by &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A &lt;/span&gt;&lt;/b&gt;and functions calling &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt;):&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/Whyfunctioncalleessumupwithmorethan100in_E54B/CallerCallee1_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CallerCallee1" border="0" alt="CallerCallee1" src="http://blogs.msdn.com/blogfiles/mgoldin/WindowsLiveWriter/Whyfunctioncalleessumupwithmorethan100in_E54B/CallerCallee1_thumb.jpg" width="700" height="387"&gt;&lt;/a&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;We see that &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;B&lt;/span&gt;&lt;/b&gt; and &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;main&lt;/span&gt;&lt;/b&gt; are callers of &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt;, while &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;B&lt;/span&gt;&lt;/b&gt; and &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;C&lt;/span&gt;&lt;/b&gt; are also callees (called by &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt;).  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;But why both &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;C&lt;/span&gt;&lt;/b&gt; and &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;B&lt;/span&gt;&lt;/b&gt; in the bottom panel have 100% Inclusive Percent of samples? First, they are "children" of &lt;span style="font-family: 'Courier New'"&gt;&lt;strong&gt;A&lt;/strong&gt;&lt;/span&gt;, so they cannot both have more than &lt;span style="font-family: 'Courier New'"&gt;&lt;strong&gt;A &lt;/strong&gt;&lt;/span&gt;has. Second, 100% + 100% = 200%.&amp;nbsp; It doesn’t make any sense!  &lt;p&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;Well, apparently it does. Let’s try to analyze the data we got.&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt; &lt;ol style="margin-top: 0in" type="1"&gt; &lt;li style="margin: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in" class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt; calls &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;B&lt;/span&gt;&lt;/b&gt;, and &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt; calls &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;C&lt;/span&gt;&lt;/b&gt;. Therefore, both &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;B&lt;/span&gt;&lt;/b&gt; and &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;C&lt;/span&gt;&lt;/b&gt; are in the bottom panel of Caller/Callee view as callees of function &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt;.&amp;nbsp; &lt;li style="margin: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in" class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt;, &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;B&lt;/span&gt;&lt;/b&gt; and &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;C&lt;/span&gt;&lt;/b&gt; – they are on stack. The only function that has &lt;a href="https://blogs.msdn.com/profiler/archive/2004/06/09/152023.aspx09/152023.aspx"&gt;&lt;span style="color: windowtext; text-decoration: none; text-underline: none"&gt;exclusive&lt;/span&gt;&lt;/a&gt; samples is &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;C&lt;/span&gt;&lt;/b&gt;, which is at the bottom of the stack (see &lt;a href="https://blogs.msdn.com/profiler/archive/2004/06/09/152023.aspx"&gt;“What are Exclusive and Inclusive?!”&lt;/a&gt; post explaining a difference between Inclusive and Exclusive samples)&lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;.&lt;/span&gt;&lt;/b&gt; Therefore, &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt;,&lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt; B&lt;/span&gt;&lt;/b&gt; and &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;C&lt;/span&gt;&lt;/b&gt; all have 100% of Inclusive Percent. &lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;  &lt;li style="margin: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in" class="MsoNormal"&gt;Functions &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;B&lt;/span&gt;&lt;/b&gt; and &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;C&lt;/span&gt;&lt;/b&gt; sum up in inclusive samples with more than function &lt;b&gt;&lt;span style="font-family: 'Courier New'"&gt;A&lt;/span&gt;&lt;/b&gt;, and they also sum up in Inclusive Percent with more than 100%. Yet it is still true.&lt;/li&gt;&lt;/ol&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;The above scenario is artificial. Real life scenarios, however, may have some variation of the recursion pattern that we discussed, thus generating profiling data that may confuse at the beginning. I hope this explanation makes it clearer. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=433236" width="1" height="1"&gt;</description></item><item><title>Let me introduce myself</title><link>http://blogs.msdn.com/mgoldin/archive/2005/06/27/433024.aspx</link><pubDate>Mon, 27 Jun 2005 19:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:433024</guid><dc:creator>mgoldin</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/mgoldin/comments/433024.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mgoldin/commentrss.aspx?PostID=433024</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Hello,&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;I am Maxim Goldin, and I am a developer in Microsoft Visual Studio Team System 2005. More specifically – I spend all my working hours developing a &lt;a href="https://blogs.msdn.com:443/profiler/"&gt;profiler&lt;/A&gt;, which is a part of VSTS. I joined Microsoft in June 2003 after serving Intel Corporation in &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:country-region w:st="on"&gt;Israel&lt;/st1:country-region&gt; for 8 years, and I am originally from &lt;st1:country-region w:st="on"&gt;&lt;st1:place w:st="on"&gt;Russia&lt;/st1:place&gt;&lt;/st1:country-region&gt;.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Profiling an application might be a non-trivial task; this is where I might and wish provide some help – either in running the tool, or understanding the results. I will be also grateful for any comments / suggestions about our tools – how to make them better and more user friendly, what are problems that you experienced with them, what functionality would you like to see there. Oh, and – just to mention it – I will not object to get positive comments as well &lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt; !&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;This is my first attempt to write a blog, and I find it quite exciting experience.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=433024" width="1" height="1"&gt;</description></item></channel></rss>