Commit Graph

63 Commits

Author SHA1 Message Date
Karol Trzcinski 97fd4837a2 uuid: Make entries monosized
It make code dealing with entries simpler, and allow to create
UUID entries dictionary with constant access time to any entry.
As long as struct definition is fixed, then can passed as pointer
with correct type to function call, instead of void pointer.
UUID entries aren't storred in flash memory, so entry size is not
important.
Explicit add zero at the end of entity_name to trigger string overflow
warning for shortest incorrect string length.
Resolve problem with cutted UUID info in logger output.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-18 12:08:24 +01:00
Karol Trzcinski d7b535e282 logger: Add option to set timestamp precision
Shorten timestamp makes logger output more compact, it change:
$ ./sof-logger -l sof-cnl.ldc -i dma_trace_1.bin
         TIMESTAMP              DELTA C# COMPONENT          LOCATION                      CONTENT
[   497588.489583] (   497588.500000) c0 DMA                .../intel/cavs/hda-dma.c:407  hda-dmac: 4 channel 6 -> get
to:
$ sof-logger -l sof-cnl.ldc -i dma_trace_1.bin -f0
   TIMESTAMP        DELTA C# COMPONENT          LOCATION                      CONTENT
[    497588] (    497588) c0 DMA                .../intel/cavs/hda-dma.c:407  hda-dmac: 4 channel 6 -> get

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-18 12:06:51 +01:00
Karol Trzcinski 5469b1a070 logger: Add option to cutout trace location
It allows to make logs output more compact, it change:
$ ./sof-logger -l sof-cnl.ldc -i dma_trace_1.bin
         TIMESTAMP              DELTA C# COMPONENT          LOCATION                      CONTENT
[   497588.489583] (   497588.500000) c0 DMA                .../intel/cavs/hda-dma.c:407  hda-dmac: 4 channel 6 -> get
to:
$ ./sof-logger -l sof-cnl.ldc -i dma_trace_1.bin -L
         TIMESTAMP              DELTA C# COMPONENT          CONTENT
[   497588.489583] (   497588.500000) c0 DMA                hda-dmac: 4 channel 6 -> get

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-18 12:06:51 +01:00
Daniel Leung f6f748b89f cmake: use fw.h and manifest.h from rimage/
Since both fw.h and manifest.h are being used in the main SOF
repo, and also the standalone rimage repo, to prevent them
getting out of sync, use the ones coming from the rimage repo
instead.

Also, git submodule update is being executed when cmake is
run so there is no need to update when building rimage.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-13 10:16:04 +01:00
Marcin Maka 6ce635aa82 trace: replace TRACE_CLASS_ by uuids
All trace entries are identified by uuids only now.
Previous TRACE_CLASS_ identification removed completely.

