Browse Source

soc: xtensa: cavstool: add support for logs coming from HDA logging

1) HDA logging seems to be using some padding like '\x00'. Such
string can print well on a terminal but corrupt the string match.
And this can cause false failure if RunID matching is affected.
Remove such padding before checking RunID.

An affected RunID example:
'7aa9ba3c6db12\x00\...\x00\x00\x00\x00d0c7fcf382a4af40ec6'

Expected:
'7aa9ba3c6db12d0c7fcf382a4af40ec6'

2) Use non-displayable chars for live connection check. Otherwise
the log output will have subtle garbage like extra spaces which
locate randomly.

This solution comes from the PR #50071, the author is smrtos.

Signed-off-by: Ming Shao <ming.shao@intel.com>
Signed-off-by: Enjia Mai <enjia.mai@intel.com>
pull/50325/head
Enjia Mai 3 years ago committed by Anas Nashif
parent
commit
ef3e7a5fa6
  1. 5
      soc/xtensa/intel_adsp/tools/cavstool_client.py
  2. 2
      soc/xtensa/intel_adsp/tools/remote-fw-service.py

5
soc/xtensa/intel_adsp/tools/cavstool_client.py

@ -98,9 +98,10 @@ class cavstool_client(): @@ -98,9 +98,10 @@ class cavstool_client():
log.info(f"Start to monitor log output...")
while True:
# Receive data from the server and print out
receive_log = str(self.sock.recv(BUF_SIZE).strip(), "utf-8")
receive_log = str(self.sock.recv(BUF_SIZE), "utf-8").replace('\x00','')
if receive_log:
print(f"{receive_log}")
sys.stdout.write(f"{receive_log}")
sys.stdout.flush()
time.sleep(0.1)
def __del__(self):

2
soc/xtensa/intel_adsp/tools/remote-fw-service.py

@ -171,7 +171,7 @@ class adsp_log_handler(socketserver.BaseRequestHandler): @@ -171,7 +171,7 @@ class adsp_log_handler(socketserver.BaseRequestHandler):
def is_connection_alive(self):
try:
self.request.sendall(b' ')
self.request.sendall(b'\x00')
except (BrokenPipeError, ConnectionResetError):
log.info("Client is disconnect.")
return False

Loading…
Cancel
Save