Part 1
요약·해설
User·supervisor thread의 같은 API 호출 경로와 측정값을 설명합니다.
System call path
Direct function call
Cycles · Instructions
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
A6782001403397CFE21ED3FE768BE9B592DB4221899F4F5DBCB131996D7A67A3
.. _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 :c:func:`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 :c:func:`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
Part 3
한국어 전문 번역
User thread가 system call을 거쳐야 할 때와 supervisor thread가 function을 직접 호출할 때의 performance 차이를 측정하는 sample application입니다.
개요
Application은 supervisor thread와 user thread를 하나씩 만듭니다. 두 thread 모두 현재 thread reference를 반환하는 k_current_get()을 호출하지만, user thread의 call은 system call 경로를 거쳐야 합니다.
두 thread는 k_current_get() 호출 동안 소비한 core clock cycle 수와 실행한 instruction 수를 각각 표시합니다.
샘플 출력
Example에서 user thread는 한 call에 약 18,000~20,000 cycle과 748 instruction을 사용하지만 supervisor thread의 직접 호출은 7 cycle과 4 instruction만 사용합니다. 수치는 platform과 build에 따라 달라질 수 있으며 이 출력은 system call 경계의 상대 비용을 보여 줍니다.
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
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.