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