요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
==============
OSNOISE Tracer
==============
In the context of high-performance computing (HPC), the Operating System
Noise (*osnoise*) refers to the interference experienced by an application
due to activities inside the operating system. In the context of Linux,
NMIs, IRQs, SoftIRQs, and any other system thread can cause noise to the
system. Moreover, hardware-related jobs can also cause noise, for example,
via SMIs.
hwlat_detector is one of the tools used to identify the most complex
source of noise: *hardware noise*.
In a nutshell, the hwlat_detector creates a thread that runs
periodically for a given period. At the beginning of a period, the thread
disables interrupt and starts sampling. While running, the hwlatd
thread reads the time in a loop. As interrupts are disabled, threads,
IRQs, and SoftIRQs cannot interfere with the hwlatd thread. Hence, the
cause of any gap between two different reads of the time roots either on
NMI or in the hardware itself. At the end of the period, hwlatd enables
interrupts and reports the max observed gap between the reads. It also
prints a NMI occurrence counter. If the output does not report NMI
executions, the user can conclude that the hardware is the culprit for
the latency. The hwlat detects the NMI execution by observing
the entry and exit of a NMI.
The osnoise tracer leverages the hwlat_detector by running a
similar loop with preemption, SoftIRQs and IRQs enabled, thus allowing
all the sources of *osnoise* during its execution. Using the same approach
of hwlat, osnoise takes note of the entry and exit point of any
source of interferences, increasing a per-cpu interference counter. The
osnoise tracer also saves an interference counter for each source of
interference. The interference counter for NMI, IRQs, SoftIRQs, and
threads is increased anytime the tool observes these interferences' entry
events. When a noise happens without any interference from the operating
system level, the hardware noise counter increases, pointing to a
hardware-related noise. In this way, osnoise can account for any
source of interference. At the end of the period, the osnoise tracer
prints the sum of all noise, the max single noise, the percentage of CPU
available for the thread, and the counters for the noise sources.
Usage
-----
Write the ASCII text "osnoise" into the current_tracer file of the
tracing system (generally mounted at /sys/kernel/tracing).
For example::
[root@f32 ~]# cd /sys/kernel/tracing/
[root@f32 tracing]# echo osnoise > current_tracer
It is possible to follow the trace by reading the trace file::
[root@f32 tracing]# cat trace
# tracer: osnoise
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth MAX
# || / SINGLE Interference counters:
# |||| RUNTIME NOISE % OF CPU NOISE +-----------------------------+
# TASK-PID CPU# |||| TIMESTAMP IN US IN US AVAILABLE IN US HW NMI IRQ SIRQ THREAD
# | | | |||| | | | | | | | | | |
<...>-859 [000] .... 81.637220: 1000000 190 99.98100 9 18 0 1007 18 1
<...>-860 [001] .... 81.638154: 1000000 656 99.93440 74 23 0 1006 16 3
<...>-861 [002] .... 81.638193: 1000000 5675 99.43250 202 6 0 1013 25 21
<...>-862 [003] .... 81.638242: 1000000 125 99.98750 45 1 0 1011 23 0
<...>-863 [004] .... 81.638260: 1000000 1721 99.82790 168 7 0 1002 49 41
<...>-864 [005] .... 81.638286: 1000000 263 99.97370 57 6 0 1006 26 2
<...>-865 [006] .... 81.638302: 1000000 109 99.98910 21 3 0 1006 18 1
<...>-866 [007] .... 81.638326: 1000000 7816 99.21840 107 8 0 1016 39 19
In addition to the regular trace fields (from TASK-PID to TIMESTAMP), the
tracer prints a message at the end of each period for each CPU that is
running an osnoise/ thread. The osnoise specific fields report:
- The RUNTIME IN US reports the amount of time in microseconds that
the osnoise thread kept looping reading the time.
- The NOISE IN US reports the sum of noise in microseconds observed
by the osnoise tracer during the associated runtime.
- The % OF CPU AVAILABLE reports the percentage of CPU available for
the osnoise thread during the runtime window.
- The MAX SINGLE NOISE IN US reports the maximum single noise observed
during the runtime window.
- The Interference counters display how many each of the respective
interference happened during the runtime window.
Note that the example above shows a high number of HW noise samples.
The reason being is that this sample was taken on a virtual machine,
and the host interference is detected as a hardware interference.
Tracer Configuration
--------------------
The tracer has a set of options inside the osnoise directory, they are:
- osnoise/cpus: CPUs at which a osnoise thread will execute.
- osnoise/period_us: the period of the osnoise thread.
- osnoise/runtime_us: how long an osnoise thread will look for noise.
- osnoise/stop_tracing_us: stop the system tracing if a single noise
higher than the configured value happens. Writing 0 disables this
option.
- osnoise/stop_tracing_total_us: stop the system tracing if total noise
higher than the configured value happens. Writing 0 disables this
option.
- tracing_threshold: the minimum delta between two time() reads to be
considered as noise, in us. When set to 0, the default value will
be used, which is currently 1 us.
- osnoise/options: a set of on/off options that can be enabled by
writing the option name to the file or disabled by writing the option
name preceded with the 'NO\_' prefix. For example, writing
NO_OSNOISE_WORKLOAD disables the OSNOISE_WORKLOAD option. The
special DEAFAULTS option resets all options to the default value.
Tracer Options
--------------
The osnoise/options file exposes a set of on/off configuration options for
the osnoise tracer. These options are:
- DEFAULTS: reset the options to the default value.
- OSNOISE_WORKLOAD: do not dispatch osnoise workload (see dedicated
section below).
- PANIC_ON_STOP: call panic() if the tracer stops. This option serves to
capture a vmcore.
- OSNOISE_PREEMPT_DISABLE: disable preemption while running the osnoise
workload, allowing only IRQ and hardware-related noise.
- OSNOISE_IRQ_DISABLE: disable IRQs while running the osnoise workload,
allowing only NMIs and hardware-related noise, like hwlat tracer.
Additional Tracing
------------------
In addition to the tracer, a set of tracepoints were added to
facilitate the identification of the osnoise source.
- osnoise:sample_threshold: printed anytime a noise is higher than
the configurable tolerance_ns.
- osnoise:nmi_noise: noise from NMI, including the duration.
- osnoise:irq_noise: noise from an IRQ, including the duration.
- osnoise:softirq_noise: noise from a SoftIRQ, including the
duration.
- osnoise:thread_noise: noise from a thread, including the duration.
Note that all the values are *net values*. For example, if while osnoise
is running, another thread preempts the osnoise thread, it will start a
thread_noise duration at the start. Then, an IRQ takes place, preempting
the thread_noise, starting a irq_noise. When the IRQ ends its execution,
it will compute its duration, and this duration will be subtracted from
the thread_noise, in such a way as to avoid the double accounting of the
IRQ execution. This logic is valid for all sources of noise.
Here is one example of the usage of these tracepoints::
osnoise/8-961 [008] d.h. 5789.857532: irq_noise: local_timer:236 start 5789.857529929 duration 1845 ns
osnoise/8-961 [008] dNh. 5789.858408: irq_noise: local_timer:236 start 5789.858404871 duration 2848 ns
migration/8-54 [008] d... 5789.858413: thread_noise: migration/8:54 start 5789.858409300 duration 3068 ns
osnoise/8-961 [008] .... 5789.858413: sample_threshold: start 5789.858404555 duration 8812 ns interferences 2
In this example, a noise sample of 8 microseconds was reported in the last
line, pointing to two interferences. Looking backward in the trace, the
two previous entries were about the migration thread running after a
timer IRQ execution. The first event is not part of the noise because
it took place one millisecond before.
It is worth noticing that the sum of the duration reported in the
tracepoints is smaller than eight us reported in the sample_threshold.
The reason roots in the overhead of the entry and exit code that happens
before and after any interference execution. This justifies the dual
approach: measuring thread and tracing.
Running osnoise tracer without workload
---------------------------------------
By enabling the osnoise tracer with the NO_OSNOISE_WORKLOAD option set,
the osnoise: tracepoints serve to measure the execution time of
any type of Linux task, free from the interference of other tasks.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
운영체제 잡음과 측정 원리
1-42고성능 컴퓨팅(HPC)에서 운영체제 잡음(Operating System Noise, *osnoise*)은 운영체제 내부 활동 때문에 응용 프로그램이 겪는 간섭을 뜻한다. Linux에서는 NMI, IRQ, SoftIRQ와 그 밖의 모든 시스템 스레드가 시스템 잡음을 일으킬 수 있다. SMI처럼 하드웨어와 관련된 작업도 잡음의 원인이 될 수 있다.
`hwlat_detector`는 가장 복잡한 잡음 원인인 하드웨어 잡음을 식별하는 도구 가운데 하나다.
간단히 말해 `hwlat_detector`는 지정된 주기마다 실행되는 스레드를 만든다. 각 주기가 시작되면 이 스레드는 인터럽트를 비활성화하고 표본 수집을 시작하며, `hwlatd` 스레드는 루프에서 계속 시간을 읽는다. 인터럽트가 꺼져 있으므로 스레드, IRQ, SoftIRQ는 `hwlatd`를 방해할 수 없다. 따라서 연속한 두 시간 읽기 사이에 틈이 생겼다면 원인은 NMI 또는 하드웨어 자체다.
주기가 끝나면 `hwlatd`는 인터럽트를 다시 활성화하고 관측된 읽기 간격 중 최댓값과 NMI 발생 횟수를 보고한다. 출력에 NMI 실행이 없다면 사용자는 지연의 원인이 하드웨어라고 결론 내릴 수 있다. `hwlat`은 NMI 진입과 종료를 관찰해 NMI 실행을 감지한다.
`osnoise` 트레이서는 선점, SoftIRQ, IRQ를 활성화한 채 `hwlat_detector`와 비슷한 루프를 실행한다. 이 때문에 실행 중 모든 *osnoise* 원인이 개입할 수 있다. `osnoise`는 각 간섭 원인의 진입점과 종료점을 기록하고 CPU별 간섭 카운터를 증가시키며, NMI·IRQ·SoftIRQ·스레드마다 별도 카운터도 유지한다. 각 진입 이벤트를 관찰할 때 해당 카운터가 증가한다.
운영체제 수준의 간섭이 없는데 잡음이 발생하면 하드웨어 잡음 카운터를 증가시켜 하드웨어 관련 잡음임을 나타낸다. 이런 방식으로 `osnoise`는 모든 간섭 원인을 집계한다. 각 주기가 끝나면 전체 잡음 합계, 단일 잡음의 최댓값, 스레드가 사용할 수 있었던 CPU 비율, 잡음 원인별 카운터를 출력한다.
인터럽트와 선점 상태에 따라 시간 읽기 사이의 간격을 하드웨어 또는 운영체제 간섭으로 분류한다.
각 진입 이벤트를 세고, 운영체제 간섭으로 설명되지 않는 간격은 하드웨어 잡음으로 분류한다.
==============
OSNOISE Tracer
==============
In the context of high-performance computing (HPC), the Operating System
Noise (*osnoise*) refers to the interference experienced by an application
due to activities inside the operating system. In the context of Linux,
NMIs, IRQs, SoftIRQs, and any other system thread can cause noise to the
system. Moreover, hardware-related jobs can also cause noise, for example,
via SMIs.
hwlat_detector is one of the tools used to identify the most complex
source of noise: *hardware noise*.
In a nutshell, the hwlat_detector creates a thread that runs
periodically for a given period. At the beginning of a period, the thread
disables interrupt and starts sampling. While running, the hwlatd
thread reads the time in a loop. As interrupts are disabled, threads,
IRQs, and SoftIRQs cannot interfere with the hwlatd thread. Hence, the
cause of any gap between two different reads of the time roots either on
NMI or in the hardware itself. At the end of the period, hwlatd enables
interrupts and reports the max observed gap between the reads. It also
prints a NMI occurrence counter. If the output does not report NMI
executions, the user can conclude that the hardware is the culprit for
the latency. The hwlat detects the NMI execution by observing
the entry and exit of a NMI.
The osnoise tracer leverages the hwlat_detector by running a
similar loop with preemption, SoftIRQs and IRQs enabled, thus allowing
all the sources of *osnoise* during its execution. Using the same approach
of hwlat, osnoise takes note of the entry and exit point of any
source of interferences, increasing a per-cpu interference counter. The
osnoise tracer also saves an interference counter for each source of
interference. The interference counter for NMI, IRQs, SoftIRQs, and
threads is increased anytime the tool observes these interferences' entry
events. When a noise happens without any interference from the operating
system level, the hardware noise counter increases, pointing to a
hardware-related noise. In this way, osnoise can account for any
source of interference. At the end of the period, the osnoise tracer
prints the sum of all noise, the max single noise, the percentage of CPU
available for the thread, and the counters for the noise sources.
사용법과 출력 해석
43-94추적 시스템의 `current_tracer` 파일에 ASCII 문자열 `osnoise`를 쓴다. 추적 시스템은 일반적으로 `/sys/kernel/tracing`에 마운트되어 있다.
[root@f32 ~]# cd /sys/kernel/tracing/
[root@f32 tracing]# echo osnoise > current_tracer
`trace` 파일을 읽으면 추적 결과를 확인할 수 있다.
[root@f32 tracing]# cat trace
# tracer: osnoise
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth MAX
# || / SINGLE Interference counters:
# |||| RUNTIME NOISE % OF CPU NOISE +-----------------------------+
# TASK-PID CPU# |||| TIMESTAMP IN US IN US AVAILABLE IN US HW NMI IRQ SIRQ THREAD
# | | | |||| | | | | | | | | | |
<...>-859 [000] .... 81.637220: 1000000 190 99.98100 9 18 0 1007 18 1
<...>-860 [001] .... 81.638154: 1000000 656 99.93440 74 23 0 1006 16 3
<...>-861 [002] .... 81.638193: 1000000 5675 99.43250 202 6 0 1013 25 21
<...>-862 [003] .... 81.638242: 1000000 125 99.98750 45 1 0 1011 23 0
<...>-863 [004] .... 81.638260: 1000000 1721 99.82790 168 7 0 1002 49 41
<...>-864 [005] .... 81.638286: 1000000 263 99.97370 57 6 0 1006 26 2
<...>-865 [006] .... 81.638302: 1000000 109 99.98910 21 3 0 1006 18 1
<...>-866 [007] .... 81.638326: 1000000 7816 99.21840 107 8 0 1016 39 19
일반 추적 필드인 `TASK-PID`부터 `TIMESTAMP`까지의 정보에 더해, 트레이서는 `osnoise/` 스레드가 실행 중인 각 CPU에 대해 매 주기 끝에 메시지 하나를 출력한다. 뒤쪽 열은 `osnoise` 전용 측정값과 간섭 카운터다.
원문의 ASCII 머리글을 일반 추적 정보, 시간 측정값, 간섭 원인 카운터로 나눠 구조화했다.
`RUNTIME IN US`는 `osnoise` 스레드가 시간을 반복해서 읽은 시간을 마이크로초로 나타낸다. `NOISE IN US`는 그 실행 시간에 트레이서가 관측한 잡음의 합계이며, `% OF CPU AVAILABLE`은 같은 창에서 스레드가 사용할 수 있었던 CPU의 비율이다. `MAX SINGLE NOISE IN US`는 단일 잡음의 최댓값이고, 간섭 카운터는 각 원인이 몇 번 발생했는지 보여 준다.
위 예제에서 HW 잡음 표본이 많은 이유는 가상 머신에서 수집했기 때문이다. 호스트의 간섭이 게스트에는 하드웨어 간섭으로 감지된다.
Usage
-----
Write the ASCII text "osnoise" into the current_tracer file of the
tracing system (generally mounted at /sys/kernel/tracing).
For example::
[root@f32 ~]# cd /sys/kernel/tracing/
[root@f32 tracing]# echo osnoise > current_tracer
It is possible to follow the trace by reading the trace file::
[root@f32 tracing]# cat trace
# tracer: osnoise
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth MAX
# || / SINGLE Interference counters:
# |||| RUNTIME NOISE % OF CPU NOISE +-----------------------------+
# TASK-PID CPU# |||| TIMESTAMP IN US IN US AVAILABLE IN US HW NMI IRQ SIRQ THREAD
# | | | |||| | | | | | | | | | |
<...>-859 [000] .... 81.637220: 1000000 190 99.98100 9 18 0 1007 18 1
<...>-860 [001] .... 81.638154: 1000000 656 99.93440 74 23 0 1006 16 3
<...>-861 [002] .... 81.638193: 1000000 5675 99.43250 202 6 0 1013 25 21
<...>-862 [003] .... 81.638242: 1000000 125 99.98750 45 1 0 1011 23 0
<...>-863 [004] .... 81.638260: 1000000 1721 99.82790 168 7 0 1002 49 41
<...>-864 [005] .... 81.638286: 1000000 263 99.97370 57 6 0 1006 26 2
<...>-865 [006] .... 81.638302: 1000000 109 99.98910 21 3 0 1006 18 1
<...>-866 [007] .... 81.638326: 1000000 7816 99.21840 107 8 0 1016 39 19
In addition to the regular trace fields (from TASK-PID to TIMESTAMP), the
tracer prints a message at the end of each period for each CPU that is
running an osnoise/ thread. The osnoise specific fields report:
- The RUNTIME IN US reports the amount of time in microseconds that
the osnoise thread kept looping reading the time.
- The NOISE IN US reports the sum of noise in microseconds observed
by the osnoise tracer during the associated runtime.
- The % OF CPU AVAILABLE reports the percentage of CPU available for
the osnoise thread during the runtime window.
- The MAX SINGLE NOISE IN US reports the maximum single noise observed
during the runtime window.
- The Interference counters display how many each of the respective
interference happened during the runtime window.
Note that the example above shows a high number of HW noise samples.
The reason being is that this sample was taken on a virtual machine,
and the host interference is detected as a hardware interference.
트레이서 설정 파일
95-117트레이서 설정은 `osnoise` 디렉터리 안의 다음 파일로 제어한다.
CPU 배치, 측정 주기와 실행 시간, 자동 중단 임계값 및 세부 옵션을 설정한다.
예를 들어 `NO_OSNOISE_WORKLOAD`를 쓰면 `OSNOISE_WORKLOAD` 옵션을 비활성화한다. 원문의 마지막 문장에는 초기화 옵션이 `DEAFAULTS`로 표기되어 있지만, 다음 절의 실제 옵션 이름은 `DEFAULTS`이며 모든 옵션을 기본값으로 되돌린다.
Tracer Configuration
--------------------
The tracer has a set of options inside the osnoise directory, they are:
- osnoise/cpus: CPUs at which a osnoise thread will execute.
- osnoise/period_us: the period of the osnoise thread.
- osnoise/runtime_us: how long an osnoise thread will look for noise.
- osnoise/stop_tracing_us: stop the system tracing if a single noise
higher than the configured value happens. Writing 0 disables this
option.
- osnoise/stop_tracing_total_us: stop the system tracing if total noise
higher than the configured value happens. Writing 0 disables this
option.
- tracing_threshold: the minimum delta between two time() reads to be
considered as noise, in us. When set to 0, the default value will
be used, which is currently 1 us.
- osnoise/options: a set of on/off options that can be enabled by
writing the option name to the file or disabled by writing the option
name preceded with the 'NO\_' prefix. For example, writing
NO_OSNOISE_WORKLOAD disables the OSNOISE_WORKLOAD option. The
special DEAFAULTS option resets all options to the default value.
on/off 트레이서 옵션
118-133`osnoise/options` 파일은 다음 on/off 설정 옵션을 제공한다.
옵션 이름을 파일에 써서 동작 범위와 중단 시 처리 방식을 바꾼다.
옵션을 조합해 운영체제 간섭 원인을 단계적으로 제외한다.
Tracer Options
--------------
The osnoise/options file exposes a set of on/off configuration options for
the osnoise tracer. These options are:
- DEFAULTS: reset the options to the default value.
- OSNOISE_WORKLOAD: do not dispatch osnoise workload (see dedicated
section below).
- PANIC_ON_STOP: call panic() if the tracer stops. This option serves to
capture a vmcore.
- OSNOISE_PREEMPT_DISABLE: disable preemption while running the osnoise
workload, allowing only IRQ and hardware-related noise.
- OSNOISE_IRQ_DISABLE: disable IRQs while running the osnoise workload,
allowing only NMIs and hardware-related noise, like hwlat tracer.
추가 tracepoint와 순 잡음 시간
134-174잡음의 출처를 더 쉽게 식별할 수 있도록 트레이서와 함께 다음 tracepoint가 추가되었다.
임계값 초과 표본과 각 간섭 원인의 지속 시간을 개별 이벤트로 기록한다.
모든 시간 값은 *순 값(net value)*이다. 예를 들어 다른 스레드가 `osnoise` 스레드를 선점하면 `thread_noise`의 지속 시간 측정이 시작된다. 그 스레드를 다시 IRQ가 선점하면 `irq_noise` 측정이 시작된다. IRQ 실행이 끝났을 때 계산한 IRQ 지속 시간은 `thread_noise`에서 빼므로 IRQ 실행 시간이 이중 집계되지 않는다. 같은 논리가 모든 잡음 원인에 적용된다.
안쪽 간섭 시간을 바깥쪽 간섭에서 빼 각 원인의 시간이 한 번만 합산되게 한다.
다음은 이 tracepoint들을 사용한 예다.
osnoise/8-961 [008] d.h. 5789.857532: irq_noise: local_timer:236 start 5789.857529929 duration 1845 ns
osnoise/8-961 [008] dNh. 5789.858408: irq_noise: local_timer:236 start 5789.858404871 duration 2848 ns
migration/8-54 [008] d... 5789.858413: thread_noise: migration/8:54 start 5789.858409300 duration 3068 ns
osnoise/8-961 [008] .... 5789.858413: sample_threshold: start 5789.858404555 duration 8812 ns interferences 2
마지막 줄은 8마이크로초의 잡음 표본과 두 번의 간섭을 보고한다. 추적 내용을 거꾸로 살펴보면 앞의 두 항목은 타이머 IRQ가 실행된 뒤 migration 스레드가 실행된 기록이다. 첫 번째 이벤트는 약 1밀리초 전에 발생했으므로 이 잡음 표본에 포함되지 않는다.
tracepoint가 보고한 지속 시간의 합은 `sample_threshold`가 보고한 8마이크로초보다 작다. 각 간섭 실행 전후에 수행되는 진입·종료 코드의 오버헤드가 있기 때문이다. 이것이 측정 스레드와 이벤트 추적을 함께 사용하는 이중 접근법이 필요한 이유다.
Additional Tracing
------------------
In addition to the tracer, a set of tracepoints were added to
facilitate the identification of the osnoise source.
- osnoise:sample_threshold: printed anytime a noise is higher than
the configurable tolerance_ns.
- osnoise:nmi_noise: noise from NMI, including the duration.
- osnoise:irq_noise: noise from an IRQ, including the duration.
- osnoise:softirq_noise: noise from a SoftIRQ, including the
duration.
- osnoise:thread_noise: noise from a thread, including the duration.
Note that all the values are *net values*. For example, if while osnoise
is running, another thread preempts the osnoise thread, it will start a
thread_noise duration at the start. Then, an IRQ takes place, preempting
the thread_noise, starting a irq_noise. When the IRQ ends its execution,
it will compute its duration, and this duration will be subtracted from
the thread_noise, in such a way as to avoid the double accounting of the
IRQ execution. This logic is valid for all sources of noise.
Here is one example of the usage of these tracepoints::
osnoise/8-961 [008] d.h. 5789.857532: irq_noise: local_timer:236 start 5789.857529929 duration 1845 ns
osnoise/8-961 [008] dNh. 5789.858408: irq_noise: local_timer:236 start 5789.858404871 duration 2848 ns
migration/8-54 [008] d... 5789.858413: thread_noise: migration/8:54 start 5789.858409300 duration 3068 ns
osnoise/8-961 [008] .... 5789.858413: sample_threshold: start 5789.858404555 duration 8812 ns interferences 2
In this example, a noise sample of 8 microseconds was reported in the last
line, pointing to two interferences. Looking backward in the trace, the
two previous entries were about the migration thread running after a
timer IRQ execution. The first event is not part of the noise because
it took place one millisecond before.
It is worth noticing that the sum of the duration reported in the
tracepoints is smaller than eight us reported in the sample_threshold.
The reason roots in the overhead of the entry and exit code that happens
before and after any interference execution. This justifies the dual
approach: measuring thread and tracing.
워크로드 없이 osnoise 실행
175-180`NO_OSNOISE_WORKLOAD` 옵션을 설정한 채 `osnoise` 트레이서를 활성화하면 `osnoise:` tracepoint를 이용해 다른 태스크의 간섭을 배제하고 모든 종류의 Linux 태스크 실행 시간을 측정할 수 있다.
Running osnoise tracer without workload
---------------------------------------
By enabling the osnoise tracer with the NO_OSNOISE_WORKLOAD option set,
the osnoise: tracepoints serve to measure the execution time of
any type of Linux task, free from the interference of other tasks.
요약·해설
osnoise-tracer.rst:1-180OSNOISE 트레이서가 NMI·IRQ·SoftIRQ·스레드·하드웨어 잡음을 분류하는 원리, 추적 출력 필드, 주기와 임계값 설정, 순 지속 시간 tracepoint 및 워크로드 없는 측정 방식을 설명합니다.
`hwlat_detector`가 운영체제 간섭을 차단해 NMI와 하드웨어만 분리하는 것과 달리, `osnoise`는 선점과 인터럽트를 허용하고 진입·종료 이벤트를 함께 관찰한다. 따라서 총 지연만 보는 것이 아니라 원인별 횟수와 순 지속 시간을 같은 실행 구간에서 비교할 수 있다.
가상 머신에서는 호스트의 간섭이 HW 잡음으로 보일 수 있으며, `stop_tracing_us`와 `stop_tracing_total_us`를 활용하면 큰 단일 지연 또는 누적 지연이 발생한 순간의 추적을 보존할 수 있다.