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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE
and use PM_ as the prefix for all PM related Kconfigs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The mailbox and msgq utilities had API variants that could pass old
mem_pool blocks through the data structure. That API is being
deprected (and the features were obscure), so remove the internal
support.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Mark all k_mem_pool APIs deprecated for future code. Remaining
internal usage now uses equivalent "z_mem_pool" symbols instead.
Fixes#24358
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Tests that include floating-point format specifications may need
cbprintf FP support. Make sure it's available.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Add some comments about rbtree to make it more readable
Add more detail infos to make the purpose and process
of the test cases more clear which include test goal,
test step, input, judging criteria, constraints, etc.,
and these can be seen in our Zephyr documentations.
Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
Some ARM platforms, now, enable HW Stack Protection by
default in the Board definition. So if some tests
need to run without stack protection, it is not
sufficient to disable TEST_HW_STACK_PROTECTION;
we need to explicitly disable HW_STACK_PROTECTION.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Move the call to timing_init() earlier before function call
to get frequency. Some arch/SoC/board require initialization
before there is a valid frequency value. Or else the printed
value would not be useful.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds an app which utilizes common kernel functions as a
starting point to gauge kernel footprint.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Initialize root field to NULL, so that 'test_tree_l.roo.max_depth'
will be assigned a valid value in function rb_insert().
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Use new timing API instead if local macros and functions. Add new
becnhmarks for threads and semaphore and change the output to be
parseable.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove this benchmark which was relying on custom tracing points in the
code and was not scalable. Use latency_measure benchmark instead which
is more realistic and measures similar metrics in a fully reproducible
manner and on all supported architectures.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
add a new testcase to:
Verify some operations of rbree are running in
logarithmic time.
Verify an user defined structure contains rbtree node works.
verify "for each"style APIs work.
Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
Add two test cases to verify the operations of accessing
head,tail,insert and remove in constant time by proving the time
complexity of the operations are O(1).
Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
Add some testcases to:
Verify an user defined structure contains dlist node works,
Verify dlist "for each" style APIs work.
Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
() The thread created to be used for timing measurement does not
need to run, so use K_FOREVER instead of K_MSEC().
() Thread cancel is actually using k_thread_abort() so re-word it
correctly to indicate it is aborting a non-running thread.
() The other k_thread_abort() is used on _current so re-word
the item.
Relates to #25458
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The sys_kernel tests have some loops that work only with 1 CPU
being active. So limits the number of CPUs to 1 even when SMP
is enabled. This also allows qemu_x86_64 to run, so remove it
from the exclude list.
Fixes#26627
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Unit tests were failing to build because random header was included by
kernel_includes.h. The problem is that rand32.h includes a generated
file that is either not generated or not included when building unit
tests. Also, it is better to limit the scope of this file to where it is
used.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
() This is simply to clean up the code for cycles and timing
calculations as there are quite a bit of unnecessary AND
operations.
() This also moves the cycle calculation closer to the print
statement as a few calculations were done between grabbing
counter values.
() PRINT_STATS() now takes only two parameters as the third
one was always calling CYCLES_TO_NS(2nd) anyway.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The conversion from cycles to nanoseconds was using the incorrect
macro which resulted in microseconds instead. So fix it by
using the correct macro.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The latency measurement are not designed to run on multiple CPUs,
so limit it to just 1 CPU.
Fixes#26264
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
After reviewing that test I found output looks too messy.
1. Remove words starting from capital letter in the middle of the
sentence.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
This commit fixes Cortex-M header inclusions from the deprecated paths.
The Cortex-M headers were relocated from `include/arch/arm/cortex_m` to
`include/arch/arm/aarch32/cortex_m` by the refactoring done in the
commit d048faacf2.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This test was configuring the system tick period to 1 second.
The test also constantly aligns to system tick boundaries,
in between each test part, which means the test runs for very long
(it is holding for longer than 1 minute just on those waits between
tests alone).
The nrf sys tick driver configures the RTC to produce still
all RTC interrupts at 32KHz intervals, which cause lots of
interrupts which slow down simulation quite bit.
Overall the test could take longer than 30 seconds in the
nrf52_bsim in CI even that this platform simulated time is decoupled
from real time.
=> Add a new config overlay for the nrf52_bsim board so
we configure there a much higher system tick frequency
It does not affect the test in any way more than shortening
the wait periods between in test part.
Also increment the sys tick to twice per second to speed up
the test in other platforms.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>