File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ [ignore]
2+ start =# @@@ ignore warnings @@@#
3+ stop =# @@@ detect warnings @@@#
4+
15[patterns]
26v1 =detected stall(s)? on CPU
37v2 =WARNING:.*\s(un)?lock(s|ing)?\s
Original file line number Diff line number Diff line change @@ -161,6 +161,8 @@ def filter_log_warnings(infile, outfile):
161161
162162 parser = ConfigParser ()
163163 parser .read_file (open (path ))
164+ ignore_start = parser ['ignore' ]['start' ]
165+ ignore_stop = parser ['ignore' ]['stop' ]
164166 suppressions = [t [1 ] for t in parser .items ('suppressions' , [])]
165167 suppression_patterns = [t [1 ] for t in parser .items ('suppression_patterns' , [])]
166168 suppression_patterns = [re .compile (p ) for p in suppression_patterns ]
@@ -180,11 +182,20 @@ def suppress(line):
180182 return False
181183
182184 found = False
185+ ignoring = False
183186 while True :
184187 line = infile .readline ()
185188 if len (line ) == 0 :
186189 break
187190
191+ if ignore_stop in line :
192+ ignoring = False
193+ elif not ignoring and ignore_start in line :
194+ ignoring = True
195+
196+ if ignoring :
197+ continue
198+
188199 if suppress (line ):
189200 continue
190201
You can’t perform that action at this time.
0 commit comments