To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit d2f4ab3b authored by Roman Trüb's avatar Roman Trüb
Browse files

handle case where parsed datatrace output is empty

parent bf45fb5a
......@@ -485,21 +485,22 @@ def worker_datatrace(queueitem=None, nodeid=None, resultfile_path=None, resultfi
except ValueError:
logqueue.put_nowait((loggername, logging.WARNING, "Empty data trace results file."))
else:
# add observer and node ID
dfData['obsid'] = obsid
dfData['nodeid'] = nodeid
# convert comparator ID to variable name
dfData['varname'] = dfData.comparator.apply(lambda x: (varnames[x] if x < len(varnames) else str(x)))
# append datatrace elements from obsever to datatrace log file
resultfile_lock.acquire()
with open(resultfile_path, "a") as outfile:
dfData.to_csv(
outfile,
columns=['global_ts', 'obsid', 'nodeid', 'varname', 'data', 'operation', 'PC', 'local_ts_tc'],
index=False,
header=False
)
resultfile_lock.release()
if len(dfData):
# add observer and node ID
dfData['obsid'] = obsid
dfData['nodeid'] = nodeid
# convert comparator ID to variable name
dfData['varname'] = dfData.comparator.apply(lambda x: (varnames[x] if x < len(varnames) else str(x)))
# append datatrace elements from obsever to datatrace log file
resultfile_lock.acquire()
with open(resultfile_path, "a") as outfile:
dfData.to_csv(
outfile,
columns=['global_ts', 'obsid', 'nodeid', 'varname', 'data', 'operation', 'PC', 'local_ts_tc'],
index=False,
header=False
)
resultfile_lock.release()
# append overflow events to errorlog
for idx, row in dfOverflow.iterrows():
write_to_error_log(row['global_ts_uncorrected'], obsid, nodeid, 'Datatrace: event rate too high (overflow occurred)!')
......
......@@ -272,7 +272,7 @@ class SwoParser():
self._currentPkt.append(type(self).DatatracePkt(header=swoByte, globalTs=globalTs))
else:
# Other undefined header
raise Exception("ERROR: Unrecognized discriminator ID in hardware source packet header: {}".format(swoByte)) # packets with undefined discriminator_id appear sporadically -> we cannot throw error here
raise Exception("ERROR: Unrecognized discriminator ID ({}) in hardware source packet header: {}".format(discriminator_id, swoByte))
else:
print("ERROR: Unrecognized DWT packet header: {} {:#010b}".format(swoByte, swoByte))
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment