1RTLA-HWNOISE(1)                                                RTLA-HWNOISE(1)
2
3
4

NAME

6       rtla-hwnoise - Detect and quantify hardware-related noise
7

SYNOPSIS

9       rtla hwnoise [OPTIONS]
10

DESCRIPTION

12       rtla hwnoise collects the periodic summary from the osnoise tracer run‐
13       ning with interrupts disabled. By disabling interrupts, and the  sched‐
14       uling  of  threads  as  a consequence, only non-maskable interrupts and
15       hardware-related noise is allowed.
16
17       The tool also allows the configurations of the osnoise tracer  and  the
18       collection of the tracer output.
19

OPTIONS

21       -a, --auto us
22          Set  the automatic trace mode. This mode sets some commonly used op‐
23          tions while debugging the system. It is equivalent to use -s us -T 1
24          -t.
25
26       -p, --period us
27          Set the osnoise tracer period in microseconds.
28
29       -r, --runtime us
30          Set the osnoise tracer runtime in microseconds.
31
32       -s, --stop us
33          Stop the trace if a single sample is higher than the argument in mi‐
34          croseconds.  If -T is set, it will also save the trace to  the  out‐
35          put.
36
37       -S, --stop-total us
38          Stop  the  trace  if the total sample is higher than the argument in
39          microseconds.  If -T is set, it will also save the trace to the out‐
40          put.
41
42       -T, --threshold us
43          Specify  the  minimum  delta between two time reads to be considered
44          noise.  The default threshold is 5 us.
45
46       -q, --quiet
47          Print only a summary at the end of the session.
48
49       -c, --cpus cpu-list
50          Set the osnoise tracer to run the sample threads in the cpu-list.
51
52       -H, --house-keeping cpu-list
53          Run rtla control threads only on the given cpu-list.
54
55       -d, --duration time[s|m|h|d]
56          Set the duration of the session.
57
58       -D, --debug
59          Print debug info.
60
61       -t, --trace[=file]
62          Save the stopped trace to [file|osnoise_trace.txt].
63
64       -e, --event sys:event
65          Enable an event in the trace (-t) session. The  argument  can  be  a
66          specific event, e.g., -e sched:sched_switch, or all events of a sys‐
67          tem group, e.g., -e sched. Multiple -e are allowed. It is  only  ac‐
68          tive when -t or -a are set.
69
70       --filter <filter>
71          Filter  the  previous  -e sys:event event with <filter>. For further
72          information        about         event         filtering         see
73          https://www.kernel.org/doc/html/latest/trace/events.html#event-filtering.
74
75       --trigger <trigger>
76              Enable a trace event trigger to the previous -e  sys:event.   If
77              the hist: trigger is activated, the output histogram will be au‐
78              tomatically saved to a file  named  system_event_hist.txt.   For
79              example, the command:
80
81              rtla   <command>   <mode>   -t   -e   osnoise:irq_noise  --trig‐
82              ger="hist:key=desc,duration/1000:sort=desc,dura‐
83              tion/1000:vals=hitcount"
84
85              Will  automatically save the content of the histogram associated
86              to osnoise:irq_noise event in osnoise_irq_noise_hist.txt.
87
88              For   further    information    about    event    trigger    see
89              https://www.kernel.org/doc/html/latest/trace/events.html#event-triggers.
90
91       -P, --priority o:prio|r:prio|f:prio|d:runtime:period
92          Set scheduling parameters to the osnoise tracer threads, the  format
93          to set the priority are:
94
95o:prio - use SCHED_OTHER with prio;
96
97r:prio - use SCHED_RR with prio;
98
99f:prio - use SCHED_FIFO with prio;
100
101d:runtime[us|ms|s]:period[us|ms|s]  - use SCHED_DEADLINE with run‐
102            time and period in nanoseconds.
103
104       -C, --cgroup[=cgroup]
105          Set a cgroup to the tracer's threads. If the  -C  option  is  passed
106          without  arguments,  the tracer's thread will inherit rtla's cgroup.
107          Otherwise, the threads will be placed on the cgroup  passed  to  the
108          option.
109
110       -h, --help
111          Print help menu.
112

