zephyr/tests/benchmarks/app_kernel
Yong Cong Sin bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
..
boards tests: kernel benchmark: Avoid timeout in nrf52_bsim 2020-06-08 17:13:10 +02:00
src build: namespace the generated headers with zephyr/ 2024-05-28 22:03:55 +02:00
CMakeLists.txt cmake: increase minimal required version to 3.20.0 2021-08-20 09:47:34 +02:00
prj.conf tests: disable timeslicing on app_kernel 2023-12-18 09:28:08 +01:00
prj_user.conf kernel: do not export z_thread_priority_set 2024-03-06 19:27:28 -05:00
README.txt tests: app_kernel: Update README 2023-10-31 08:58:45 +01:00
testcase.yaml hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00

Title: Kernel Object Performance

Description:

The app_kernel test is used to measure the performance of the following
kernel objects: message queues, semaphores, memory slabs, mailboxes and pipes.

When the userspace version is selected (CONF_FILE=prj_user.conf), this
benchmark will execute with four configurations (kernel/kernel, kernel/user,
user/kernel and user/user). However, any configuration involving user threads
will omit both the memory slabs and mailbox tests.

--------------------------------------------------------------------------------

Sample Output:

|-----------------------------------------------------------------------------|
|          S I M P L E   S E R V I C E    M E A S U R E M E N T S  |  nsec    |
|-----------------------------------------------------------------------------|
|-----------------------------------------------------------------------------|
| enqueue 1 byte msg in FIFO                                       |    NNNNNN|
| dequeue 1 byte msg in FIFO                                       |    NNNNNN|
| enqueue 4 bytes msg in FIFO                                      |    NNNNNN|
| dequeue 4 bytes msg in FIFO                                      |    NNNNNN|
| enqueue 192 bytes msg in MSGQ                                    |    NNNNNN|
| dequeue 192 bytes msg in MSGQ                                    |    NNNNNN|
| enqueue 1 byte msg in MSGQ to a waiting higher priority task     |    NNNNNN|
| enqueue 4 bytes in MSGQ to a waiting higher priority task        |    NNNNNN|
| enqueue 192 bytes in MSGQ to a waiting higher priority task      |    NNNNNN|
|-----------------------------------------------------------------------------|
| signal semaphore                                                 |    NNNNNN|
| signal to waiting high pri task                                  |    NNNNNN|
| signal to waiting high pri task, with timeout                    |    NNNNNN|
|-----------------------------------------------------------------------------|
| average lock and unlock mutex                                    |    NNNNNN|
|-----------------------------------------------------------------------------|
| average alloc and dealloc memory page                            |    NNNNNN|
|-----------------------------------------------------------------------------|
|                M A I L B O X   M E A S U R E M E N T S                      |
|-----------------------------------------------------------------------------|
| Send mailbox message to waiting high priority task and wait                 |
| repeat for  128 times and take the average                                  |
|-----------------------------------------------------------------------------|
|   size(B) |       time/packet (nsec)       |          KB/sec                |
|-----------------------------------------------------------------------------|
|          N|                          NNNNNN|                               N|
|          N|                          NNNNNN|                              NN|
|         NN|                          NNNNNN|                              NN|
|         NN|                          NNNNNN|                              NN|
|         NN|                          NNNNNN|                              NN|
|        NNN|                          NNNNNN|                             NNN|
|        NNN|                          NNNNNN|                             NNN|
|        NNN|                          NNNNNN|                             NNN|
|       NNNN|                         NNNNNNN|                             NNN|
|       NNNN|                         NNNNNNN|                            NNNN|
|       NNNN|                         NNNNNNN|                            NNNN|
|       NNNN|                         NNNNNNN|                            NNNN|
|-----------------------------------------------------------------------------|
| message overhead:      NNNNNN     nsec/packet                               |
| raw transfer rate:           NNNN KB/sec (without overhead)                 |
|-----------------------------------------------------------------------------|
|                   P I P E   M E A S U R E M E N T S                         |
|-----------------------------------------------------------------------------|
| Send data into a pipe towards a receiving high priority task and wait       |
|-----------------------------------------------------------------------------|
|                          matching sizes (_ALL_N)                            |
|-----------------------------------------------------------------------------|
|   size(B) |       time/packet (nsec)       |          KB/sec                |
|-----------------------------------------------------------------------------|
| put | get |  no buf  | small buf| big buf  |  no buf  | small buf| big buf  |
|-----------------------------------------------------------------------------|
|    N|    N|   NNNNNNN|   NNNNNNN|   NNNNNNN|         N|         N|         N|
|   NN|   NN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|        NN|
|   NN|   NN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|        NN|
|   NN|   NN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|        NN|
|  NNN|  NNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|        NN|
|  NNN|  NNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|       NNN|       NNN|       NNN|
|  NNN|  NNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|       NNN|       NNN|       NNN|
| NNNN| NNNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|       NNN|       NNN|       NNN|
| NNNN| NNNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|       NNN|       NNN|       NNN|
| NNNN| NNNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|      NNNN|      NNNN|      NNNN|
|-----------------------------------------------------------------------------|
|                      non-matching sizes (1_TO_N) to higher priority         |
|-----------------------------------------------------------------------------|
|   size(B) |       time/packet (nsec)       |          KB/sec                |
|-----------------------------------------------------------------------------|
| put | get |  no buf  | small buf| big buf  |  no buf  | small buf| big buf  |
|-----------------------------------------------------------------------------|
|    N| NNNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|         N|         N|         N|
|   NN| NNNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|        NN|
|   NN| NNNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|        NN|
|   NN|  NNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|        NN|
|  NNN|  NNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|        NN|
|  NNN|  NNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|        NN|
|  NNN|   NN|  NNNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|        NN|
| NNNN|   NN|  NNNNNNNN|  NNNNNNNN|  NNNNNNNN|        NN|        NN|        NN|
| NNNN|   NN| NNNNNNNNN| NNNNNNNNN| NNNNNNNNN|        NN|        NN|        NN|
| NNNN|    N| NNNNNNNNN| NNNNNNNNN| NNNNNNNNN|         N|         N|         N|
|-----------------------------------------------------------------------------|
|                      non-matching sizes (1_TO_N) to lower priority          |
|-----------------------------------------------------------------------------|
|   size(B) |       time/packet (nsec)       |          KB/sec                |
|-----------------------------------------------------------------------------|
| put | get |  no buf  | small buf| big buf  |  no buf  | small buf| big buf  |
|-----------------------------------------------------------------------------|
|    N| NNNN|   NNNNNNN|    NNNNNN|    NNNNNN|         N|         N|         N|
|   NN| NNNN|   NNNNNNN|   NNNNNNN|    NNNNNN|        NN|        NN|        NN|
|   NN| NNNN|   NNNNNNN|   NNNNNNN|    NNNNNN|        NN|        NN|        NN|
|   NN|  NNN|   NNNNNNN|   NNNNNNN|    NNNNNN|        NN|        NN|        NN|
|  NNN|  NNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|       NNN|
|  NNN|  NNN|   NNNNNNN|   NNNNNNN|   NNNNNNN|        NN|        NN|       NNN|
|  NNN|   NN|  NNNNNNNN|  NNNNNNNN|   NNNNNNN|        NN|        NN|       NNN|
| NNNN|   NN|  NNNNNNNN|  NNNNNNNN|   NNNNNNN|        NN|        NN|       NNN|
| NNNN|   NN| NNNNNNNNN| NNNNNNNNN|   NNNNNNN|        NN|         N|       NNN|
| NNNN|    N| NNNNNNNNN|NNNNNNNNNN|   NNNNNNN|         N|         N|      NNNN|
|-----------------------------------------------------------------------------|
|         END OF TESTS                                                        |
|-----------------------------------------------------------------------------|
PROJECT EXECUTION SUCCESSFUL