1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 02:40:50 +01:00

trace/serial_trace: Flush data to file before copying

We add a missing flush which esures that all data has been synced to
the temporary file before we copy it. Prior to this commit, we would
sometimes miss the last few lines of the trace.
This commit is contained in:
Sascha Bischoff 2018-06-14 11:27:12 +01:00 committed by setrofim
parent 804a044efc
commit 41f460afbe

View File

@ -69,6 +69,8 @@ class SerialTraceCollector(TraceCollector):
if self._collecting:
raise RuntimeError("get_trace was called whilst collecting")
self._tmpfile.flush()
shutil.copy(self._tmpfile.name, outfile)
self._tmpfile.close()