• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

src/04-Jan-2025-15086

CMakeLists.txtD04-Jan-2025437 2115

README.rstD04-Jan-20251.1 KiB3624

prj.confD04-Jan-2025141 76

sample.yamlD04-Jan-2025338 1716

README.rst

1.. zephyr:code-sample:: syscall_perf
2   :name: Syscall performance
3
4   Measure performance overhead of a system calls compared to direct function calls.
5
6Syscall performances
7====================
8
9The goal of this sample application is to measure the performance loss when a
10user thread has to go through a system call compared to a supervisor thread that
11calls the function directly.
12
13
14Overview
15********
16
17This application creates a supervisor and a user thread.
18Then both threads call :c:func:`k_current_get()` which returns a reference to the
19current thread. The user thread has to go through a system call.
20
21Both threads are showing the number of core clock cycles and the number of
22instructions executed while calling :c:func:`k_current_get()`.
23
24
25Sample Output
26*************
27
28.. code-block:: console
29
30    User thread:		   18012 cycles	     748 instructions
31    Supervisor thread:	       7 cycles	       4 instructions
32    User thread:		   20136 cycles	     748 instructions
33    Supervisor thread:	       7 cycles	       4 instructions
34    User thread:		   18014 cycles	     748 instructions
35    Supervisor thread:	       7 cycles	       4 instructions
36