views:

633

answers:

4

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.

+3  A: 
splattne
I think marxidad in interested by the *dynamic* calling graph, which implies that the execution must be profiled. SequenceViz, as Reflector, performs a static analysis.
Romain Verdier
I'm aware of SequenceViz but the hard part would be getting the actual calls that were made during run-time.
Mark Cidade
I understand, but I thought you could look at the code and take it as a base (for the visualization part) and "adding" the profiling stuff
splattne
+1  A: 

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.

Romain Verdier
+1  A: 
splattne
A: 

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.

fatcat1111
Does the CLR Profiler include function arguments that are passed and within a sequence of function calls?
Mark Cidade
It does capture the sequence of function calls, which it can present in a very useful visual fashion, but no it does not capture the function arguments.
fatcat1111