Commit graph

355 commits

Author SHA1 Message Date
Peter Mitsis 4e426fbfa1 tests: app_kernel: extend msgq test
Extends the msgq benchmark test to obtain data for larger message
queues (messages of size 192 bytes). This allows for a better
indication of what the impact of data size is on message queue
performance.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis fa33147bf9 tests: app_kernel: Add user support
Add user thread support to message queue, semaphore, mutex and
pipe tests. Mailbox and memory map tests are restricted from
executing from user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis f9cf48313b tests: app_kernel: Add custom syscalls
Adds two custom syscalls. The first allows a user thread to
change its priority to a higher priority level. The second
is used to obtain a timestamp from a user thread.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis bf2ab9be60 tests: app_kernel: Add bench_mem_partition
Adds macros for placing variables into bench_mem_partition.
This partition will be used to place global data in the test
that will need to be accessed from user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 5479090c91 tests: app_kernel: Use dynamic threads
Use dynamic threads instead of statically defined threads. This will
make it easier to add support for user threads to this test.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 3234145669 tests: app_kernel: Rename fifo to msgq
Changed references of fifo to msgq as the fifo name was a remnant
of the old microkernel.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 77cedbf630 tests: app_kernel: Simplify benchmark control loop
Eliminates the loop surrounding the execution of the benchmark
components as it was not doing anything.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 8d663558d6 tests: app_kernel: Remove FP configurations
As nothing in the app_kernel uses floating point, there is no
reason to enable it.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 56011222a4 tests: app_kernel: Remove unused symbols
Begin cleaning the the app_kernel benchmark project by removing
unused symbols.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 6899c0d73a tests: latency_measure: Misc updates
Adds userspace configuration to testcase.yaml.

Updates the README.rst with output from runs on a frdm_k64f board
as not only have the descriptions changed, but there is now
additional output for userspace configurations.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 1a7e5c6c8d tests: latency_measure: Use syscall to get timestamp
Many architectures and platforms can not directly read a timestamp
from userspace as the relevant MMIO registers are inaccessible.
This necessitates that the timestamp be obtained by a system call.

The additional overhead from these system calls can be taken into
account and the recorded times adjusted depending upon whether
the test occurred entirely within kernel space, entirely within
user space, or a mix between the two.

It is worth noting that when the test requires a mix of both user
and kernel space threads, the overhead is estimated as the mean
average of purely kernel threads and purely user threads overhead
times. This might not be technically correct, but it ought to
provide a reasonable enough approximation.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 9b38aec366 tests: latency_measure: Update mutexes
Updates the mutex benchmark tests to support user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 4c4453d697 tests: latency_measure: Update semaphores
Updates the semaphore benchmarking in the latency_benchmark code
to support user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 13ac14f2bb tests: latency_measure: Update thread ops
Update the thread ops (create/start/suspend/resume/abort) to include
support for userspace.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 4e7bb482b1 tests: latency_measure: Update interrupt latency
Updates the interrupt to thread benchmark tests to address
a number of items.
  1. Updates descriptions to correctly indicate that it is not
     interrupt latency being measured, but the time to leave
     the interrupt and return to a thread.
  2. Repeats the test numerous times instead of just once to
     get an average.
  3. Overhead from obtaining timestamps is now accounted for.
  4. Adds support for returning to a user thread.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 8c80bbb96e tests: latency_measure: Update context switch
