WALA icon indicating copy to clipboard operation
WALA copied to clipboard

how to save and load call graph

Open xxwxxwen opened this issue 1 year ago • 1 comments

Dear author, sometimes it takes a long time to build call graph for large program

  1. how to save CallGraph to disk such as dot file?

  2. how to load CallGraph from disk?

@msridhar Could you give me a reply at your convenience? Thank you for your help!

xxwxxwen avatar Mar 07 '23 09:03 xxwxxwen

There is code here to serialize JavaScript call graphs to JSON:

https://github.com/wala/WALA/blob/6f9d1372f0d7b4fb8e42e8622ceb37e328912b08/cast/js/src/main/java/com/ibm/wala/cast/js/util/CallGraph2JSON.java

I think a similar approach would work for serializing Java call graphs to disk. If you could make a version of this code that works for Java, we'd welcome a PR! For very large call graphs, you might need to look into streaming out the JSON, to avoid running out of memory.

I think reloading such serialized call graphs into WALA would be more work, as all the other auxiliary data structures (IMethods, etc.) would also need to be set up. But maybe you don't need that.

msridhar avatar Mar 07 '23 19:03 msridhar