-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create a real call graph that can have cycles in --graphviz #1500
Comments
I want to try this one! |
@honggyukim |
I'll try this. |
Thanks. Please keep in mind that this can be applied to mermaid result as well so we need to have a common routine that combines the related edges. |
Thanks for the advice. I'll also consider the impact on mermaid functionality. |
Hi, I have been looking into this issue for the past few days and I think I know the root of the problem, but I don't really know how to fix this. As mentioned intially, there are multiple out:
node->nr_calls++;
tg->node = node; and by out:
node->time += fstack->total_time;
node->child_time += fstack->child_time;
if (exit_cb)
exit_cb(tg, cb_arg);
tg->node = node->parent; If I am not wrong,
@gichoel told me that the latter would create significant overhead if the initial graph is extremely large in size. Maybe the former idea could work, but I wanted some feedback if there are any better ideas. |
I think the first approach would work if you can count the number of recursive calls correctly. |
uftrace graph
actually doesn't show a call graph, but just a call tree output. For example,t-fibonacci
example's output is as follows.As the output shows there are multiple nodes for
fib
function. It's because there are multiple backtrace or call paths of eachfib
node.The
--graphviz
output also uses the same logic when building a graph, precisely a tree. So its output doesn't show the multiple nodes for the same function, but it draws multiple edges for the same calls.The
--graphviz
output oft-fibonacci
is as follows.Its image shows too many edges from
fib
tofib
as follows.But it would be much better to make it as follows.
This modified dot produces much clear image as follows.
The text was updated successfully, but these errors were encountered: