Commit Graph

225 Commits

Author SHA1 Message Date
Nikolay Agishev 5b6f2f4fb6 twister: Add fiters to SYS-T related tests
New filter "TOOLCHAIN_HAS_NEWLIB == 1" was applied
because of following chain of dependencies:
LOG_MIPI_SYST_ENABLE=y --> CONFIG_MIPI_SYST_LIB --> \
--> REQUIRES_FULL_LIBC --> NEWLIB_LIBC.

Not all compillers announced in Zephyr support NewLib.

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2022-10-27 11:03:30 +02:00
Zhao Shuai 4a8073882b tests: create test for dynamic loadable logging backends
Test the three APIs, log_backend_activate,
log_backend_is_active and log_backend_deactivate.

Signed-off-by: Zhao Shuai <shuai1x.zhao@intel.com>
2022-10-26 15:51:11 -07:00
Ming Shao 1402d0d3ab log_link: fix the log_link test failure on adsp boards
The log_link tests are meant to work with 2 mock log backends.
But Intel ADSP platform has an extra default backend named
"log_backend_adsp" when CONFIG_LOG_BACKEND_ADSP=y, which will
mess things up.

Fix it by disabling the default backend.

Signed-off-by: Ming Shao <ming.shao@intel.com>
2022-10-25 10:52:00 +02:00
Krzysztof Chruscinski 042e233284 tests: logging: Add test for processing order with links
Added test which validates that messages are processed in
expected order. Order depends on link configuration. If link
is using dedicated mpsc_pbuf then processing order is
based on timestamp. When single mpsc_pbuf is used then order
is derived from message arrival order.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-10-17 10:16:53 +02:00
Krzysztof Chruscinski 2f12445e2b tests: logging: Add test for log_link
Added test for log_links which are used in multidomain logging.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-10-17 10:16:53 +02:00
Krzysztof Chruscinski e322447109 logging: Initial multidomain support
Adding multidomain support by introducing log_link module which
acts as a receiver of log messages created by another domain.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-10-17 10:16:53 +02:00
Krzysztof Chruscinski 7fb54e221b tests: logging: Add test for log_cache
Test suite for log_cache module.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-10-17 10:16:53 +02:00
Krzysztof Chruscinski 54a64edb0e tests: logging: log_stack: Adjust thresholds
Adjust threshold for failing tests.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-10-17 10:16:53 +02:00
Anas Nashif 41e6758b24 tests: logging: log_api: add native_posix to platform_allow
native_posix being an integration plarform, needs to be in the allow
list.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-10-13 06:23:46 -04:00
Carlo Caione dfbfb3ff67 test: log_output: Exclude qemu_arc_hs5x
This platform is failing and breaking main. Exclude until a proper fix
is found.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-10-12 17:40:10 +09:00
Lucas Denefle 2efc9cc847 logging: enable setting custom logging output func
To enable custom formatting of the log output while still using existing
backend, this commit adds the `log_output_custom` feature.
To use, register a commit with `log_custom_output_msg_set` then set the
log backend format set using `log_backend_format_set` with
`LOG_OUTPUT_CUSTOM`

