Commit Graph

291 Commits

Author SHA1 Message Date
Yuval Peress 86cadf9283 ztest: Fix userspace ztests in new API
Update the new API to use K_USER as the flags for both
CONFIG_USERSPACE and CONFIG_TEST_USERSPACE. Also, fix the linker
script to properly include the suites, tests, and rules.

Fixes #44108

Signed-off-by: Yuval Peress <peress@google.com>
2022-05-25 11:20:13 +09:00
Keith Packard 7955624d1f tests/benchmarks/sys_kernel: Use K_THREAD_STACK_EXTERN in header file
K_THREAD_STACK_DEFINE is not correct in a header file as it may conflict
with K_THREAD_STACK_DEFINE usage in the source file.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-05-10 13:55:24 -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
Stephanos Ioannidis 6a35a793b5 tests: cmsis_dsp: Add mps3_an547 as integration platform for FPU tests
This commit adds the `mps3_an547` board, a Cortex-M55 platform, as an
integration platform for all CMSIS-DSP FPU test cases so that the
M-Profile Vector Extension (MVE) vector function implementations are
tested in the CI.

With this change the FPU-enabled test coverage is as follows:

* mps2_an521_remote (Cortex-M33) tests FPU/DSP-enabled scalar function
  implementations.

* mps3_an547 (Cortex-M55) tests FPU/DSP-enabled MVE vector function
  implementations.

This also has a side effect of comprehensively exercising the M-Profile
Vector Extension support in the ARM architecture port, thereby ensuring
the arch-level FPU/DSP/MVE support is not broken.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Stephanos Ioannidis 5790c5923f Revert "tests: lib: cmsis_dsp: Disable testing on mps3_an547"
This reverts commit 96c7f6ab75.

Zephyr SDK 0.14.1 now includes QEMU 6.2, which supports the emulation
of the MVE instructions.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Keith Packard 6f9f8c1e32 samples, tests: Add z_libc_partition to all test domains
When a memory domain is initialized, the z_libc_partition must be
included so that critical libc-related data can be accessed.

On ARM processors without TPIDRURO when THREAD_LOCAL_STORAGE is enabled,
this includes the TLS base pointer, which is used for several
thread-local variables in the kernel.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-04-28 11:09:01 +09:00
Katarzyna Giadla 681e3a16c7 tests: Change duplicated names of the test cases
Some names of the test cases are duplicated within the project.
This commit contains the proposed names of the test scenarios.

Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
2022-03-30 17:42:01 -04:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Gerard Marull-Paretas 7746abdc39 soc: arm: microchip_mec: mec1501: remove SOC_POWER_MANAGEMENT
Remove a redundant symbol that was used as a proxy to enable CONFIG_PM.
If an application needs to enable PM, it should just enable PM subsystem
Kconfig options. Furthermore, there's no clue "SOC_POWER_MANAGEMENT" is
a Microchip specific option.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-04 09:05:45 -06:00
Bradley Bolen c0dd594d4d arch: arm: aarch32: Change CPU_CORTEX_R kconfig option
Change the CPU_CORTEX_R kconfig option to CPU_AARCH32_CORTEX_R to
distinguish the armv7 version from the armv8 version of Cortex-R.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2022-02-23 08:14:15 -06:00
Carles Cufi e83a13aabf kconfig: Rename the TEST_EXTRA stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Gerard Marull-Paretas ddc168fa78 pm: s/PM_DEVICE_(DT_(INST))_REF/PM_DEVICE_(DT_(INST))_GET
In order to align with macros used to obtain a device reference (e.g.
DEVICE_DT_GET), align the PM macros to use "GET" instead of "REF". This
change should have low impact since no official release has gone out yet
with the "REF" macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-18 12:14:06 -05:00
Daniel Leung 8f7f62869a tests: remove @return doc for void functions
For functions returning nothing, there is no need to document
with @return, as Doxgen complains about "documented empty
return type of ...".

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-12 16:02:16 -05:00
Enjia Mai e8119640c0 tests: benchmark: fix code coverage incorrect for latency_measure
Fixing code coverage data cannot be generated correctly when running
tests/benchmark/latency_measure test suite. This is because the gcov
data do not generate completely when the measuring thread stop. So
our solution is:

In main(), just waiting for the measuring thread to complete before
the gcov data start to dump out, to make sure all the gcov data can
be output completely.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-01-04 11:53:17 -05:00
Daniel Leung 81882fe7b8 tests: latency_measure: remove qemu_x86_64 exclusion
The latency measure test can run on qemu_x86_64 so remove it
from the platform_exclude list.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-24 14:16:13 -05:00
Daniel Leung fb91ce2e21 kernel: mem_domain: init function to return error values
This changes k_mem_domain_init() to return error values
instead of asserting when errors are encountered.
This gives applications a chance to recover if needed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-22 12:45:22 -05:00
Gerard Marull-Paretas 39f21dc116 tests: pm: use new PM macros
Use PM_DEVICE_STATE_DEFINE to define PM state.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-19 10:11:32 +01:00
Pavel Hübner 104714394f kernel: Introduce K_MEM_SLAB_DEFINE_STATIC
As the already existing macro K_MEM_SLAB_DEFINE results in
two variable definitions, the preceding static modifier leads to
a seemingly working solution, though linkage conflicts will occur
when the same memory slab name is used across multiple modules.

The new K_MEM_SLAB_DEFINE_STATIC macro duplicates the functionality of
K_MEM_SLAB_DEFINE with the difference that the static keywords are
internally prepended before both variable definitions.

The implementation has been tested on my Zephyr project (the build
issue faded out). The documentation has been updated altogether
with all incorrect occurences of static K_MEM_SLAB_DEFINE.

Signed-off-by: Pavel Hübner <pavel.hubner@hardwario.com>
2021-11-07 05:36:48 -05:00
Gerard Marull-Paretas 18519ffe8d tests: use common PM action callback naming
The PM callback is no longer referenced as "pm_control" but
"pm_action_cb", so reflect this new naming on the callbacks.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-03 20:27:18 -04:00
Gerard Marull-Paretas 1cee284a46 pm: device: runtime: use pm_device_runtime* namespace
Move all PM device runtime API calls from pm_device* to the
pm_device_runtime* namespace.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-03 16:37:33 -04:00
Yuval Peress 63873a179a tests: basicmath: Migrate to new ztest register functionality
Simplify the running and creation of the basicmath benchmark suites.
Using the ztest register functionality, each benchmark registers and
is run from a single call in main.c.

Signed-off-by: Yuval Peress <peress@chromium.org>
2021-10-28 16:57:51 -04:00
Keith Short 031ff08bc6 tests: benchmark: Add power management to footprint
Add a build-only test to track footprint when enabling device power
management.

Signed-off-by: Keith Short <keithshort@google.com>
2021-10-26 19:44:15 -04:00
Flavio Ceolin e6fa658a57 tests: mbedtls: Follow changes in mbedTLS 3.0 version
Apply the modifications required by the newer library version.
These modifications came from the original file in the mbedTLS
repository.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-10-07 14:02:40 -05:00
Chen Peng1 47670d1ba6 tests: benchmarks: latency_measure: fix potential div by zero
If the count is zero in the heap_malloc_free test, a div by zero
would happen, so add a condition to handle this potential error.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2021-09-08 10:28:58 -04:00
Stephanos Ioannidis 96c7f6ab75 tests: lib: cmsis_dsp: Disable testing on mps3_an547
This commit disables running the CMSIS-DSP tests on the mps3_an547
board because the QEMU, which is default emulation platform for it,
does not currently support the emulation of the MVE instructions.

Refer to the issue #37694 for more details.