EXAMPLE

114       In  the  example below, the rtla hwnoise tool is set to run on CPUs 1-7
115       on a system with 8 cores/16 threads with hyper-threading enabled.
116
117       The tool is set to detect any noise higher than one microsecond, to run
118       for  ten  minutes, displaying a summary of the report at the end of the
119       session:
120
121          # rtla hwnoise -c 1-7 -T 1 -d 10m -q
122                                                  Hardware-related Noise
123          duration:   0 00:10:00 | time is in us
124          CPU Period       Runtime        Noise  % CPU Aval   Max Noise   Max Single          HW          NMI
125            1 #599       599000000          138    99.99997           3            3           4           74
126            2 #599       599000000           85    99.99998           3            3           4           75
127            3 #599       599000000           86    99.99998           4            3           6           75
128            4 #599       599000000           81    99.99998           4            4           2           75
129            5 #599       599000000           85    99.99998           2            2           2           75
130            6 #599       599000000           76    99.99998           2            2           0           75
131            7 #599       599000000           77    99.99998           3            3           0           75
132
133       The first column shows the CPU, and the second column  shows  how  many
134       Periods  the  tool  ran during the session. The Runtime is the time the
135       tool effectively runs on the CPU. The Noise column is the  sum  of  all
136       noise  that  the  tool observed, and the % CPU Aval is the relation be‐
137       tween the Runtime and Noise.
138
139       The Max Noise column is the maximum hardware noise the tool detected in
140       a single period, and the Max Single is the maximum single noise seen.
141
142       The  HW and NMI columns show the total number of hardware and NMI noise
143       occurrence observed by the tool.
144
145       For example, CPU 3 ran 599 periods of 1 second  Runtime.  The  CPU  re‐
146       ceived  86  us of noise during the entire execution, leaving 99.99997 %
147       of CPU time for the application. In the worst single  period,  the  CPU
148       caused 4 us of noise to the application, but it was certainly caused by
149       more than one single noise, as the Max Single noise was of  3  us.  The
150       CPU  has  HW  noise,  at a rate of six occurrences/ten minutes. The CPU
151       also has NMIs, at a higher frequency: around seven per second.
152
153       The tool should report 0 hardware-related noise in the ideal situation.
154       For example, by disabling hyper-threading to remove the hardware noise,
155       and disabling the TSC watchdog to remove the NMI  (it  is  possible  to
156       identify  this  using tracing options of rtla hwnoise), it was possible
157       to reach the ideal situation in the same hardware:
158
159          # rtla hwnoise -c 1-7 -T 1 -d 10m -q
160                                                  Hardware-related Noise
161          duration:   0 00:10:00 | time is in us
162          CPU Period       Runtime        Noise  % CPU Aval   Max Noise   Max Single          HW          NMI
163            1 #599       599000000            0   100.00000           0            0           0            0
164            2 #599       599000000            0   100.00000           0            0           0            0
165            3 #599       599000000            0   100.00000           0            0           0            0
166            4 #599       599000000            0   100.00000           0            0           0            0
167            5 #599       599000000            0   100.00000           0            0           0            0
168            6 #599       599000000            0   100.00000           0            0           0            0
169            7 #599       599000000            0   100.00000           0            0           0            0
170

SEE ALSO

172       rtla-osnoise(1)
173
174       Osnoise              tracer              documentation:              <‐
175       https://www.kernel.org/doc/html/latest/trace/osnoise-tracer.html>
176

AUTHOR

178       Written by Daniel Bristot de Oliveira <bristot@kernel.org>
179

REPORTING BUGS

181       Report     bugs     to     <linux-kernel@vger.kernel.org>     and    <‐
182       linux-trace-devel@vger.kernel.org>
183

LICENSE

185       rtla is Free Software licensed under the GNU GPLv2
186

COPYING

188       Copyright (C) 2021 Red Hat, Inc. Free use of this software  is  granted
189       under the terms of the GNU Public License (GPL).
190
191
192
193
194                                                               RTLA-HWNOISE(1)
Impressum