162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci============
462306a36Sopenharmony_cirtla-hwnoise
562306a36Sopenharmony_ci============
662306a36Sopenharmony_ci------------------------------------------
762306a36Sopenharmony_ciDetect and quantify hardware-related noise
862306a36Sopenharmony_ci------------------------------------------
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci:Manual section: 1
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ciSYNOPSIS
1362306a36Sopenharmony_ci========
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci**rtla hwnoise** [*OPTIONS*]
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ciDESCRIPTION
1862306a36Sopenharmony_ci===========
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci**rtla hwnoise** collects the periodic summary from the *osnoise* tracer
2162306a36Sopenharmony_cirunning with *interrupts disabled*. By disabling interrupts, and the scheduling
2262306a36Sopenharmony_ciof threads as a consequence, only non-maskable interrupts and hardware-related
2362306a36Sopenharmony_cinoise is allowed.
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ciThe tool also allows the configurations of the *osnoise* tracer and the
2662306a36Sopenharmony_cicollection of the tracer output.
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ciOPTIONS
2962306a36Sopenharmony_ci=======
3062306a36Sopenharmony_ci.. include:: common_osnoise_options.rst
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci.. include:: common_top_options.rst
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci.. include:: common_options.rst
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ciEXAMPLE
3762306a36Sopenharmony_ci=======
3862306a36Sopenharmony_ciIn the example below, the **rtla hwnoise** tool is set to run on CPUs *1-7*
3962306a36Sopenharmony_cion a system with 8 cores/16 threads with hyper-threading enabled.
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ciThe tool is set to detect any noise higher than *one microsecond*,
4262306a36Sopenharmony_cito run for *ten minutes*, displaying a summary of the report at the
4362306a36Sopenharmony_ciend of the session::
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci  # rtla hwnoise -c 1-7 -T 1 -d 10m -q
4662306a36Sopenharmony_ci                                          Hardware-related Noise
4762306a36Sopenharmony_ci  duration:   0 00:10:00 | time is in us
4862306a36Sopenharmony_ci  CPU Period       Runtime        Noise  % CPU Aval   Max Noise   Max Single          HW          NMI
4962306a36Sopenharmony_ci    1 #599       599000000          138    99.99997           3            3           4           74
5062306a36Sopenharmony_ci    2 #599       599000000           85    99.99998           3            3           4           75
5162306a36Sopenharmony_ci    3 #599       599000000           86    99.99998           4            3           6           75
5262306a36Sopenharmony_ci    4 #599       599000000           81    99.99998           4            4           2           75
5362306a36Sopenharmony_ci    5 #599       599000000           85    99.99998           2            2           2           75
5462306a36Sopenharmony_ci    6 #599       599000000           76    99.99998           2            2           0           75
5562306a36Sopenharmony_ci    7 #599       599000000           77    99.99998           3            3           0           75
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ciThe first column shows the *CPU*, and the second column shows how many
5962306a36Sopenharmony_ci*Periods* the tool ran during the session. The *Runtime* is the time
6062306a36Sopenharmony_cithe tool effectively runs on the CPU. The *Noise* column is the sum of
6162306a36Sopenharmony_ciall noise that the tool observed, and the *% CPU Aval* is the relation
6262306a36Sopenharmony_cibetween the *Runtime* and *Noise*.
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ciThe *Max Noise* column is the maximum hardware noise the tool detected in a
6562306a36Sopenharmony_cisingle period, and the *Max Single* is the maximum single noise seen.
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ciThe *HW* and *NMI* columns show the total number of *hardware* and *NMI* noise
6862306a36Sopenharmony_cioccurrence observed by the tool.
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ciFor example, *CPU 3* ran *599* periods of *1 second Runtime*. The CPU received
7162306a36Sopenharmony_ci*86 us* of noise during the entire execution, leaving *99.99997 %* of CPU time
7262306a36Sopenharmony_cifor the application. In the worst single period, the CPU caused *4 us* of
7362306a36Sopenharmony_cinoise to the application, but it was certainly caused by more than one single
7462306a36Sopenharmony_cinoise, as the *Max Single* noise was of *3 us*. The CPU has *HW noise,* at a
7562306a36Sopenharmony_cirate of *six occurrences*/*ten minutes*. The CPU also has *NMIs*, at a higher
7662306a36Sopenharmony_cifrequency: around *seven per second*.
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ciThe tool should report *0* hardware-related noise in the ideal situation.
7962306a36Sopenharmony_ciFor example, by disabling hyper-threading to remove the hardware noise,
8062306a36Sopenharmony_ciand disabling the TSC watchdog to remove the NMI (it is possible to identify
8162306a36Sopenharmony_cithis using tracing options of **rtla hwnoise**), it was possible to reach
8262306a36Sopenharmony_cithe ideal situation in the same hardware::
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci  # rtla hwnoise -c 1-7 -T 1 -d 10m -q
8562306a36Sopenharmony_ci                                          Hardware-related Noise
8662306a36Sopenharmony_ci  duration:   0 00:10:00 | time is in us
8762306a36Sopenharmony_ci  CPU Period       Runtime        Noise  % CPU Aval   Max Noise   Max Single          HW          NMI
8862306a36Sopenharmony_ci    1 #599       599000000            0   100.00000           0            0           0            0
8962306a36Sopenharmony_ci    2 #599       599000000            0   100.00000           0            0           0            0
9062306a36Sopenharmony_ci    3 #599       599000000            0   100.00000           0            0           0            0
9162306a36Sopenharmony_ci    4 #599       599000000            0   100.00000           0            0           0            0
9262306a36Sopenharmony_ci    5 #599       599000000            0   100.00000           0            0           0            0
9362306a36Sopenharmony_ci    6 #599       599000000            0   100.00000           0            0           0            0
9462306a36Sopenharmony_ci    7 #599       599000000            0   100.00000           0            0           0            0
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ciSEE ALSO
9762306a36Sopenharmony_ci========
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci**rtla-osnoise**\(1)
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ciOsnoise tracer documentation: <https://www.kernel.org/doc/html/latest/trace/osnoise-tracer.html>
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ciAUTHOR
10462306a36Sopenharmony_ci======
10562306a36Sopenharmony_ciWritten by Daniel Bristot de Oliveira <bristot@kernel.org>
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci.. include:: common_appendix.rst
108