@@ -34,6 +34,83 @@ xtensa-byt-elf-objcopy -I binary -O elf32-xtensa-le -B xtensa image.bin image.bi
3434
3535xtensa-byt-elf-objdump -D image.bin.elf > image.dis.txt
3636
37+
38+ sof-logger
39+ ======
40+
41+ sof-logger is used to print logs delivered from FW dma_trace mechanism, by searching log
42+ entries in *.ldc file generated by rimage.
43+
44+ Every entry declared in FW is placed in elf output file (e.g. sof-apl) in
45+ .static_log_entries section in a form of struct defined in sof/src/include/sof/trace.h
46+ in sof fw repo.
47+
48+ *.ldc file contains snd_sof_logs_header (defined in rmbox/logger_convert.c)
49+ following by .static_log_entries section incorporated from FW elf file (e.g. sof-apl).
50+ snd_sof_logs_header contains basic information about .static_log_entries section
51+ like base_address and data_length.
52+
53+ sof-logger works by reading entry parameters value and entries addresses from FW
54+ dma_trace mechanism and searching suitable entry in *.ldc file by its address.
55+
56+ Usage sof-logger <option(s)> <file(s)>
57+ Display mailbox contents
58+ -h help
59+ -l *.ldc_file Specify the *.ldc file
60+ -i in_file Get traces from in_file, instead of the default
61+ "/sys/kernel/debug/sof/etrace"
62+ -o out_file Specify the output file, instead of default stdout
63+ -t Get traces from "/sys/kernel/debug/sof/trace", instead
64+ of the default "/sys/kernel/debug/sof/etrace"
65+ -p Get traces from stdin, instead of the default
66+ "/sys/kernel/debug/sof/etrace"
67+ -c Set timestamp clock in MHz
68+ -s Take a snapshot of state
69+
70+
71+ Examples:
72+
73+ - Get traces from "/sys/kernel/debug/sof/etrace" file and prints logs to stdout
74+
75+ $ sof-logger -l ldc_file
76+
77+ - Get traces from "/sys/kernel/debug/sof/etrace" file and prints logs to
78+ out_file file
79+
80+ $ sof-logger -l ldc_file -o out_file
81+
82+ - Get traces from "/sys/kernel/debug/sof/trace" file and prints logs to stdout
83+
84+ $ sof-logger -l ldc_file -t
85+
86+ - Get traces from "/sys/kernel/debug/sof/trace" file and prints logs to
87+ out_file file
88+
89+ $ sof-logger -l ldc_file -t -o out_file
90+
91+ - Get traces from stdin and prints logs to stdout
92+
93+ $ sof-logger -l ldc_file -p
94+
95+ - Get traces from stdin and prints logs to out_file file
96+
97+ $ sof-logger -l ldc_file -p -o out_file
98+
99+ - Get traces from trace_dump file and prints logs to stdout
100+
101+ $ sof-logger -l ldc_file -i trace_dump
102+
103+ - Get traces from trace_dump file and prints logs to out_file file
104+
105+ $ sof-logger -l ldc_file -i trace_dump -o out_file
106+
107+ - c flag is intented for defining clock value (in MHz) used to format log
108+ timestamps. By default clock value is set to 19.2 (MHz). Below example
109+ set clock value to 19.9 (MHz).
110+
111+ $ sof-logger -l ldc_file -i trace_dump -o out_file -c 19.9
112+
113+
37114tests
38115=====
39116
0 commit comments