如何查看.NET程序的动态调用图的可视化? [英] How can I see a visualization of a dynamic call graph for a .NET program?

查看:95
本文介绍了如何查看.NET程序的动态调用图的可视化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那里有一种可视化动态调用图的工具吗?我看到了对Visual Basic 6的引用,但是我想对.NET进行引用。

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.

如果我必须自己构建可视化工具,我应该使用 .NET分析API 还是应该使用 Mono.Cecil 做些什么? ?我开始使用Cecil编写CLI运行时,但是我想如果只是将调用图记录调用注入到程序集中会更容易,尽管因为我不知道提前执行的路线,而且会

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.

推荐答案

剖析CLR是.NET剖析API的目的,因此它似乎非常适合您需要。探查器产品的大部分都基于它。

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.

也可以使用Cecil,如果您只想记录方法的输入/退出,则非常简单。

Using Cecil is possible too, and pretty straightforward if you just want to record enter/exit of methods.

编辑:

嗯, PostSharp 可能是最好的解决方案,因为它允许您依靠静态编织来满足这种要求。与直接使用Cecil重写IL相比,AOP提供了更好的抽象级别。

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.

这篇关于如何查看.NET程序的动态调用图的可视化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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