功能分析的困境 - 的Visual Studio 2010旗舰版 [英] Function profiling woes - Visual Studio 2010 Ultimate

查看:458
本文介绍了功能分析的困境 - 的Visual Studio 2010旗舰版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图分析我的应用程序之前和之后重构监控功能的影响。我已经完成我的应用程序进行分析,并已经看了总结我已经注意到的 名单热路径没有提及任何用我的功能,仅提及功能最多Application.Run()

I am trying to profile my application to monitor the effects of a function, both before and after refactoring. I have performed an analysis of my application and having looked at the Summary I've noticed that the Hot Path list does not mention any of my functions used, it only mentions functions up to Application.Run()

我是相当新的分析和想知道作为通过的 MSDN文档;

I'm fairly new to profiling and would like to know how I could get more information about the Hot Path as demonstrated via the MSDN documentation;

MSDN示例:

我的结果:

我注意到在输出窗口中加载符号时有很多关于失败的消息,他们几个都低于;

I've noticed in the Output Window there are a lot of messages relating to a failure when loading symbols, a few of them are below;

Failed to load symbols for C:\Windows\system32\USP10.dll.  
Failed to load symbols for C:\Windows\system32\CRYPTSP.dll.
Failed to load symbols for (Omitted)\WindowsFormsApplication1\bin\Debug\System.Data.SQLite.dll.
Failed to load symbols for C:\Windows\system32\GDI32.dll.  
Failed to load symbols for C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll.
Failed to load symbols for C:\Windows\system32\msvcrt.dll. 
Failed to load symbols for C:\Windows\Microsoft.NET\Framework\v4.0.30319\nlssorting.dll.
Failed to load symbols for C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll.  Failed to load symbols for
C:\Windows\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll.
Unable to open file to serialize symbols: Error VSP1737: File could not be opened due to sharing violation: - D:\(Omitted)\WindowsFormsApplication1110402.vsp

(使用code工具,所以它的可读性格式化)

(Formatted using code tool so it's readable)

感谢您的任何指针。

推荐答案

在摘要视图中显示的热路径是基于包容性的样本(从功能的样本,也从功能的样本数最昂贵的呼叫路径由函数)和专属样品(仅来自功能样本)调用。 A样品只是事实的功能是在堆栈的顶部时探查的驱动捕获的叠层(这发生在非常小的时间间隔)。因此,更多的样本函数具有,它越被执行

The "Hot Path" shown on the summary view is the most expensive call path based on the number of inclusive samples (samples from the function and also samples from functions called by the function) and exclusive samples (samples only from the function). A "sample" is just the fact the function was at the top of the stack when the profiler's driver captured the stack (this occurs at very small timed intervals). Thus, the more samples a function has, the more it was executing.

在默认情况下进行采样分析,一个功能叫做只是我的code 已启用堆栈非用户模块来(它会显示1非深度上隐藏功能-user功能如果调用由用户的功能;在你的情况 Application.Run )。从模块来加载未经符号或从已知微软模块的功能将被排除在外。在总结查看您的热路径表示最昂贵的堆栈没有从什么探查认为是你的code任何东西(除了) 。从MSDN的例子显示了更多的功能,因为 PeopleTrax。* PeopleNS。* 功能从用户$ C到来$ C。 只要我的code可以通过单击显示所有code的摘要视图链接被关闭,但我不建议这样做在这里。

By default for sampling analysis, a feature called "Just My Code" is enabled that hides functions on the stack coming from non-user modules (it will show a depth of 1 non-user functions if called by a user function; in your case Application.Run). Functions coming from modules without symbols loaded or from modules known to be from Microsoft would be excluded. Your "Hot Path" on the summary view indicates that the most expensive stack didn't have anything from what the profiler considers to be your code (other than Main). The example from MSDN shows more functions because the PeopleTrax.* and PeopleNS.* functions are coming from "user code". "Just My Code" can be turned off by clicking the "Show All Code" link on the summary view, but I would not recommend doing so here.

看一看了功能做得最个人工作的摘要视图。这将显示有最高的专属样本数,因此基于该分析方案的功能,最昂贵的功能调用。您应该看到您更多的功能(或功能由你的函数调用)在这里。此外,功能拨打树的观点可能会告诉你更多的细节(有在报告顶部的下拉列表中选择当前视图)。

Take a look at the "Functions Doing The Most Individual Work" on the summary view. This displays functions that have the highest exclusive sample counts and are therefore, based on the profiling scenario, the most expensive functions to call. You should see more of your functions (or functions called by your functions) here. Additionally, the "Functions" and "Call Tree" view might show you more details (there's a drop-down at the top of the report to select the current view).

至于你的符号警告,其中大部分是意料之中的,因为他们是微软的模块(不包括System.Data.SQLite.dll)。虽然你不需要为这些模块的符号来正确地分析您的报告,如果在工具 - >选项 - >调试 - >符号选中Microsoft符号服务器并重新打开报告,这些模块的符号应加载。请注意,它会需要更长的时间来打开报表第一次,因为符号需要下载并缓存。

As for your symbol warnings, most of those are expected because they are Microsoft modules (not including System.Data.SQLite.dll). While you don't need the symbols for these modules to properly analyze your report, if you checked "Microsoft Symbol Servers" in "Tools -> Options -> Debugging -> Symbols" and reopened the report, the symbols for these modules should load. Note that it'll take much longer to open the report the first time because the symbols need to be downloaded and cached.

其他警告有关失败序列化码元到报告文件是不能够被写入,因为它是由别的,prevents写入打开的文件的结果。符号序列化是一种优化,使探查器直接从下一分析报告文件加载符号信息。如果没有符号序列,分析只需要执行的工作相同数量的报表时首次打开时间。

The other warning about the failure to serialize symbols into the report file is the result of the file not being able to be written to because it is open by something else that prevents writing. Symbol serialization is an optimization that allows the profiler to load symbol information directly from the report file on the next analysis. Without symbol serialization, analysis simply needs to perform the same amount of work as when the report was opened for the first time.

最后,你可能还需要在分析会话设置,以尽量仪器而不是抽样。仪表修改您指定要捕捉每一个函数调用(注意,这可能会导致一个非常非常大的.VSP文件)数据模块。仪器仪表是理想的聚焦于code的专用件的时间,而采样非常适合一般的低开销分析数据集合。

And finally, you may also want to try instrumentation instead of sampling in your profiling session settings. Instrumentation modifies modules that you specify to capture data on each and every function call (be aware that this can result in a much, much larger .vsp file). Instrumentation is ideal for focusing in on the timing of specific pieces of code, whereas sampling is ideal for general low-overhead profiling data collection.

这篇关于功能分析的困境 - 的Visual Studio 2010旗舰版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