gprof2dot icon indicating copy to clipboard operation
gprof2dot copied to clipboard

Produce graph from union of two roots?

Open ian-bertolacci opened this issue 7 years ago • 1 comments

I have portion of a call graph that is defined by the union of two functions' call graphs. For example:

foo():
    bar()
    baz()

asdf():
   fn1234()
   bar()
   fn9321()

Is there a way to get a call graph of only this region? Ideally, Id list a few functions I was interested in seeing, and a 'reach' and it would give the graph of all those functions, plus functions connected to them by at most 'reach' distance away in both the ancestors and descendants directions.

I dont think I can do this with the root/leaves since neither accept multiple arguments and specifying a function as both a root and leaf gives a graph of exactly that node.

I'm currently doing this by producing a limited call graph from these two functions as roots, then manually combining the two.

I'd be willing to write it myself and back contribute if you pointed me in the right direction.

ian-bertolacci avatar Oct 30 '18 21:10 ian-bertolacci

I'm not entirely sure I understand the request.

Do you mean combining multiple profiles? We could add a method to Profile class to combine. But I think many profilers already allow to accumulate.

If you mean more fine tuned pruning, I rather not go beyond the current capabilities. It adds too much complexity, and it's often source of bugs. I barely have any time to maintain this, so I don't want to aggravate it further.

jrfonseca avatar Nov 21 '18 11:11 jrfonseca