Bug 1614805 Part 2: modify the re.match expression to cover the empty event r=perftest-reviewers,sparky

Differential Revision: https://phabricator.services.mozilla.com/D73608
This commit is contained in:
alexandru.ionescu 2020-05-12 12:25:27 +00:00
Родитель a60625e05a
Коммит 3497d554d1
2 изменённых файлов: 13 добавлений и 12 удалений

Просмотреть файл

@ -434,16 +434,15 @@ class BrowserLogResults(object):
self.mainthread_io(counter_results)
if not set(counters).union(set(mainthread_counters))\
if not set(counters).union(set(mainthread_counters)) \
.intersection(counter_results.keys()):
# no xperf counters to accumulate
return
filename = 'etl_output_thread_stats.csv'
if not os.path.exists(filename):
print("Warning: we are looking for xperf results file %s, and"
" didn't find it" % filename)
return
raise utils.TalosError("Error: we are looking for xperf results file %s,"
" and didn't find it" % filename)
contents = open(filename).read()
lines = contents.splitlines()
@ -473,9 +472,8 @@ class BrowserLogResults(object):
if (set(mainthread_counters).intersection(counter_results.keys())):
filename = 'etl_output.csv'
if not os.path.exists(filename):
print("Warning: we are looking for xperf results file"
" %s, and didn't find it" % filename)
return
raise utils.TalosError("Error: we are looking for xperf results file"
" %s, and didn't find it" % filename)
contents = open(filename).read()
lines = contents.splitlines()
@ -491,7 +489,7 @@ class BrowserLogResults(object):
values = dict(zip(header, row))
for i, mainthread_counter in enumerate(mainthread_counters):
if int(values[mainthread_counter_keys[i]]) > 0:
counter_results.setdefault(mainthread_counter, [])\
counter_results.setdefault(mainthread_counter, []) \
.append([int(values[mainthread_counter_keys[i]]),
values['filename']])

Просмотреть файл

@ -258,10 +258,13 @@ def trackThreadNetIO(row, io, stage):
gConnectionIDs[connID] = tid
origThread = gConnectionIDs[connID]
if origThread in gThreads:
try:
netEvt = re.match("[\w-]+\/([\w-]+)", event).group(1)
except AttributeError as e:
print("Error matching event {}: {}".format(event, str(e)))
match = re.match("[\w-]+\/([\w-]+)?", event)
if not match:
raise xtalos.XTalosError(
"Could not find a regular expression match for event: {}"
.format(event)
)
netEvt = match.group(1)
if netEvt in net_events:
opType = net_events[netEvt]