2 from __future__
import print_function
4 topfunc = re.compile(
"::(produce|analyze|filter|beginLuminosityBlock|beginRun|beginStream)\(")
5 baseclass = re.compile(
"edm::(one::|stream::|global::)?ED(Producer|Filter|Analyzer)(Base)?")
6 farg = re.compile(
"\(.*\)")
8 epfunc = re.compile(
"TGraph::(.*)\(.*\)")
9 skipfunc = re.compile(
"TGraph::IsA\(.*\)")
15 f = open(
'function-calls-db.txt')
18 fields = line.split(
"'")
19 if fields[2] ==
' calls function ' :
20 if not skipfunc.search(line) :
21 G.add_edge(fields[1],fields[3],kind=fields[2])
22 if epfunc.search(fields[3]) : epfuncs.add(fields[3])
23 if fields[2] ==
' overrides function ' :
24 if baseclass.search(fields[3]) :
25 if topfunc.search(fields[3]) : toplevelfuncs.add(fields[1])
26 G.add_edge(fields[1],fields[3],kind=
' overrides function ')
28 if not skipfunc.search(line) :
29 G.add_edge(fields[3],fields[1],kind=
' calls override function ')
30 if epfunc.search(fields[1]) : epfuncs.add(fields[1])
33 for epfunc
in sorted(epfuncs):
print(epfunc)
36 for epfunc
in epfuncs:
37 for tfunc
in toplevelfuncs:
38 if nx.has_path(G,tfunc,epfunc) :
39 path = nx.shortest_path(G,tfunc,epfunc)
42 print(re.sub(farg,
"()",p)+
"; ", end=
' ')
S & print(S &os, JobReport::InputFile const &f)