ci/bare-metal: Include a timestamp in our serial reads.
gitlab CI doesn't include timestamps in its logs by default, but it's really useful for finding delays in our CI so stuff one in on the lines coming in from serial and being output to the gitlab log. The artifacts file is still the raw serial output. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6529>
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
# IN THE SOFTWARE.
|
# IN THE SOFTWARE.
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
from datetime import datetime,timezone
|
||||||
import queue
|
import queue
|
||||||
import serial
|
import serial
|
||||||
import threading
|
import threading
|
||||||
@@ -76,7 +77,10 @@ class SerialBuffer:
|
|||||||
line.append(b)
|
line.append(b)
|
||||||
if b == b'\n'[0]:
|
if b == b'\n'[0]:
|
||||||
line = line.decode(errors="replace")
|
line = line.decode(errors="replace")
|
||||||
print(self.prefix + line, flush=True, end='')
|
|
||||||
|
time = datetime.now().strftime('%y-%m-%d %H:%M:%S')
|
||||||
|
print("{time} {prefix}{line}".format(time=time, prefix=self.prefix, line=line), flush=True, end='')
|
||||||
|
|
||||||
self.line_queue.put(line)
|
self.line_queue.put(line)
|
||||||
line = bytearray()
|
line = bytearray()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user