如何查看 .NET 程序动态调用图的可视化?
有没有一种工具可以可视化动态调用图?我看到了一个针对 Visual Basic 6 的工具,但我想要一个针对 .NET 的工具。
如果我必须自己构建一个可视化工具,我应该使用 .NET 分析 API 还是应该使用 Mono.Cecil 做点什么? 我开始了使用 Cecil 编写 CLI 运行时,但我想如果我只是在程序集中注入调用图记录调用会更容易,尽管因为我事先不知道执行路径并且必须检测所有内容。
Is there a tool out there for visualizing dynamic call graphs? I saw a reference to one for Visual Basic 6 but I'd like one for .NET.
If I had to build a visualizer myself should I bother with the .NET profiling API or should I do something with Mono.Cecil? I started writing a CLI runtime with Cecil, but I guess it'd be easier if I just injected call-graph recording calls in the assemblies, although since I don't know the execution route ahead of time and would have to instrument everything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
也许 CodePlex 上的这个开源项目可以作为起点:
SequenceViz
http://www .codeplex.com/sequenceviz
后续版本中的功能多一点。”
“SequenceViz 是一个通过逆向工程 .NET 程序集生成序列图的工具。尽管它比 独立版本和作为反射器插件的实现。
替代文本 http://i3.codeplex.com/项目/下载/FileDownload.aspx?ProjectName=sequenceviz&DownloadId=44432
Maybe this open source project on CodePlex could help as starting point:
SequenceViz
http://www.codeplex.com/sequenceviz
"SequenceViz is a tool to generate sequence diagrams by reverse engineering .NET Assemblies. Although it does a little more than that in the later versions."
There is a standalone version and an implementation as reflector-plugin.
alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=sequenceviz&DownloadId=44432
分析 CLR 是 .NET 分析 API 的目的,因此它似乎非常适合您的需求。 大部分Profiler产品都是基于它之上的。 但你必须编写非托管代码,urk。
使用 Cecil 也是可能的,如果您只想记录方法的进入/退出,并且非常简单。
编辑:
嗯, PostSharp 可能是最好的解决方案,因为它允许您通过依赖来处理这样的要求静态编织。 AOP 提供了比直接使用 Cecil 重写 IL 更好的抽象级别。
Profiling CLR is the purpose of the .NET Profiling API, so it seems to be perfect for your need. Most part of profiler products are based on top of it. But you'll have to write unmanaged code, urk.
Using Cecil is possible too, and pretty straightforward if you just want to record enter/exit of methods.
EDIT:
Well, PostSharp is probably the best solution, as it allows you to handle such a requirement by relying on static weaving. AOP provides a better level of abstraction than directly rewrite IL with Cecil.
您可以使用 NProf,Sourceforge 上的一个开源项目。 它允许您使用新的可视化工具扩展默认 GUI。
“nprof 不仅被设计为 .NET 应用程序的成熟分析器,而且还是一个完整的 API,可用于构建其他分析器前端,并使用新的可视化工具扩展默认 GUI。 “
You coud use NProf, an open source project on Sourceforge. It allows you to extend the default GUI with new visualization tools.
"nprof is designed to be not only a fully-fledged profiler for .NET applications, but also a complete API that can be used to build other profiler front-ends, as well as extend the default GUI with new visualization tools."
我喜欢 CLR Profiler。 我不会通过复制来浪费空间这里的文档,但听起来这正是您正在寻找的内容。
CLR Profiler 现已在 Microsoft 的 Archive GitHub 上提供
I love the CLR Profiler. I won't waste space by reproducing the documentation here, but it sounds like it is exactly what you are looking for.
The CLR Profiler is now available on Microsoft's Archive GitHub