Skip to content

Commit ef3e7a5

Browse files
enjiamainashif
authored andcommitted
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 <[email protected]> Signed-off-by: Enjia Mai <[email protected]>
1 parent 76743f4 commit ef3e7a5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

soc/xtensa/intel_adsp/tools/cavstool_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ def monitor_log(self):
9898
log.info(f"Start to monitor log output...")
9999
while True:
100100
# Receive data from the server and print out
101-
receive_log = str(self.sock.recv(BUF_SIZE).strip(), "utf-8")
101+
receive_log = str(self.sock.recv(BUF_SIZE), "utf-8").replace('\x00','')
102102
if receive_log:
103-
print(f"{receive_log}")
103+
sys.stdout.write(f"{receive_log}")
104+
sys.stdout.flush()
104105
time.sleep(0.1)
105106

106107
def __del__(self):

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def finish(self):
171171

172172
def is_connection_alive(self):
173173
try:
174-
self.request.sendall(b' ')
174+
self.request.sendall(b'\x00')
175175
except (BrokenPipeError, ConnectionResetError):
176176
log.info("Client is disconnect.")
177177
return False

0 commit comments

Comments
 (0)