Revert this commit once QEMU 6.2 is released and integrated into the
Zephyr SDK.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-30 18:17:47 +02:00
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Stephanos Ioannidis 05fc928a3f tests: benchmark: cmsis_dsp: basicmath: Enable FPU testing
This commit adds a new testcase for the CMSIS-DSP basicmath benchmark
that enables testing with hardware FPU.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-17 16:41:55 -05:00
Chen Peng1 b676e6a628 tests/benchmarks: add dynamic memory allocation measurement
add a test into latency_measure test case to measure
the average time for dynamic memory allocation and release.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2021-07-21 10:16:56 +03:00
Anas Nashif 11b8dd85b9 boards: minnowboard: remove untested and old board
Remove minnowboard configuration which is very basic and can be brought
back by just taking another X86 configuration. We have not tested this
board for a while and it is not being used actively, so remove it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-06-01 14:06:56 -05:00
David Brown 22360ee323 tests: benchmarks: mbedtls: Support legacy API
The contents of mbedtls_ecdh_context have changed in newer versions of
the library.  For now, we can work with the old version by adding a
configuration define.  It is unclear how long this will continue to
work.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-05-09 09:59:22 -05:00
Anas Nashif 3b00571160 tests: benchmarks: record benchmark results
Record benchmark results into a CSV file that can be used for tracking.
The data will be available in recording.csv in the build directory.

For example:

cat recording.csv

metric,cycles,nanoseconds
Average thread context switch using yield,11654,11654
Average context switch time between threads (coop),21149,21149
Switch from ISR back to interrupted thread,4928,4927
Time from ISR to executing a different thread,3872,3871
Time to create a thread (without start),4224,4223
Time to start a thread,10784,10783
Time to suspend a thread,10400,10399
Time to resume a thread,10688,10687
Time to abort a thread (not running),1536,1535
Average semaphore signal time,3424,3424
Average semaphore test time,1344,1344
Semaphore take time (context switch),12736,12735
Semaphore give time (context switch),17568,17567
Average time to lock a mutex,1632,1632
Average time to unlock a mutex,4738,4738

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-07 23:48:28 -04:00
Jennifer Williams 502d7bd116 tests: benchmarks: remove obsolete boot_time test suite
This test for boot time was sufficient when it was originally
introduced, but is no longer appropriate as the code and
ecosystem grew.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-05-05 10:41:15 -04:00
Anas Nashif 80116f1413 tests: benchmarks: footprints: this is not a test
Do not configure this as a test, this will change footprint drastically
and will skew results and tracking.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-27 12:15:14 -04:00
David Leach 1a969a026d tests: benchmarks: mbedtls: Conversion of k_work API
Replace all existing deprecated API with the recommended alternative.

Fixes #34107

Signed-off-by: David Leach <david.leach@nxp.com>
2021-04-21 09:39:24 -04:00
Daniel Leung e3ca3a0930 tests: benchmarks/footprints: update to new kwork API
This updates the footprints app to use the new kwork API.

Fixes #34104

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-04-08 02:48:16 -04:00
Anas Nashif 76f35f29f0 tests: benchmarks: increase timeout
This times out on some platforms, increase timeout a bit to allow slow
platforms to complete.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-22 21:39:53 -04:00
Anas Nashif fe0872c0ab clocks: rename z_tick_get -> sys_clock_tick_get
Do not use z_ for internal APIs, z_ is for private APIs within one
subsystem only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-19 11:22:17 -04:00
Ioannis Glaropoulos a31bd1539d tests: add missing CONFIG_TEST=y in test suites
In several test suites CONFIG_TEST was missing.
Define CONFIG_TEST=y, so testing-related Kconfig
options (depending on TEST) get switched-on.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-17 17:48:20 -04:00
Peter Bigot 692bac22f5 tests: footprint: fix thread start races
The test granted access to the user work queue stack from the user
work thread; this was done by k_work_user_queue_start() so was
unnecessary.  Document why it's ok to grant other access after the
work thread was started.

