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

coroc: make callgraph construction algorithm configurable #136

Merged
merged 3 commits into from
Dec 16, 2023

Conversation

chriso
Copy link
Contributor

@chriso chriso commented Dec 16, 2023

The x/tools/go/callgraph package has four algorithms for constructing callgraphs. We're currently hard-coded to use VTA.

This PR makes the algorithm configurable when using coroc, via a new -callgraph {static|cha|vta|rta} option. The callgraph tool (source) was helpful in determining how to use the construction algorithms.

I've also added a -colors flag that enables debug output of the function coloring pass. It shows the roots (the coroutine.Yield functions, along with their type/color), and all edges that are followed in the coloring pass. It can be used to debug cases where a callgraph algorithm misses an edge, or where a function has more than one color.

@chriso chriso self-assigned this Dec 16, 2023
@chriso chriso merged commit 66bafb6 into main Dec 16, 2023
2 checks passed
@chriso chriso deleted the callgraph-debug branch December 16, 2023 00:54
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.

2 participants