asp.net - 我可以使用 xperf 来分析托管代码吗?

标签 asp.net profiling clr xperf

我正在尝试使用 xperf 分析 ASP.NET 应用程序(本地运行)中的 CPU 时间。

到目前为止,我遵循了标准程序:

  1. 以管理员身份运行 cmd
  2. xperf -on 基础
  3. 在网络应用中执行一些操作。
  4. xperf -d mylog.etl
  5. xperfview mylog.etl
  6. 跟踪 -> 加载符号
  7. 汇总表

此时,我可以看到非托管代码的调用报告。

我需要做什么才能在我的 .NET 程序集中看到相同的结果?这可能吗?

我的 PDB 路径位于 _NT_SYMBOL_PATH 中,至少我知道 MS 符号已加载。

我见过this question ,但没有分辨率。根据this answer ,

You need the xperf Version from the Windows 8 SDK. This version supports .net. Start a trace with the new Performance Recorder UI and this tool generates PDBs for ngened .net components so that xperfview and WPA can decode the callstack.

谁能证实这一点?我正在使用 Windows 7 和 Windows 7 SDK。我对安装另一个平台 SDK 持怀疑态度。

更新:是的,Windows 8 SDK 在 Windows 7 上运行,为此,您唯一需要的是性能工具包。事实上,您甚至不必使用新的“Windows 性能分析器”,因为新的“Windows 性能记录器”生成的 etl 文件仍然可以与 xperfview 一起使用>,包括增强的堆栈跟踪。请参阅对已接受答案的评论以获取更多说明。

最佳答案

是的,您需要 Windows 8 版本。尝试一下,您会发现效果很好。如果您想使用 xperf 而不是 WPR(UI),请按照以下步骤操作:

http://msdn.microsoft.com/en-us/library/ff357718%28v=vs.100%29.aspx

关于asp.net - 我可以使用 xperf 来分析托管代码吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18746810/

相关文章:

clr - .Net 4.0 会包含新的 CLR 还是保留 2.0 版

javascript - 使用 javascript 和 asp.net 在模态弹出窗口中不显示图像

c# - html 服务器控件能否提供比 asp.net 中的 asp 控件更好的性能?

c# - RenderPartial 和 RenderPage 有区别吗?

python - 将 pandas DataFrame 行与键/值对的字典进行匹配

haskell - GHC/Haskell 分析 : function consumes time without being called

asp.net - 应用程序、 session 、缓存

javascript - 有什么方法可以使这种洪水在 HTML5 Canvas 中更快地填充?

c++ - 自定义文本框 : Highlighting and Selection

c# - 类型库 'System_Windows_Forms' 是从 CLR 程序集导出的,不能作为 CLR 程序集重新导入