Signed-off-by: Lucas Denefle <lucas.denefle@converge.io>
2022-10-06 19:15:35 -04:00
Krzysztof Chruscinski e6bbc6941a logging: Use STRUCT_SECTION macros for log backend
Clean up logging code to utilize macros for handling sections.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-10-03 10:11:03 +02:00
Krzysztof Chruscinski 50d9c27990 tests: logging: log_stack: Adjust stack usage for x86
x86 deferred mode is failing. Adjust threshold values.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-19 10:14:23 +00:00
Michał Barnaś dae8efa692 ztest: remove the obsolete NULL appended to zassert macros
This commit removes the usage of NULL parameter as message in
zassert_* macros after making it optional

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-09-09 07:05:38 -04:00
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Krzysztof Chruscinski 6f022f582b tests: logging: log_api: Add test for LOG_RAW
Add test for LOG_RAW macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-05 06:26:54 -04:00
Krzysztof Chruscinski e052ba73ce tests: logging: log_core_additional: Fix missing dependency
Add LOG_OUTPUT to the test configuration.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-01 20:54:13 +02:00
Krzysztof Chruscinski ade2436bb0 tests: logging: log_api: Tune test to execute faster
Due to timeout settings, test was executing slowly and in certain
configurations it timed out. Adjusting timing to speed up the test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-01 15:00:04 +00:00
Stephanos Ioannidis e6d7118f0e tests: log_core_additional: Fix log_user test filter
This commit temporarily disables the `integration_platforms` for the
`log_user` test because it cannot be specified alongside the
`toolchain_exclude` filter.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-08-30 17:28:05 -04:00
Daniel Leung ac7e679ae5 tests: log_stack: increase stack size for x86 and immediate mode
Stack usage has increased for immediate mode on x86, so increase
the threshold for stack size.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-08-30 12:49:31 +02:00
Stephanos Ioannidis 8e8b56881f tests: log_core_additional: Disable log_user test for Zephyr SDK
This commit disables the `logging.add.log_user` test when building with
the Zephyr SDK because it fails for all emulate-able platforms at
run-time.

Revert this commit when the GitHub issue #49213, which tracks this bug,
is fixed.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-08-29 16:57:18 +02:00
li biao 7e9b3a9744 tests: subsys: logging: move log_backend_init to new ztest API
Fix missing to https://github.com/zephyrproject-rtos/zephyr/issues/49004

Signed-off-by: li biao <biao1x.li@intel.com>
2022-08-25 21:04:58 +00:00
li biao edf3fe8a64 tests: subsys: logging: move log_backend_init to new ztest API
Move test subsys/logging/log_backend_init to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-08-25 21:04:58 +00:00
li biao 2a457b5ecf tests: subsys: logging: move log_syst to new ztest API
Move test subsys/logging/log_syst to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-08-23 19:27:51 +00:00
Shaoan Li dd69eede43 tests: subsys: logging: move log_core_additional to new ztest API
Move test subsys/logging/log_core_additional to use new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-08-22 10:23:10 +02:00
Shaoan Li e408c45546 test: subsys: logging move log_benchmark to new ztest API
Move test subsys/logging/log_benchmark to use new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-08-11 17:46:24 +02:00
li biao 97adecd713 tests: subsys: logging: move log_switch_format to new ztest API
Move test subsys/logging/log_switch_format to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-08-11 12:20:26 +02:00
Shaoan Li 414d98f767 tests: subsys: logging: move log_backend_fs to new ztest API
Move test subsys/logging/log_backend_fs to use new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-08-11 12:17:19 +02:00
li biao 8bc0b2263f tests: subsys: logging: move log_immediate to new ztest API
Move test subsys/logging/log_immediate to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-08-11 12:17:14 +02:00
li biao 0ee00080d9 tests: subsys: logging: move log_msg to new ztest API
Move test subsys/logging/log_msg to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-08-11 12:17:08 +02:00
Fabio Baltieri def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Krzysztof Chruscinski 7dfe995aa0 tests: logging: log_switch_format: Disable standard backends
In order to avoid impacting test configuration and execution
disable default logging backends.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-26 16:07:37 -04:00
Fabio Baltieri 702b684366 tests: log_api: increase stack size for the test
CONFIG_MAIN_STACK_SIZE was increased for qemu_leon3, but after

15fdee04e3 logging: log_output: Add function for processing input arguments

