Skip to content
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

dump: Handle cycles in graphviz #1977

Closed
wants to merge 3 commits into from

Conversation

deepseafishy
Copy link

These commits include skipping the recursive calls during the dump of graphviz, and correctly adding number of calls of the skipped entries to the initial recursive call.

Fixed: #1500

Identify if the current graph entry must be skipped druing `dump`, which
is done during the add_graph_entry() procedure.

Basic idea is to find recursive calls, but the first recursive call
cannot be skipped. For example, if the call trace shows:

main - fib - fib - fib

then the first (fib - fib) must be present but the second must be
skipped, making the graph look like:

main - fib - fib

To separate recursive calls from the first recursive call, determine
if the node's name is the same with curr and additionally check if
curr->parent's name is the same as well.

Signed-off-by: Daon Park <[email protected]>
If a node is skipped due to being a recursive call, then it's nr_calls
must be correctly appended to the first recursive call. During the
`add_graph_entry()` procedure, it looks for the source of the first
recursive call and saves it to recursive_src. Next, if the current
graph entry node is skipped, then the nr_calls is added to the
add_calls_tgt.

Signed-off-by: Daon Park <[email protected]>
If a node is marked as True in the skip variable, the dump file will
not record that node.

Signed-off-by: Daon Park <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create a real call graph that can have cycles in --graphviz
1 participant