Commit Graph

16 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Gerard Marull-Paretas ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Krzysztof Chruscinski 64ac44ad10 tests: logging: log_stack: Align stack usage
Align stack usage threshold for x86 after changes in cbprintf.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-05-04 18:56:55 -04:00
Krzysztof Chruscinski f538136941 tests: logging: log_stack: Align stack usage limits
Align stack usage limits for riscv platforms.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-14 08:32:31 -04:00
Krzysztof Chruscinski b98f8e39fa logging: Adapt logging to use new cbprintf feature
Adapt logging to always use static packaging. Runtime packaging
is used only when configuration requires that. Static packaging
significantly speeds up logging when there are string arguments.

Update log_stack test to new stack usage.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-30 16:16:40 -04:00
Nicolas Pitre ce8dabfe9e riscv: implement arch_switch()
The move to arch_switch() is a prerequisite for SMP support.

Make it optimal without the need for an ECALL roundtrip on every
context switch. Performance numbers from tests/benchmarks/sched:

Before:
unpend  107 ready  102 switch  188 pend  218 tot  615 (avg  615)

After:
unpend  107 ready  102 switch  170 pend  217 tot  596 (avg  595)

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-03-21 07:28:05 -04:00
Krzysztof Chruscinski 89a3b4eee0 tests: logging: log_stack: Align stack usage numbers
Align stack usage for riscv64 smp case.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-14 10:53:40 -04:00
Anas Nashif 145bcd7ab9 tests: log_stack: define for riscv smp
Define stacks for riscv smp configurations.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-26 10:08:46 -05:00
Krzysztof Chruscinski fcb32090ea tests: logging: log_stack: Adjust log stack limits for SPARC
Recent changes c0d7e10 increased stack usage for SPARC platform.
Adjusting values for immediate mode.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-24 08:51:26 -08:00
Krzysztof Chruscinski 3e551d658c tests: logging: log_stack: Fix Kconfig option
Renaming:
- CONFIG_TEST_EXTRA_STACKSIZE -> CONFIG_TEST_EXTRA_STACK_SIZE
- CONFIG_ZTEST_STACKSIZE -> CONFIG_ZTEST_STACK_SIZE

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 09:09:24 -05:00
Krzysztof Chruscinski a43d41483b tests: logging: Add test for stack usage characterization
Added test which estimates stack usage of few types of logging
messages in various modes, with and without optimization. Test
was used to determine usage for various architectures and is expected
to be used to detect stack usage increase since it fails when
stack usage in given configuration goes beyond the hardcoded limit.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00