diff options
Diffstat (limited to 'src/scripts/utilities.py')
-rw-r--r-- | src/scripts/utilities.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/scripts/utilities.py b/src/scripts/utilities.py index 7e69f462a9..c4767a43b7 100644 --- a/src/scripts/utilities.py +++ b/src/scripts/utilities.py @@ -120,3 +120,49 @@ def update_directory(srcpath, dstpath, recursive=True, destructive=True, shallow if not os.path.exists(dstdir): os.makedirs(dstdir) update_directory(srcdir, dstdir, recursive, destructive, shallow) + +class EventExclusions: + def __init__(self): + self.nostack = set() + self.explicitstack = set() + self.noclrinstance = set() + +def parseExclusionList(exclusion_filename): + with open(exclusion_filename,'r') as ExclusionFile: + exclusionInfo = EventExclusions() + + for line in ExclusionFile: + line = line.strip() + + #remove comments + if not line or line.startswith('#'): + continue + + tokens = line.split(':') + #entries starting with nomac are ignored + if "nomac" in tokens: + continue + + if len(tokens) > 5: + raise Exception("Invalid Entry " + line + "in "+ exclusion_filename) + + eventProvider = tokens[2] + eventTask = tokens[1] + eventSymbol = tokens[4] + + if eventProvider == '': + eventProvider = "*" + if eventTask == '': + eventTask = "*" + if eventSymbol == '': + eventSymbol = "*" + entry = eventProvider + ":" + eventTask + ":" + eventSymbol + + if tokens[0].lower() == "nostack": + exclusionInfo.nostack.add(entry) + if tokens[0].lower() == "stack": + exclusionInfo.explicitstack.add(entry) + if tokens[0].lower() == "noclrinstanceid": + exclusionInfo.noclrinstance.add(entry) + + return exclusionInfo
\ No newline at end of file |