Commit Graph

200 Commits

Author SHA1 Message Date
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
Krzysztof Chruscinski
041f0e5379 all: logging: Remove log_strdup function
Logging v1 has been removed and log_strdup wrapper function is no
longer needed. Removing the function and its use in the tree.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 13:42:23 +02:00
Aastha Grover
d81b3d7425 tests/subsys/logging/log_switch_format: fix incomplete logs
log_Switch_format test has incomplete handler logs on frdm_k64f
and also a false positive for logging.log_switch_format.immediate
testcase due to harness console which does not wait for
completion of ztest testcases to indicate pass/fail status to twister.

Fixes #46368

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-06-23 09:15:39 +02:00
Krzysztof Chruscinski
7f1b4f88e3 logging: Rename files and test from log_msg2 to log_msg
Renaming log_msg2 files to log_msg.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 09:10:33 +02:00
Keith Packard
d5167e1507 tests/log_stack: Increase stack usage for x86_64
The amount of stack used has changed for some reason (toolchain updates?),
use the amounts reported by the test when it failed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-22 13:15:55 +02:00
Flavio Ceolin
8df552fb06 tests: log_immediate: Increase tests timeout
Slightly increase timeout for these tests since it is often failing in
xtensa simulator.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-06-16 16:01:41 -04:00
Krzysztof Chruscinski
c5f2cdef09 logging: Remove logging v1 from the logging
Remove v1 implementation from log_core and all references in the tree.
Remove modules used by v1: log_list and log_msg.
Remove Kconfig v1 specific options.
Remove Kconfig flags used for distinction between v1 and v2.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-16 10:51:15 -04:00
Krzysztof Chruscinski
abc690cbe7 tests: logging: log_syst: Remove reference to logging v1
Remove references to CONFIG_LOG1 and CONFIG_LOG2 macros.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
e37afb4772 tests: logging: Remove log_msg test suite
Removing the suite for log_msg v1 as part of logging v1 removal.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
c60d5ff565 tests: logging: Remove log_list test suite
Log_list module is used by the logging v1. Removing
the suite as part of logging v1 removal.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
69d3337349 tests: logging: log_core_additional: Remove v1 support
Remove testing of v1 from the test suite.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
076ad119ae tests: logging: Remove log_core test suite
Test suite was only for logging v1 which is now being removed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
0d2f33cae8 tests: logging: log_benchmark: Remove v1 support
Remove support for logging v1 from the test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
61532e93b4 tests: logging: log_api: Remove v1 support
Remove support for logging v1 from the test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
0e1d86c6bb tests: logging: log_stack: Adjust thresholds
Adjust tresholds for multiple platforms.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-09 14:32:39 +02:00
Krzysztof Chruscinski
23c3449780 tests: logging: Add test for log backend prolong init
Add test for handling of autostarting backends which have
prolonged initialization and implements function for polling
for readiness.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-09 09:40:01 +02:00
Daniel Leung
68684f7310 tests: log_api: exclude XCC from runtime tagged argument tests
XCC does not support _Generic so it can't build the runtime tagged
argument tests. So exclude them.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-06-08 09:31:42 -04:00
Daniel Leung
8f97e25645 tests: logging/log_api: add a few bits for tagged arguments
This adds a few bits to support testing for runtime tagged arguments
when CONFIG_LOG2_RUNTIME_USE_TAGGED_ARGUMENTS is enabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-06-08 00:15:55 +09:00
Daniel Leung
aff6e8b2f7 lib: os: cbprint: enable tagged arguments for packaging
This adds some bits to support tagged arguments to be used for
packaging. If enabled, the packaging function no longer looks at
the format strings to determine the types of arguments, but
instead, each argument is tagged with a type by preceding it
with another argument as type (integer). This allows the format
strings to be removed from the final binary to conserve space.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-06-08 00:15:55 +09:00
Aastha Grover
1c1748d579 tests: add testcases for dynamic switching logging formats.
Adding testcases for switching of logging formats at runtime.
Includes testing for log_backend_format_set,
log_format_set_all_active_backends & log_format_func_t_get
routines.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-06-05 14:49:01 +02:00
Guo Lixin
fe7858bba1 tests: remove unused harness config
logging.log_syst.mipi_syst is written in ztest framework, now it has
a good method to test automatically, no need to configure the harness
as console any more, so remove it.

Signed-off-by: Guo Lixin <lixinx.guo@intel.com>
2022-06-05 14:44:35 +02:00
Fabio Baltieri
e24314f10f include: add more missing zephyr/ prefixes
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-27 15:20:27 -07:00
Daniel Leung
b5509cb234 tests: log_api: workaround QEMU crashing on qemu_leon3
When running twister during logging.log2_api_immediate_printk_cpp
on qemu_leon3, it reports unexpected eof even though the tests
reported successful. This results in twister reporting the test
being failed due to "unexpected eof".

When running it using west build, QEMU quits immediately after
printing PROJECT EXECUTION SUCCESSFUL instead of simply waiting
there for Ctrl-A X.

So workaround this by changing the main stack size to 4096.

Related to #46056

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-05-27 11:45:58 -07:00
Anas Nashif
a6f924db7f twister: add support for platform_type filter
Instead of relying on runtime filter to limit scope to emulation
platforms, use the type attribute for each platform and do the filtering
very early on. This will speed things up for tests where we only run on
emulation platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-14 14:49:59 -04:00
Anas Nashif
8faca29fea tests/samples: fix usage of integration_platforms
integration platforms can't be filtered out, adapt tests so that those
platforms are always available for testing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-14 14:49:59 -04:00
Anas Nashif
936c88e066 tests: logging: define testcases
Define testcases in yaml to workaround inconsistencies in parsing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00