Skip to content

Commit 918cfdc

Browse files
kv2019ilgirdwood
authored andcommitted
Add tools-v2.12 binaries
Generated with Intel SOF community build, identification "Build #6229". Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent e8604e4 commit 918cfdc

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env python3
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
#
4+
# Copyright (c) 2022, Intel Corporation. All rights reserved.
5+
6+
#pylint:disable=mixed-indentation
7+
8+
# Tool to stream data from Linux SOF driver "mtrace" debugfs
9+
# interface to standard output. Plain "cat" is not sufficient
10+
# as each read() syscall returns log data with a 32bit binary
11+
# header, containing the payload length.
12+
13+
import struct
14+
import os
15+
import sys
16+
import argparse
17+
18+
READ_BUFFER = 16384
19+
MTRACE_FILE = "/sys/kernel/debug/sof/mtrace/core0"
20+
21+
parser = argparse.ArgumentParser()
22+
parser.add_argument('-m', '--mark-chunks',
23+
action='store_true')
24+
25+
args = parser.parse_args()
26+
27+
chunk_idx = 0
28+
29+
fd = os.open(MTRACE_FILE, os.O_RDONLY)
30+
while fd >= 0:
31+
# direct unbuffered os.read() must be used to comply with
32+
# debugfs protocol used. each non-zero read will return
33+
# a buffer containing a 32bit header and a payload
34+
read_bytes = os.read(fd, READ_BUFFER)
35+
36+
# handle end-of-file
37+
if len(read_bytes) == 0:
38+
continue
39+
40+
if len(read_bytes) <= 4:
41+
continue
42+
43+
header = struct.unpack('I', read_bytes[0:4])
44+
data_len = header[0]
45+
data = read_bytes[4:4+data_len]
46+
47+
if (args.mark_chunks):
48+
chunk_msg = "\n--- Chunk #{} start (size: {}) ---\n" .format(chunk_idx, data_len)
49+
sys.stdout.write(chunk_msg)
50+
51+
sys.stdout.buffer.write(data)
52+
sys.stdout.flush()
53+
chunk_idx += 1

v2.12.x/tools-v2.12/sof-ctl

35.8 KB
Binary file not shown.

v2.12.x/tools-v2.12/sof-probes

30.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)