diff --git a/examples/callgraph/func_size.py b/examples/callgraph/func_size.py new file mode 100644 index 00000000..bdbdf8b7 --- /dev/null +++ b/examples/callgraph/func_size.py @@ -0,0 +1,13 @@ +# eg. +# callgraph a.wasm|python3 func_size.py|sort -nr|head -10 + +import json +import sys + + +j = json.load(sys.stdin) +funcs = j["funcs"] +for f in funcs: + if "expr_size" not in f: + continue + print(f"{f['expr_size']} {f['name']}")