CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
statics.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 import re
3 warning = re.compile("^function ")
4 tab = re.compile("\s+")
5 topfunc = re.compile("::produce\(|::analyze\(|::filter\(")
6 edmns = re.compile("::ED(Producer|Analyzer|Filter)")
7 keyword = re.compile("calls|overrides|variable|edmplugin")
8 paths = re.compile(".*?\s*src/([A-Z].*?/[A-z].*?)(/.*?):(.*?):(.*?)")
9 from collections import defaultdict
10 
11 gets = defaultdict(set)
12 callby = defaultdict(set)
13 calls = defaultdict(set)
14 plugins = set()
15 
16 f = open('db.txt')
17 
18 for line in f :
19  fields = line.split("'")
20  if keyword.search(line) :
21  if fields[2] == ' calls function ' :
22  if fields[1] not in callby[fields[3]]:
23  callby[fields[3]].add(fields[1])
24  if fields[3] not in calls[fields[1]]:
25  calls[fields[1]].add(fields[3])
26  if fields[2] == ' overrides function ' :
27  if fields[3] not in callby[fields[1]] and not edmns.search(fields[3]) :
28  callby[fields[1]].add(fields[3])
29  if fields[2] == ' static variable ' :
30  if fields[1] not in gets[fields[3]]:
31  gets[fields[3]].add(fields[1])
32  if fields[0].strip() == 'edmplugin type':
33  plugins.add(fields[1])
34 f.close()
35 
36 def stackup(str):
37  for call in callby[str]:
38  if call not in stack:
39  stack.append(call)
40  stackup(call)
41  return
42 
43 
44 funcs=defaultdict(list)
45 
46 for key in gets:
47  for get in gets[key]:
48  func = get+"#"+key
49  stack = list()
50  stack.append(get)
51  stackup(get)
52  funcs[func].append(stack)
53 
54 import copy
55 
56 for func in sorted(funcs.keys()):
57  get,var = func.split("#")
58  clone = copy.deepcopy(funcs[func])
59  for fields in clone:
60  found = ""
61  while fields:
62  field = fields.pop()
63  if topfunc.search(field) and not found:
64  fqn = topfunc.split(field)[0]
65  if fqn in plugins:
66  print "Non-const static var '"+var+"' is accessed in call stack '"+field+"->",
67  found = field
68  if field in calls[found] and found :
69  print field+"->",
70  found = field
71  if field == get and found :
72  print field
73 
74 for func in sorted(funcs.keys()):
75  get,var = func.split("#")
76  clone = copy.deepcopy(funcs[func])
77  for fields in clone:
78  found = ""
79  while fields:
80  field = fields.pop()
81  if topfunc.search(field) and not found:
82  fqn = topfunc.split(field)[0]
83  if fqn in plugins:
84  print "In call stack '"+field+"->",
85  found = field
86  if field in calls[found] and found :
87  print field+"->",
88  found = field
89  if field == get and found :
90  print field + "' non-const static var '"+var+"' is accessed."
91 
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
def stackup
Definition: statics.py:36
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run