Create dump options for logger to print important information from
LDC file, like DBG_ABI version and UUID with corresponding names.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Split this function to part responsible for pointer calculation
and string formatting. It make possibility to use same
string format with different pointer arithmetic.
Moreover introduce aprintf to make memory allocation for output
string more automated process.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Double space in formatting string led to little mismatch between header
and content in output logger file.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
When out_fd points standard output then error message shouldn't be
duplicated - duplicated messages only make logger output more messy.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Error during conversion should be logged to stderr and to
output file by default. Such a approach will speed up debugging
process when some error with conversion occur in CI.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Content inside if statement should be indented with only one
tab more that if keyword.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Log entry format is scanned by the logger and if %s is found,
then corresponding parameter is interpreted as address
of static uuid entry. The original address is replaced by
formatted uuid namen and value, painted in blue, before
fprintf() is called.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Log entry parameters format is compacted to reserve more
space for the text.
Max entry location length is increased to 24 characters.
Timestamp and component name/id use colors to improve
readability.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Content of static uuid section is appended to the ldc file
along with a new special header by rimage.
New ldc file part is read by the logger to decode
uuid pointers provided in traces into nice names.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
New trace entry parameter is defined: uuid of the source.
Technically, this is an address of uuid entry linked
inside a special section in elf.
Has_ids is removed from the static log entry since eventually
all entries will use uuids and -1 detection is good enough
detection for those who still do not provide ids.
Note: both changes are done in a single patch to avoid two
major dbg-abi version bumps.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Optional fw version verification moved to separate function
in order to modularize code of convert().
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
The sof-logger and potentially other debug API clients perform ABI
compatibility check using the single FW ABI version. The same one is used
by the primary FW client which is the kernel driver. If there is a change
made to the debug API, the main ABI has to be updated to protect integrity
of the debug tools while such a change may not affect the kernel driver
at all.
This patch introduces new debug ABI version to be increased when changing
user space debug interfaces while the the main ABI is not affected.
Recompilation and installation of the new driver every time the tunneled
debug protocol is upgraded may be avoided.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Probes are a feature that will allow user to extract and inject data
from/into buffers at runtime.
Basic flow is as follows:
1. Initialization of probes subsystem, allowing for simultaneous
configuration of DMA for extraction. If extraction DMA is not setup
during init, extraction probes will be disabled.
2. Configuration of probe points, preceded by DMA configuration in case
of injection probes.
3. Probes are now in operation and will send single multiplexed stream from
extraction probe points and inject data into specified buffers.
4. State of probes and associated DMAs may be retrieved via INFO functions.
5. Removal of probe points.
6. Removal of injection DMAs.
7. Deinitialization of probes subsystem.
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
This patch adds print of text ASRC into sof-logger for ASRC
originated traces instead of unknown.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This change adds stream map and channel map structures
used for channel re-routing and stream aggregation.
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
Latest GCC does additional checks. This patch fixes the following build
error.
Scanning dependencies of target sof-logger
[ 0%] Building C object logger/CMakeFiles/sof-logger.dir/convert.c.o
/home/lrg/work/sof/sof/tools/logger/convert.c: In function ‘serial_read’:
/home/lrg/work/sof/sof/tools/logger/convert.c:311:2: error: converting a packed ‘struct log_entry_header’ pointer (alignment 1) to a ‘uint32_t’ {aka ‘unsigned int’} pointer (alignment 4) may result in an unaligned pointer value [-Werror=address-of-packed-member]
311 | for (len = 0, n = (uint32_t *)&dma_log; len < sizeof(dma_log); n++) {
| ^~~
In file included from /home/lrg/work/sof/sof/tools/logger/convert.c:15:
/home/lrg/work/sof/sof/tools/../src/include/user/trace.h:94:8: note: defined here
94 | struct log_entry_header {
| ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [logger/CMakeFiles/sof-logger.dir/build.make:76: logger/CMakeFiles/sof-logger.dir/convert.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:91: logger/CMakeFiles/sof-logger.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Improve the sof-logger usage description text a little bit.
Specifically the -s argument is pretty confusing right now as
it says nothing about having an additional argument for the state
name.
Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
These traces shouldn't be duplicated, they should be in
more public header because they are used outside of FW.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Cleanups inclusions in ipc, kernel and user headers.
Some of the headers were missing and some weren't needed.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Logger was aware only of debugfs entries for BYT/HSW platforms.
This commit adds debugfs entries for APL/CNL.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Some of interface headers are not needed by kernel,
but are needed by user-space applications, so we can split them
into multiple directories that indicate their purpose.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
If logger reads an end-of-file from trace node, reopen the file
to ensure trace read position is in sync between host and DSP.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Fix logic for saving the snapshot file argument. getopt()
is called at least once after snapshot option is parsed and
getopt() will erase the optarg value when exiting the while
loop. Without this patch, argument is always NULL and snapshot
cannot be taken.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Change logger behaviour such that in trace (-t) mode logger
only stops if an error is detected. If no error, logger
continues to try and read data from debugfs node.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Activated by '-r' option. Useful for intermediate log
processing when the output is used as an input for another
tool. No headers, tokens separated by single spaces,
component ids concatenated with component name to
still produce a single token if present.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
This commit:
1. Renames specific schedulers:
- schedule (.c/.h) -> edf_schedule (.c/.h)
- work (.c/.h) -> ll_schedule (.c/.h)
2. Implements new generic scheduler api based on generic
struct with scheduler ops. Every specific
scheduler exports struct with pointers to its
specific functions.
3. Makes edf and ll using generic api (exports structure
with pointers to its own specific functions)
4. Updates host and pipeline tests due to scheduler
changes.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
On some systems the DSP has no DMA interface to the host and is
using a serial port for sending its trace. This patch adds a "-u"
argument to specify a baudrate, that should be used with the serial
interface. The implementation takes care of spurious bytes,
sometimes seen in the beginning of the trace, produced by the port
initialisation by the DSP. The format is fixed to 8N1.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1. Programs shouldn't exit with negative return values, strictly
speaking only EXIT_SUCCESS and EXIT_FAILURE should be used,
however it is also valid to return 0 for success and any number
from 1 to 125 for a failure.
2. Avoid passing complete structs as function parameters where an
additional copy of one isn't needed, use const pointers instead.
3. Remove a left-over unused argument.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
I've added abi_version verification. Be default logger verify: abi
in *.ldc file with logger abi version. Additionally, logger can verify
abi in "/sys/kernel/debug/sof/fw_version" (with -e flag) or in
ver_file (with -v ver_file) with logger abi version.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>