this test started to fail on other platforms as well. Moving the stack
size override on the test wide prj.conf seems to make it work correctly
again.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-07-22 10:33:56 +02:00
Krzysztof Chruscinski 75c6a9050a tests: logging: log_stack: Adjust thresholds
Adjust thresholds after updates in log_output.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-21 09:04:37 -04:00
Krzysztof Chruscinski a0e79710a0 tests: logging: log_output: Improve test coverage
Improve test coverage for log_output module.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-21 09:04:37 -04:00
Krzysztof Chruscinski 63c071a713 tests: logging: log_stack: Adjust thresholds
Adjust threshold.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-21 09:04:37 -04:00
Tomislav Milkovic 0fe2c1fe90 everywhere: Fix legacy include paths
Any project with Kconfig option CONFIG_LEGACY_INCLUDE_PATH set to n
couldn't be built because some files were missing zephyr/ prefix in
includes
Re-run the migrate_includes.py script to fix all legacy include paths

Signed-off-by: Tomislav Milkovic <milkovic@byte-lab.com>
2022-07-18 16:16:47 +00:00
Anas Nashif d0be1de99e tests: logging: disable logging stack test
This test keeps breaking whenever something in kernel or
architecture code changes. If we are to track footprint and stack, it
should be done in some other way.
The value of the test deminished if we have to change the boundaries
every second day.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-12 22:46:05 -04:00
Daniel Leung ff54de3e16 tests: logging/log_api: add bits to test backend events
This adds a few bits to the log_api tests to test backend
event notifications.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-07-11 11:09:31 +02:00
Aastha Grover 94902bf542 tests: log_switch_format: Add mock backend and remove harness console
Add mock backend to support validating the output logs when
switching the log format at runtime. This removes the need to use
harness console when ztest framework is in use.

Fixes #47077

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-07-08 20:10:42 +00:00
Carles Cufi fb9ca7c392 tests: log: stress: Adapt to logging API changes
This test was merged before having re-run CI, and some logging API
changes had happened since CI was last run.
Adapt to those to fix the build.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-07-04 17:59:34 +02:00
Krzysztof Chruscinski e4bd0fceef logging: Allow for compilation without log_output
Add option to Kconfig to enable log_output module. It is used
by most of the backends but it is an optional formatter helper
thus it is possible to run logging without it. One example might
be dictionary based logging which does not format log message
to a readable string.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-04 16:43:32 +02:00
Krzysztof Chruscinski 1125e39797 tests: logging: Add stress test
Add stress test for logging to validate that logging is coherent:
All message are processed by the logger or dropped and no message
is lost.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-04 15:50:53 +02:00
Krzysztof Chruscinski e4bfec8100 logging: Use spin lock
Updated log_core to use spin lock instead of irq_lock.
Refactored z_log_msg_post_finalize function.

Update thresholds in the log_stack test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-04 15:50:53 +02:00
Krzysztof Chruscinski 3bcd14f420 logging: Reduce code size for frontend only case
Add early returns from functions which are not used when
there is only one frontend in the system (no backends). This
allows to significantly reduce logging code size in that
configuration.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-02 14:13:54 +02:00
Ryan Erickson fb34a9749f logging: add log_source_id_get
Add API to get the logging module source ID from the
module name;

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-07-01 16:30:30 +02:00
Keith Packard 305068a3bc tests/logging: Give picolibc lots of margin for now
We're not quite sure how much extra stack space picolibc will use, so
give it plenty of space for now.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-30 10:33:24 +02:00
Daniel Leung 3efce4c939 Revert "tests: logging: log_api: Add cast to char array"
This reverts commit 265394e30e.

The underlying cause is fixed so reverting this...

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-06-30 14:03:45 +09:00
Krzysztof Chruscinski 9833ca61c9 logging: Removing v2 suffix from logging names
Renaming objects which had 2 in the name to indicate that
it is v2 specific. Once logging v1 has been removed such
suffixes are redundant.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 15:46:37 -04:00
Krzysztof Chruscinski 265394e30e tests: logging: log_api: Add cast to char array
Tagged arguments feature fails to correctly tag a char array in
C++ configuration. Temporarily casting to char pointer to make
the test pass.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 13:42:23 +02:00