summaryrefslogtreecommitdiff
path: root/scripts/maint/display_callgraph.py
blob: 9ead56c8cc101b25584a0d2af3cd995fddb9166b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/python

import cPickle

callgraph = cPickle.load(open("callgraph.pkl"))
closure = cPickle.load(open("callgraph_closure.pkl"))
sccs = cPickle.load(open("callgraph_sccs.pkl"))

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)


c = [ (len(component), component) for component in sccs ]
c.sort()

for n, component in c:
   if n < 2:
      continue
   print n, component