Fix a race condition where the non-work user thread might have started
before it was given access to the resources it needs.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-03-08 12:09:16 -05:00
Peter Bigot 4e3b92609b kernel: provide functional equivalent to old userspace work queue API
The new API cannot be used from userspace because it is not merely a
wrapper around existing userspace-capable objects (threads and
queues), but instead requires much more complex and lower-level access
to memory that can't be touched from userspace.  The vast majority of
work queue users are operating from privileged mode, so there's little
motivation to go through the pain and complexity of converting all
functions to system calls.

Copy the necessary pieces of the existing userspace work queue API out
and expose them with new names and types:

* k_work_handler_t becomes k_work_user_handler_t
* k_work becomes k_work_user
* k_work_q becomes k_work_user_q

etc.  Because the replacement API cannot use the same types new API
names are also introduced to make it more clear that the userspace
work queue API is a separate functionality.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-03-03 20:06:00 -05:00
Daniel Leung ce44048d46 x86: rename CONFIG_SSE* to CONFIG_X86_SSE*
This adds X86 keyword to the kconfigs to indicate these are
for x86. The old options are still there marked as
deprecated.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-15 08:21:15 -05:00
Daniel Leung 29cf9d879d tests: benchmarks/app_kernel: enable for floating point
The app_kernel benchmarking app has the config file for benchmarking
with floating point enabled, but it was never used. So add it
to the testcase.yaml.

Note that this also limits to run on one CPU on a SMP system as
the resulting numbers would be more consistent among runs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-15 08:21:15 -05:00
Adam Jeliński 9919c14175 m2gl025_miv: Double the test timeouts
The `m2gl025_miv` board needs more time to complete these tests with
Renode.

Signed-off-by: Adam Jeliński <ajelinski@antmicro.com>
2021-02-09 19:41:27 -05:00
Krzysztof Chruscinski 7f08061f0c logging: Revamp menuconfig
Clean up logging menuconfig by grouping configuration into
sections like: mode, processing configuration, backends.

Additionlly, removed LOG_ENABLE_FANCY_OUTPUT_FORMATTING which is no
longer in use.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-01-26 06:15:42 -05:00
Martin Åberg 9e463d023f benchmarks: app_kernel: limits to 1 CPU
The app_kernel test hangs or crashes on qemu_x86_64 when more than
one CPU is enabled. So limits the number of CPUs to 1 even when SMP
is enabled.

This issue has probably been masked for some time because the test
was previously marked as being "slow".

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2021-01-15 13:06:33 -05:00
Martin Åberg 4604c45541 tests: enable and run many tests on RISC-V
This commit enables lots of tests on riscv32 and riscv64 which were
previously disabled.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2021-01-15 13:06:33 -05:00
Hake Huang 2263462aee test: resude sys_kernel loops in small ram
need ram up to 36M for twr_ke18f so reduce the loops

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-01-13 07:38:07 -05:00
Aastha Grover b644432720 boards: x86: acrn : Add configurations for acrn_ehl_crb
Adding acrn configurations specific to the platform
on which acrn boots zephyr, Only the EHL specifc
configurations for now. Keeping the HW clock frequency to
1900Mhz for EHL and using the new APIc timer driver.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2021-01-11 16:11:59 -05:00
Daniel Leung c6253fbe1a tests: latency_measure: fix mis-matched timing start/stop calls
Inside the semaphore tests, there are mis-matched pair of timing
start/stop calls. One called start without calling stop, another
one calling stop twice. So fix them.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-01-04 12:15:30 +01:00
Watson Zeng 7a3f9c4e39 tests: add filter for some tests using newlib
some tests configured with CONFIG_NEWLIB_LIBC=y,
it's better to add a filter filter: TOOLCHAIN_HAS_NEWLIB == 1
in those tests yaml file.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-12-16 08:57:40 -05:00