ci/bare-metal: Truncate printed times and prefixes
The date isn't interesting, since you can tell if it wraps around anyway. Just print the time down to the millisecond, which should be plenty enough. We also don't need to print 'R SERIAL_CPU> ' when almost every line is reading from the CPU serial buffer, so make that the default. Signed-off-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31602>
This commit is contained in:
@@ -22,11 +22,11 @@ SECTION_END="end"
|
||||
class CrosServoRun:
|
||||
def __init__(self, cpu, ec, test_timeout, logger):
|
||||
self.cpu_ser = SerialBuffer(
|
||||
cpu, "results/serial.txt", "R SERIAL-CPU> ")
|
||||
cpu, "results/serial.txt", ": ")
|
||||
# Merge the EC serial into the cpu_ser's line stream so that we can
|
||||
# effectively poll on both at the same time and not have to worry about
|
||||
self.ec_ser = SerialBuffer(
|
||||
ec, "results/serial-ec.txt", "R SERIAL-EC> ", line_queue=self.cpu_ser.line_queue)
|
||||
ec, "results/serial-ec.txt", " EC: ", line_queue=self.cpu_ser.line_queue)
|
||||
self.test_timeout = test_timeout
|
||||
self.logger = logger
|
||||
|
||||
@@ -35,11 +35,11 @@ class CrosServoRun:
|
||||
self.cpu_ser.close()
|
||||
|
||||
def ec_write(self, s):
|
||||
print("W SERIAL-EC> %s" % s)
|
||||
print("EC> %s" % s)
|
||||
self.ec_ser.serial.write(s.encode())
|
||||
|
||||
def cpu_write(self, s):
|
||||
print("W SERIAL-CPU> %s" % s)
|
||||
print("> %s" % s)
|
||||
self.cpu_ser.serial.write(s.encode())
|
||||
|
||||
def print_error(self, message):
|
||||
|
@@ -35,7 +35,7 @@ class PoERun:
|
||||
self.powerup = args.powerup
|
||||
self.powerdown = args.powerdown
|
||||
self.ser = SerialBuffer(
|
||||
args.dev, "results/serial-output.txt", "")
|
||||
args.dev, "results/serial-output.txt", ": ")
|
||||
self.boot_timeout = boot_timeout
|
||||
self.test_timeout = test_timeout
|
||||
self.logger = logger
|
||||
|
@@ -22,7 +22,7 @@
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
import argparse
|
||||
from datetime import datetime, timezone
|
||||
from datetime import datetime, UTC
|
||||
import queue
|
||||
import serial
|
||||
import threading
|
||||
@@ -130,9 +130,10 @@ class SerialBuffer:
|
||||
if b == b'\n'[0]:
|
||||
line = line.decode(errors="replace")
|
||||
|
||||
time = datetime.now().strftime('%y-%m-%d %H:%M:%S')
|
||||
print("{endc}{time} {prefix}{line}".format(
|
||||
time=time, prefix=self.prefix, line=line, endc='\033[0m'), flush=True, end='')
|
||||
ts = datetime.now(tz=UTC)
|
||||
ts_str = f"{ts.hour:02}:{ts.minute:02}:{ts.second:02}.{int(ts.microsecond / 1000):03}"
|
||||
print("{endc}{time}{prefix}{line}".format(
|
||||
time=ts_str, prefix=self.prefix, line=line, endc='\033[0m'), flush=True, end='')
|
||||
|
||||
self.line_queue.put(line)
|
||||
line = bytearray()
|
||||
|
Reference in New Issue
Block a user