1.. SPDX-License-Identifier: GPL-2.0
2
3============
4rtla-hwnoise
5============
6------------------------------------------
7Detect and quantify hardware-related noise
8------------------------------------------
9
10:Manual section: 1
11
12SYNOPSIS
13========
14
15**rtla hwnoise** [*OPTIONS*]
16
17DESCRIPTION
18===========
19
20**rtla hwnoise** collects the periodic summary from the *osnoise* tracer
21running with *interrupts disabled*. By disabling interrupts, and the scheduling
22of threads as a consequence, only non-maskable interrupts and hardware-related
23noise is allowed.
24
25The tool also allows the configurations of the *osnoise* tracer and the
26collection of the tracer output.
27
28OPTIONS
29=======
30.. include:: common_osnoise_options.rst
31
32.. include:: common_top_options.rst
33
34.. include:: common_options.rst
35
36EXAMPLE
37=======
38In the example below, the **rtla hwnoise** tool is set to run on CPUs *1-7*
39on a system with 8 cores/16 threads with hyper-threading enabled.
40
41The tool is set to detect any noise higher than *one microsecond*,
42to run for *ten minutes*, displaying a summary of the report at the
43end of the session::
44
45  # rtla hwnoise -c 1-7 -T 1 -d 10m -q
46                                          Hardware-related Noise
47  duration:   0 00:10:00 | time is in us
48  CPU Period       Runtime        Noise  % CPU Aval   Max Noise   Max Single          HW          NMI
49    1 #599       599000000          138    99.99997           3            3           4           74
50    2 #599       599000000           85    99.99998           3            3           4           75
51    3 #599       599000000           86    99.99998           4            3           6           75
52    4 #599       599000000           81    99.99998           4            4           2           75
53    5 #599       599000000           85    99.99998           2            2           2           75
54    6 #599       599000000           76    99.99998           2            2           0           75
55    7 #599       599000000           77    99.99998           3            3           0           75
56
57
58The first column shows the *CPU*, and the second column shows how many
59*Periods* the tool ran during the session. The *Runtime* is the time
60the tool effectively runs on the CPU. The *Noise* column is the sum of
61all noise that the tool observed, and the *% CPU Aval* is the relation
62between the *Runtime* and *Noise*.
63
64The *Max Noise* column is the maximum hardware noise the tool detected in a
65single period, and the *Max Single* is the maximum single noise seen.
66
67The *HW* and *NMI* columns show the total number of *hardware* and *NMI* noise
68occurrence observed by the tool.
69
70For example, *CPU 3* ran *599* periods of *1 second Runtime*. The CPU received
71*86 us* of noise during the entire execution, leaving *99.99997 %* of CPU time
72for the application. In the worst single period, the CPU caused *4 us* of
73noise to the application, but it was certainly caused by more than one single
74noise, as the *Max Single* noise was of *3 us*. The CPU has *HW noise,* at a
75rate of *six occurrences*/*ten minutes*. The CPU also has *NMIs*, at a higher
76frequency: around *seven per second*.
77
78The tool should report *0* hardware-related noise in the ideal situation.
79For example, by disabling hyper-threading to remove the hardware noise,
80and disabling the TSC watchdog to remove the NMI (it is possible to identify
81this using tracing options of **rtla hwnoise**), it was possible to reach
82the ideal situation in the same hardware::
83
84  # rtla hwnoise -c 1-7 -T 1 -d 10m -q
85                                          Hardware-related Noise
86  duration:   0 00:10:00 | time is in us
87  CPU Period       Runtime        Noise  % CPU Aval   Max Noise   Max Single          HW          NMI
88    1 #599       599000000            0   100.00000           0            0           0            0
89    2 #599       599000000            0   100.00000           0            0           0            0
90    3 #599       599000000            0   100.00000           0            0           0            0
91    4 #599       599000000            0   100.00000           0            0           0            0
92    5 #599       599000000            0   100.00000           0            0           0            0
93    6 #599       599000000            0   100.00000           0            0           0            0
94    7 #599       599000000            0   100.00000           0            0           0            0
95
96SEE ALSO
97========
98
99**rtla-osnoise**\(1)
100
101Osnoise tracer documentation: <https://www.kernel.org/doc/html/latest/trace/osnoise-tracer.html>
102
103AUTHOR
104======
105Written by Daniel Bristot de Oliveira <bristot@kernel.org>
106
107.. include:: common_appendix.rst
108