diff options
Diffstat (limited to 'scripts/maint/display_callgraph.py')
-rwxr-xr-x | scripts/maint/display_callgraph.py | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/scripts/maint/display_callgraph.py b/scripts/maint/display_callgraph.py index 9ead56c8cc..211bfda28d 100755 --- a/scripts/maint/display_callgraph.py +++ b/scripts/maint/display_callgraph.py @@ -2,9 +2,12 @@ import cPickle -callgraph = cPickle.load(open("callgraph.pkl")) -closure = cPickle.load(open("callgraph_closure.pkl")) -sccs = cPickle.load(open("callgraph_sccs.pkl")) +data = cPickle.load(open("callgraph.pkl")) + +callgraph = data['callgraph'] +closure = data['closure'] +sccs = data['sccs'] +fn_bottle, call_bottle = data['bottlenecks'] for n_reachable, fn in sorted(list((len(r), fn) for fn, r in closure.iteritems())): print "%s can reach %s other functions." %(fn, n_reachable) @@ -13,10 +16,24 @@ for n_reachable, fn in sorted(list((len(r), fn) for fn, r in closure.iteritems() c = [ (len(component), component) for component in sccs ] c.sort() +print "\n================================" + for n, component in c: if n < 2: continue - print n, component + print "Strongly connected component of size %d:"%n + print component + + +print "\n================================" +print "====== Number of functions pulled into blob, by function in blob." +fn_bottle.sort() +for n, fn in fn_bottle[-30:]: + print "%3d: %s"%(n, fn) +print "====== Number of functions pulled into blob, by call in blob." +call_bottle.sort() +for n, fn1, _, fn2 in call_bottle[-30:]: + print "%3d: %s -> %s "%(n, fn2, fn1) |