zephyr/samples/userspace/syscall_perf
Keith Packard 5dd87e7db3 samples/userspace: Set common malloc arena size to zero for syscall_perf
The default malloc arena when using picolibc is too large for the
hifive1_revb target.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-06-17 07:28:42 -04:00
..
src
CMakeLists.txt
README.rst
prj.conf samples/userspace: Set common malloc arena size to zero for syscall_perf 2023-06-17 07:28:42 -04:00
sample.yaml

README.rst

.. _syscall_perf:

Syscall performances
====================

The goal of this sample application is to measure the performance loss when a
user thread has to go through a system call compared to a supervisor thread that
calls the function directly.


Overview
********

This application creates a supervisor and a user thread.
Then both threads call k_current_get() which returns a reference to the
current thread. The user thread has to go through a system call.

Both threads are showing the number of core clock cycles and the number of
instructions executed while calling k_current_get().


Sample Output
*************

.. code-block:: console

    User thread:		   18012 cycles	     748 instructions
    Supervisor thread:	       7 cycles	       4 instructions
    User thread:		   20136 cycles	     748 instructions
    Supervisor thread:	       7 cycles	       4 instructions
    User thread:		   18014 cycles	     748 instructions
    Supervisor thread:	       7 cycles	       4 instructions