binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Print out callgraph of a specific entry point

Open Mintyboi opened this issue 1 year ago • 2 comments

Allows us to generate / print out a callgraph for a specific entry point which we'd like to focus on. Sample usage: wasm-opt foobar.wasm --print-call-graph -pa=callgraph-entry@foo > foo.dot

Mintyboi avatar Feb 27 '24 06:02 Mintyboi

It looks like we don't have a test for this pass. If you want to extend it then I suggest we first land a PR that adds a test for the old functionality. Then this PR can land later, and the test will show nothing regressed.

I found it useful for my use case and was sharing in the case where others will be able to benefit from it as well. If there's not much traction on this, I'll probably leave it as is. But I do agree with adding a tests for old functionality on it! I'll see if I can work on that.

Mintyboi avatar Feb 28 '24 03:02 Mintyboi

If there's not much traction on this, I'll probably leave it as is.

I do think this can be useful! My comments weren't meant to discourage you, but just to explain how I think it best to proceed to get this landed.

It's probably also fine to add a test in this PR for both cases, as the pass is simple enough.

kripken avatar Feb 28 '24 20:02 kripken