Updates both the preemptive and cooperative thread context switch
benchmark tests so that not only will they share the same
infrastructure, but they can both get the context switch times
when switching from ...
  1. Kernel thread to kernel thread
  2. Kernel thread to user thread
  3. User thread to kernel thread
  4. User thread to user thread

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Benedikt Schmidt aa25e212d1 tests: fix thread function signatures
Fix thread function signatures to avoid stack corruption on thread exit.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 12:24:34 +01:00
Keith Packard 565c9376f1 tests: Switch from NEWLIB_LIBC to REQUIRES_FULL_LIBC
Instead of forcing use of NEWLIB_LIBC, select any available complete C
library implementation. Add CONFIG_REQUIRES_FLOAT_PRINTF where needed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-25 08:32:06 +02:00
Alberto Escolar Piedras df15fcb9fb tests/benchmarks/cmsis_dsp/basicmath: Filter by arch
Add a filter by (arm) architecture, as the filter as it is faster
than filtering by kconfig.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Alberto Escolar Piedras befc96f22e userspace tests/samples: Exclude in posix arch
These samples & tests cannot be run in this architecture
as it does not support userspace.
Today they are filtered by kconfig, which works but spends
time running cmake.
As native_posix is a default test platform it is better
to filter it alltogether by arch, which saves quite a lot
of time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Anas Nashif 345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Peter Mitsis 36defb4287 tests: Update sys_kernel benchmark
This updates the sys_kernel benchmark project to replace references to
the defunct TICKS_NONE symbol with K_NO_WAIT. It also removes the
outdated build instructions from the README.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-17 21:48:51 +03:00
Peter Mitsis b43d0ed2ee tests: Update app_kernel README
Removes stale information from the app_kernel benchmark's README.txt
file.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-17 21:48:51 +03:00
Flavio Ceolin e7bd10ae71 random: Rename random header
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.

Rename it to random.h and get consistently with other
subsystems.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-10 14:23:50 +03:00
Ryan McClelland 104ea2ccca modules: cmsis-dsp: add cmsis-dsp module
Use CMSIS-DSP from its new realm. This also changes change how you
initialize FFT tables as well to use arm_cfft_init_64_f32 if you
know the FFT size in advance rather than the generic initialization
arm_cfft_init_f32.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-09-25 09:46:33 +02:00
Gerard Marull-Paretas ee0f8d8381 tests: benchmarks: footprints: use POST_KERNEL level
Because APPLICATION is going to be removed for devices.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-15 16:04:19 +02:00
Anas Nashif 8634c3b444 kernel: move wait_q.h header to be internal
This header does not expose any public APIs, so move it under
kernel/include and change files including it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-12 12:55:36 -04:00
Carles Cufi 8c748fd005 kernel: Modify the signature of k_mem_slab_free()
Modify the signature of the k_mem_slab_free() function with a new one,
replacing the old void **mem with void *mem as a parameter.

The following function:
void k_mem_slab_free(struct k_mem_slab *slab, void **mem);

has the wrong signature. mem is only used as a regular pointer, so there
is no need to use a double-pointer. The correct signature should be:
void k_mem_slab_free(struct k_mem_slab *slab, void *mem);

The issue with the current signature, although functional, is that it is
extremely confusing. I myself, a veteran Zephyr developer, was confused
by this parameter when looking at it recently.

All in-tree uses of the function have been adapted.

Fixes #61888.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-09-03 18:20:59 -04:00
Gerard Marull-Paretas 9c961571a2 modules: cmsis: move glue code to modules/cmsis
The CMSIS module glue code was part of arch/ directory. Move it to
modules/cmsis, and provide a single entry point for it: cmsis_core.h.
This entry header will include the right CMSIS header (M or A/R).

To make this change possible, CMSIS module Kconfig/CMake are declared as
external, allowing us to add a new Zephyr include directory.

All files including CMSIS have been updated.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-08-24 13:20:21 +02:00
Peter Mitsis 589e315dd3 tests: Fix app_kernel benchmark to run on cavs25
Instead of sending output strings to stdout via fputs(), just
print them using printk(). This allows the output to be detected
by twister.

Fixes #60676

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-08-14 18:13:00 +00:00
Daniel Leung ddf17df40a tests: benchmark: rename shadow variables
This renames shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Peter Mitsis aa4f24694e test: Enhance benchmark latency reporting
Enhances the reporting of the benchmark latency failures in the
following ways:

