요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. |threshold| replace:: **-a/--auto**, **-i/--irq**, or **-T/--thread**
.. |thresharg| replace:: -T
.. |tracer| replace:: timerlat
.. |actionsperf| replace::
For time-sensitive actions, it is recommended to run **rtla timerlat** with BPF
support and RT priority. Note that due to implementational limitations, actions
might be delayed up to one second after tracing is stopped if BPF mode is not
available or disabled.
**-a**, **--auto** *us*
Set the automatic trace mode. This mode sets some commonly used options
while debugging the system. It is equivalent to use **-T** *us* **-s** *us*
**-t**. By default, *timerlat* tracer uses FIFO:95 for *timerlat* threads,
thus equilavent to **-P** *f:95*.
**-p**, **--period** *us*
Set the *timerlat* tracer period in microseconds.
**-i**, **--irq** *us*
Stop trace if the *IRQ* latency is higher than the argument in us.
**-T**, **--thread** *us*
Stop trace if the *Thread* latency is higher than the argument in us.
**-s**, **--stack** *us*
Save the stack trace at the *IRQ* if a *Thread* latency is higher than the
argument in us.
**-t**, **--trace** \[*file*]
Save the stopped trace to [*file|timerlat_trace.txt*].
**--dma-latency** *us*
Set the /dev/cpu_dma_latency to *us*, aiming to bound exit from idle latencies.
*cyclictest* sets this value to *0* by default, use **--dma-latency** *0* to have
similar results.
**--deepest-idle-state** *n*
Disable idle states higher than *n* for cpus that are running timerlat threads to
reduce exit from idle latencies. If *n* is -1, all idle states are disabled.
On exit from timerlat, the idle state setting is restored to its original state
before running timerlat.
Requires rtla to be built with libcpupower.
**-k**, **--kernel-threads**
Use timerlat kernel-space threads, in contrast of **-u**.
**-u**, **--user-threads**
Set timerlat to run without a workload, and then dispatches user-space workloads
to wait on the timerlat_fd. Once the workload is awakes, it goes to sleep again
adding so the measurement for the kernel-to-user and user-to-kernel to the tracer
output. **--user-threads** will be used unless the user specify **-k**.
**-U**, **--user-load**
Set timerlat to run without workload, waiting for the user to dispatch a per-cpu
task that waits for a new period on the tracing/osnoise/per_cpu/cpu$ID/timerlat_fd.
See linux/tools/rtla/sample/timerlat_load.py for an example of user-load code.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
공통 placeholder와 action 지연
1-10공통 option 문서에서 `|threshold|`는 `-a/--auto`, `-i/--irq`, `-T/--thread`로, `|thresharg|`는 `-T`로, `|tracer|`는 `timerlat`로 치환된다.
시간에 민감한 action에는 BPF 지원과 RT priority를 함께 사용하도록 권장한다. BPF mode를 사용할 수 없거나 끈 경우 구현 제약 때문에 tracing 중단 뒤 action이 최대 1초 늦어질 수 있다.
공통 man-page fragment에 삽입되는 값이다.
.. |threshold| replace:: **-a/--auto**, **-i/--irq**, or **-T/--thread**
.. |thresharg| replace:: -T
.. |tracer| replace:: timerlat
.. |actionsperf| replace::
For time-sensitive actions, it is recommended to run **rtla timerlat** with BPF
support and RT priority. Note that due to implementational limitations, actions
might be delayed up to one second after tracing is stopped if BPF mode is not
available or disabled.
Automatic mode와 IRQ·Thread threshold
11-37`-a` 또는 `--auto us`는 debug용 common option을 설정하며 `-T us -s us -t`와 같다. 기본 timerlat thread policy가 FIFO:95이므로 `-P f:95`와도 같다.
`-p` 또는 `--period us`는 tracer period를 microsecond 단위로 설정한다. `-i` 또는 `--irq us`는 IRQ latency가 값보다 크면 trace를 멈추고, `-T` 또는 `--thread us`는 Thread latency가 값보다 크면 멈춘다.
`-s` 또는 `--stack us`는 Thread latency가 threshold를 넘을 때 IRQ 지점의 stack trace를 저장한다. `-t` 또는 `--trace [file]`은 멈춘 trace를 지정 file 또는 기본 `timerlat_trace.txt`에 저장한다.
IRQ와 thread latency 조건을 분리해 설정한다.
**-a**, **--auto** *us*
Set the automatic trace mode. This mode sets some commonly used options
while debugging the system. It is equivalent to use **-T** *us* **-s** *us*
**-t**. By default, *timerlat* tracer uses FIFO:95 for *timerlat* threads,
thus equilavent to **-P** *f:95*.
**-p**, **--period** *us*
Set the *timerlat* tracer period in microseconds.
**-i**, **--irq** *us*
Stop trace if the *IRQ* latency is higher than the argument in us.
**-T**, **--thread** *us*
Stop trace if the *Thread* latency is higher than the argument in us.
**-s**, **--stack** *us*
Save the stack trace at the *IRQ* if a *Thread* latency is higher than the
argument in us.
**-t**, **--trace** \[*file*]
Save the stopped trace to [*file|timerlat_trace.txt*].
Idle latency와 workload 위치
38-67`--dma-latency us`는 `/dev/cpu_dma_latency`를 지정 값으로 설정해 idle 상태 탈출 latency의 상한을 유도한다. `cyclictest`는 기본으로 0을 사용하므로 비슷한 결과에는 `--dma-latency 0`을 쓴다.
`--deepest-idle-state n`은 timerlat thread가 실행되는 CPU에서 n보다 깊은 idle state를 비활성화해 idle exit latency를 줄인다. n이 -1이면 모든 idle state를 끄고, timerlat 종료 시 원래 설정을 복원한다. 이 option에는 libcpupower를 포함해 RTLA를 build해야 한다.
`-k` 또는 `--kernel-threads`는 kernel-space timerlat thread를 사용한다. `-u` 또는 `--user-threads`는 tracer를 workload 없이 시작한 다음 `timerlat_fd`를 기다리는 user-space workload를 배치한다. workload는 wakeup 후 다시 sleep하고 kernel-to-user 및 user-to-kernel 시간을 측정값에 더한다. 사용자가 `-k`를 지정하지 않으면 user thread가 기본이다.
`-U` 또는 `--user-load`는 workload 없이 timerlat를 실행하면서 사용자가 CPU마다 `tracing/osnoise/per_cpu/cpu$ID/timerlat_fd`의 새 period를 기다리는 task를 배치하도록 한다. 예제는 `linux/tools/rtla/sample/timerlat_load.py`에 있다.
측정 thread와 외부 workload의 위치를 선택한다.
timer event가 user space를 왕복하는 시간을 tracer 결과에 포함한다.
**--dma-latency** *us*
Set the /dev/cpu_dma_latency to *us*, aiming to bound exit from idle latencies.
*cyclictest* sets this value to *0* by default, use **--dma-latency** *0* to have
similar results.
**--deepest-idle-state** *n*
Disable idle states higher than *n* for cpus that are running timerlat threads to
reduce exit from idle latencies. If *n* is -1, all idle states are disabled.
On exit from timerlat, the idle state setting is restored to its original state
before running timerlat.
Requires rtla to be built with libcpupower.
**-k**, **--kernel-threads**
Use timerlat kernel-space threads, in contrast of **-u**.
**-u**, **--user-threads**
Set timerlat to run without a workload, and then dispatches user-space workloads
to wait on the timerlat_fd. Once the workload is awakes, it goes to sleep again
adding so the measurement for the kernel-to-user and user-to-kernel to the tracer
output. **--user-threads** will be used unless the user specify **-k**.
**-U**, **--user-load**
Set timerlat to run without workload, waiting for the user to dispatch a per-cpu
task that waits for a new period on the tracing/osnoise/per_cpu/cpu$ID/timerlat_fd.
See linux/tools/rtla/sample/timerlat_load.py for an example of user-load code.
요약·해설
common_timerlat_options.txt:1-67timerlat의 threshold·stack·trace, DMA와 idle-state 제어, kernel/user thread workload mode를 설명합니다.