UUIDs are passed to the tracing subsystem inside a trace
context. Each trace context defines run-time log level.
The level is initialized to LOG_LEVEL_INFO (this may be
change per instance is needed) and may be re-configured
at run-time.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-30 11:39:37 +02:00
Karol Trzcinski f87c6e89f2 smex: logger: Logger should point to smex as ldc generator
rimage will not be responsible for ldc file creation so logger
should points valid tool.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-03 16:27:04 +01:00
Payal Kshirsagar 66fd8cefba tools: logger: avoid NULL comparison
Change suggested by coccinelle.
Avoid NULL comparison, compare using boolean operator.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-27 10:50:52 +01:00
Karol Trzcinski 7bf879b226 tools: logger: Add clock parameter in help message
help message should explicity show that -c flags needs parameter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Karol Trzcinski fc84534247 tools: logger: Add LDC dump option
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>
2020-03-26 10:18:30 +01:00
Karol Trzcinski ee692abd97 tools: logger: Refactor format_uid()
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>
2020-03-26 10:18:30 +01:00
Karol Trzcinski e087ed7aa4 tools: logger: Align logs header to content
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>
2020-03-26 10:18:30 +01:00
Karol Trzcinski b5bb895e57 tools: logger: Add 'error: ' prefix to messages in log_err function
After change error messages will be more consistent and easy to grep.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-25 13:59:45 +01:00
Karol Trzcinski 354ff5ccf9 tools: logger: Skip double error logs to stdout
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>
2020-03-25 13:59:45 +01:00
Karol Trzcinski 74fa3c0a09 tools: logger: Create log_err function
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>
2020-03-20 11:16:54 +00:00
Karol Trzcinski 0f3d84ecea tools: logger: Align indentation in convert function
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>
2020-03-20 11:16:54 +00:00
Marcin Maka 93cf630d9d logger: support for uuid address as entry parameter
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>
2020-03-06 10:15:04 +01:00
Marcin Maka f3e80af1e7 logger: add WARN prefix for warning level traces
Warning traces prefixed and painted in yellow.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-06 10:15:04 +01:00
Marcin Maka 11744cc588 logger: improve the format of the output
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>
2020-03-06 10:15:04 +01:00
Marcin Maka fcd0895b74 trace: remove legacy trace classes
TRACE_CLASS ids used by parts switch to uuid-based logging
marked as unused.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-06 10:15:04 +01:00
Marcin Maka 19e11c6e23 tools: add support for static uuids section
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>
2020-03-06 10:15:04 +01:00
Marcin Maka 322e150080 trace: add uuid to trace entry and remove trace ids
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>
2020-03-06 10:15:04 +01:00
Marcin Maka ef5eda7da4 logger: fw ver verification moved to function
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>
2020-03-06 10:15:04 +01:00
Marcin Maka 22ddf1e210 abi: define debug abi version for user space dbg interfaces
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>
2020-02-27 13:07:17 +01:00
ArturX Kloniecki 939d01d4ff cleanup: Remove logger.exe binary that got accidentally added.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
2020-01-29 15:07:04 +01:00
Adrian Bonislawski 716bc4bdd8 probes: initial implementation, kconfig and IPC params
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>
2020-01-29 11:26:58 +01:00
Janusz Jankowski 38c84de747 trace: add mn class
Add trace class for M/N divider.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-01-21 02:34:48 +01:00
ArturX Kloniecki 81936774c8 notifier: Add traces for notifier.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
2019-12-12 11:08:00 +01:00
Seppo Ingalsuo adfb6d1dff ASRC: Addition to sof-logger
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>
2019-11-27 09:49:48 +00:00
Slawomir Blauciak c7b914dd14 ipc: channel map structures and api
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>
2019-11-20 10:44:51 +00:00
Liam Girdwood 1fa037cc1e logger: fix build errors with gcc 9.1.x
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>
2019-11-11 11:55:14 +00:00
Dragos Tarcatu 7334d63fd4 tools: logger: (cosmetic) Improve usage text
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>
2019-11-01 10:20:13 +01:00
Slawomir Blauciak 79e7a3d206 dai: rename soundwire to alh
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-09-05 15:49:46 +02:00
Janusz Jankowski 7fb9372d29 logger: add missing trace classes
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-24 22:33:25 +02:00
Janusz Jankowski 3d5cc36b1b trace: deduplicate TRACE_CLASS defines
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>
2019-07-24 22:33:25 +02:00
Tomasz Lauda 807815f41b include: cleanup inclusions in ipc, kernel and user headers
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>
2019-07-15 13:29:29 +02:00
Tomasz Lauda 119746d206 common: replace __attribute__((packed)) with __packed
Replaces all occurrences of __attribute__((packed)) with
__packed macro.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-12 16:12:59 +02:00
Janusz Jankowski 0eb68c6d5d logger: add debugfs entries for apl and cnl
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>
2019-06-07 22:36:50 +02:00
Janusz Jankowski c6064624f6 cmake: add spdx license identifier
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
ArturX Kloniecki 3e3f1d0cae Logger: Update license info in sof-looger files.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
2019-05-31 22:26:31 +02:00
Janusz Jankowski e39ed5ebf4 include: split uapi headers into more directories
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>
2019-05-31 20:10:45 +01:00
Kai Vehmanen 6a84b4e945 sof: logger: reopen trace file upon EOF
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>
2019-04-25 20:12:17 +02:00
Kai Vehmanen e14ab7088b tools: logger: fix parsing of -s argument
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>
2019-04-15 16:25:39 +01:00
Kai Vehmanen 9fa0aef635 tools: logger: ignore end-of-file in trace mode
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>
2019-04-11 10:29:54 +02:00
Marcin Maka ad0ff1f2e5 tools: logger: added less formatted output mode
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>
2019-04-01 11:37:57 +02:00
Bartosz Kokoszko e5cf39ff9c schedule: ll: add ll specific traces
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-03-26 16:20:34 +00:00
Bartosz Kokoszko 648345065a scheduler: add new generic scheduler api
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>
2019-03-19 14:37:15 +00:00
Lech Betlej 29bdba76d7 logger: add KPB component name
Logger will display a proper component name for traces
from KPB component.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-03-10 19:07:47 +01:00
Lech Betlej 31d871d5af logger: add channel selector component name
Logger will display a proper component name for traces
from channel selector component.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-03-10 19:07:47 +01:00
Janusz Jankowski 9fb2097e52 cmake: tools: install targets
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-02-14 18:00:26 +00:00
Janusz Jankowski dff70c4490 cmake: tools: remove autotools
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-02-14 18:00:26 +00:00