1. The failing test is now clearly identified
2. Failures follow the general reporting pattern

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-07-19 17:51:36 -04:00
Peter Mitsis fe922d30f9 test: refactor benchmark latency PRINT_F() macro
Reduces the stack usage. Also separates the formatting of both the
cycle and nsec printing by pre-printing them to string.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-07-19 17:51:36 -04:00
Peter Mitsis 5c93b92a77 test: benchmark latency macro parameter names
Changes the names of parameters to the PRINT_STATS() and
PRINT_STATS_AVG() macros to be something more meaningful.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-07-19 17:51:36 -04:00
Anas Nashif b835b02136 tests: cleanup metadata and filtering
- Add integration_platforms to avoid excessive filtering
- Make sure integration platforms are actually part of the filter
- Fix some tags and test meta data

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-13 09:38:27 -04:00
Anas Nashif 1a526a63c7 tests: ignore benchmark on some qemu platforms
Do not run benchmarks on some special qemu platforms. Those were
previously ignored, but due to tag changes, they started running again.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-05 20:53:02 -04:00
Anas Nashif db4a5f11ea tests: add kernel tag to all benchmarks and samples
All those benchmarks are kernel related, so add the kernel tag to avoid
building them when non kernel changes are being submitted.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-02 04:47:06 -04:00
Anas Nashif 04827ba71f tests/samples: use integration_platforms more where it makes sense
Use integration platforms to limit churn and build time in PR CI .

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-05-26 17:52:02 -04:00
Gerard Marull-Paretas 93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Gerard Marull-Paretas 1eb683a514 device: remove redundant init functions
Remove all init functions that do nothing, and provide a `NULL` to
*DEVICE*DEFINE* macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-19 10:00:25 +02:00
Keith Packard 0b90fd5adf samples, tests, boards: Switch main return type from void to int
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.

Most of these changes were automated using coccinelle with the following
script:

@@
@@
- void
+ int
main(...) {
	...
-	return;
+	return 0;
	...
}

Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Filip Kokosinski 491f27455e tests: mark testcases with pm where CONFIG_PM=y is forced
This commit marks testcases that require working Power Managament with
the appropriate `pm` tag to allow proper testcase filtering in the board
YAML file.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2023-04-04 13:34:45 +02:00
Kumar Gala d31814e990 tests: Fix floating point test variants on x86 w/LLVM
LLVM doesn't support SSE + 387 math.  As such if SSE is enabled we
have to utilize SSE floating point.  To utilize 387 math, SSE has
to be disabled.

Update the floating point related tests to introduce 387 only variants
that will build on both GCC & LLVM based tools.  Than we exclude llvm
based (llvm, oneApi) toolchains from the CONFIG_X86_SSE_FP_MATH=n and
CONFIG_X86_SSE=y test variants.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-02-21 08:25:38 -05:00
Anas Nashif 5fae84a334 tests: benchmark: no reason why we are excluding architectures
Can't find a good reason why we are excluding architectures in those
benchmarks. This should be runnable on all.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-02-19 20:38:53 -05:00
Anas Nashif ed79b1f25e tests: use namespacing in extra_configs and drop duplicated scenarios
Use namespacing with extra_configs in some tests and remove duplicated
scenarios the were made arch or platform specifc.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-01-13 09:42:59 +01:00
Fabio Baltieri 7db1d17ee3 yamllint: fix all yamllint line-length errors
Fix all line-length errors detected by yamllint:

yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
  grep '(line-length)'

Using a limit is set to 100 columns, not touching the commandlines in
GitHub workflows (at least for now).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 01:16:45 +09:00
Fabio Baltieri 7dd902d035 yamllint: fix all yamllint comments-indentation errors
Fix all comments-indentation errors detected by yamllint:

yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
  grep '(comments-indentation)'

This checks that the comment is aligned with the content.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 01:16:45 +09:00
Henri Xavier 2d96beb9d8 tests/benchmarks: Add userspace scheduling benchmark
Zephyr already has a scheduling benchmark in tests/benchmarks/sched,
but it only uses kernel threads.
We add an userspace version of it, to exercise memory domains.

Signed-off-by: Henri Xavier <datacomos@huawei.com>
2022-12-13 17:21:11 +09:00
Kumar Gala 4f0166088c tests: move to using CONFIG_MP_MAX_NUM_CPUS
For tests that set CONFIG_MP_NUM_CPUS, switch to using
CONFIG_MP_MAX_NUM_CPUS instead as we work to phase out
CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-20 22:04:10 +09:00
Robert Lubos b76c35d809 modules: mbedtls: Replace select statement with depends on for EC
Instead of using "select" on certain EC configurations, which is
considered unsafe for various reasons, use a "depends on" and rely on
the user to set a proper configuration in the config file.

Update the respective project configurations to comply with the new
configuration scheme.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-10-07 15:12:42 +02:00