fcbc60d7 | 21-Oct-2024 |
Tomas Glozar <tglozar@redhat.com> |
rtla/timerlat: Do not set params->user_workload with -U
Since commit fb9e90a67ee9 ("rtla/timerlat: Make user-space threads the default"), rtla-timerlat has been defaulting to params->user_workload i
rtla/timerlat: Do not set params->user_workload with -U
Since commit fb9e90a67ee9 ("rtla/timerlat: Make user-space threads the default"), rtla-timerlat has been defaulting to params->user_workload if neither that or params->kernel_workload is set. This has unintentionally made -U, which sets only params->user_hist/top but not params->user_workload, to behave like -u unless -k is set, preventing the user from running a custom workload.
Example: $ rtla timerlat hist -U -c 0 & [1] 7413 $ python sample/timerlat_load.py 0 Error opening timerlat fd, did you run timerlat -U? $ ps | grep timerlatu 7415 pts/4 00:00:00 timerlatu/0
Fix the issue by checking for params->user_top/hist instead of params->user_workload when setting default thread mode.
Link: https://lore.kernel.org/20241021123140.14652-1-tglozar@redhat.com Fixes: fb9e90a67ee9 ("rtla/timerlat: Make user-space threads the default") Signed-off-by: Tomas Glozar <tglozar@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
show more ...
|
cfbfbfc9 | 17-Oct-2024 |
Tomas Glozar <tglozar@redhat.com> |
rtla/timerlat: Add --deepest-idle-state for hist
Support limiting deepest idle state also for timerlat-hist.
Link: https://lore.kernel.org/20241017140914.3200454-6-tglozar@redhat.com Signed-off-by:
rtla/timerlat: Add --deepest-idle-state for hist
Support limiting deepest idle state also for timerlat-hist.
Link: https://lore.kernel.org/20241017140914.3200454-6-tglozar@redhat.com Signed-off-by: Tomas Glozar <tglozar@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
show more ...
|
549b92c9 | 17-Oct-2024 |
Tomas Glozar <tglozar@redhat.com> |
rtla/timerlat: Add --deepest-idle-state for top
Add option to limit deepest idle state on CPUs where timerlat is running for the duration of the workload.
Link: https://lore.kernel.org/202410171409
rtla/timerlat: Add --deepest-idle-state for top
Add option to limit deepest idle state on CPUs where timerlat is running for the duration of the workload.
Link: https://lore.kernel.org/20241017140914.3200454-5-tglozar@redhat.com Signed-off-by: Tomas Glozar <tglozar@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
show more ...
|
76b31021 | 11-Oct-2024 |
Tomas Glozar <tglozar@redhat.com> |
rtla/timerlat: Make timerlat_hist_cpu->*_count unsigned long long
Do the same fix as in previous commit also for timerlat-hist.
Link: https://lore.kernel.org/20241011121015.2868751-2-tglozar@redhat
rtla/timerlat: Make timerlat_hist_cpu->*_count unsigned long long
Do the same fix as in previous commit also for timerlat-hist.
Link: https://lore.kernel.org/20241011121015.2868751-2-tglozar@redhat.com Reported-by: Attila Fazekas <afazekas@redhat.com> Signed-off-by: Tomas Glozar <tglozar@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
show more ...
|
4eba4723 | 11-Oct-2024 |
Tomas Glozar <tglozar@redhat.com> |
rtla/timerlat: Make timerlat_top_cpu->*_count unsigned long long
Most fields of struct timerlat_top_cpu are unsigned long long, but the fields {irq,thread,user}_count are int (32-bit signed).
This
rtla/timerlat: Make timerlat_top_cpu->*_count unsigned long long
Most fields of struct timerlat_top_cpu are unsigned long long, but the fields {irq,thread,user}_count are int (32-bit signed).
This leads to overflow when tracing on a large number of CPUs for a long enough time: $ rtla timerlat top -a20 -c 1-127 -d 12h ... 0 12:00:00 | IRQ Timer Latency (us) | Thread Timer Latency (us) CPU COUNT | cur min avg max | cur min avg max 1 #43200096 | 0 0 1 2 | 3 2 6 12 ... 127 #43200096 | 0 0 1 2 | 3 2 5 11 ALL #119144 e4 | 0 5 4 | 2 28 16
The average latency should be 0-1 for IRQ and 5-6 for thread, but is reported as 5 and 28, about 4 to 5 times more, due to the count overflowing when summed over all CPUs: 43200096 * 127 = 5486412192, however, 1191444898 (= 5486412192 mod MAX_INT) is reported instead, as seen on the last line of the output, and the averages are thus ~4.6 times higher than they should be (5486412192 / 1191444898 = ~4.6).
Fix the issue by changing {irq,thread,user}_count fields to unsigned long long, similarly to other fields in struct timerlat_top_cpu and to the count variable in timerlat_top_print_sum.
Link: https://lore.kernel.org/20241011121015.2868751-1-tglozar@redhat.com Reported-by: Attila Fazekas <afazekas@redhat.com> Signed-off-by: Tomas Glozar <tglozar@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
show more ...
|
0eecee34 | 10-Oct-2024 |
Jan Stancek <jstancek@redhat.com> |
tools/rtla: fix collision with glibc sched_attr/sched_set_attr
glibc commit 21571ca0d703 ("Linux: Add the sched_setattr and sched_getattr functions") now also provides 'struct sched_attr' and sched_
tools/rtla: fix collision with glibc sched_attr/sched_set_attr
glibc commit 21571ca0d703 ("Linux: Add the sched_setattr and sched_getattr functions") now also provides 'struct sched_attr' and sched_setattr() which collide with the ones from rtla.
In file included from src/trace.c:11: src/utils.h:49:8: error: redefinition of ‘struct sched_attr’ 49 | struct sched_attr { | ^~~~~~~~~~ In file included from /usr/include/bits/sched.h:60, from /usr/include/sched.h:43, from /usr/include/tracefs/tracefs.h:10, from src/trace.c:4: /usr/include/linux/sched/types.h:98:8: note: originally defined here 98 | struct sched_attr { | ^~~~~~~~~~
Define 'struct sched_attr' conditionally, similar to what strace did: https://lore.kernel.org/all/20240930222913.3981407-1-raj.khem@gmail.com/ and rename rtla's version of sched_setattr() to avoid collision.
Link: https://lore.kernel.org/8088f66a7a57c1b209cd8ae0ae7c336a7f8c930d.1728572865.git.jstancek@redhat.com Signed-off-by: Jan Stancek <jstancek@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
show more ...
|
099a8401 | 10-Oct-2024 |
Jan Stancek <jstancek@redhat.com> |
tools/rtla: drop __NR_sched_getattr
It's not used since commit 084ce16df0f0 ("tools/rtla: Remove unused sched_getattr() function").
Link: https://lore.kernel.org/c355dc9ad23470098d6a8d0f31fbd702551
tools/rtla: drop __NR_sched_getattr
It's not used since commit 084ce16df0f0 ("tools/rtla: Remove unused sched_getattr() function").
Link: https://lore.kernel.org/c355dc9ad23470098d6a8d0f31fbd702551c9ea8.1728552769.git.jstancek@redhat.com Signed-off-by: Jan Stancek <jstancek@redhat.com> Reviewed-by: Tomas Glozar <tglozar@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
show more ...
|
cfb1ea21 | 26-Sep-2024 |
Gabriele Monaco <gmonaco@redhat.com> |
rtla: Fix consistency in getopt_long for timerlat_hist
Commit e9a4062e1527 ("rtla: Add --trace-buffer-size option") adds a new long option to rtla utilities, but among all affected files, timerlat_h
rtla: Fix consistency in getopt_long for timerlat_hist
Commit e9a4062e1527 ("rtla: Add --trace-buffer-size option") adds a new long option to rtla utilities, but among all affected files, timerlat_hist misses a trailing `:` in the corresponding short option inside the getopt string (e.g. `\3:`). This patch propagates the `:`.
Although this change is not functionally required, it improves consistency and slightly reduces the likelihood a future change would introduce a problem.
Cc: John Kacur <jkacur@redhat.com> Cc: Luis Goncalves <lgoncalv@redhat.com> Cc: Tomas Glozar <tglozar@redhat.com> Link: https://lore.kernel.org/20240926143417.54039-1-gmonaco@redhat.com Signed-off-by: Gabriele Monaco <gmonaco@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
show more ...
|
587f05a8 | 12-Jun-2024 |
Luis Claudio R. Goncalves <lgoncalv@redhat.com> |
rtla/osnoise: Better report when histogram is empty
When osnoise hist does not observe any samples above the threshold, no entries are recorded and the final report shows empty entries for the usual
rtla/osnoise: Better report when histogram is empty
When osnoise hist does not observe any samples above the threshold, no entries are recorded and the final report shows empty entries for the usual statistics (count, min, max, avg):
[~]# osnoise hist -d 5s -T 500 # RTLA osnoise histogram # Time unit is microseconds (us) # Duration: 0 00:00:05 Index over: count: min: avg: max:
That could lead users to confusing interpretations of the results.
A simple solution is to report 0 for count and the statistics, making it clear that no noise (above the defined threshold) was observed:
[~]# osnoise hist -d 5s -T 500 # RTLA osnoise histogram # Time unit is microseconds (us) # Duration: 0 00:00:05 Index over: 0 count: 0 min: 0 avg: 0 max: 0
Link: https://lkml.kernel.org/r/Zml6JmH5cbS7-HfZ@uudg.org
Cc: Daniel Bristot de Oliveira <bristot@kernel.org> Cc: John Kacur <jkacur@redhat.com> Cc: Clark Williams <williams@redhat.com> Reviewed-by: John Kacur <jkacur@redhat.com> Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
show more ...
|
842fc5b8 | 15-May-2024 |
John Kacur <jkacur@redhat.com> |
rtla: Fix -t\--trace[=file]
The -t option has an optional argument. The usual case is for a short option to be specified without an '=' and for the long version to be specified with an '='
Various
rtla: Fix -t\--trace[=file]
The -t option has an optional argument. The usual case is for a short option to be specified without an '=' and for the long version to be specified with an '='
Various forms of this do not work as expected. For example: rtla timerlat hist -T50 -tfile.txt will result in a truncated file name of "ile.txt"
Another example is that the long form without the '=' will result in the default file name instead of the requested file name.
This patch properly parses the optional argument with and without '=' and with and without spaces for the short form.
This patch was also tested using -t and --trace without providing a file name both as the last requested option and with a following long and short option.
For example:
rtla timerlat hist -T50 -t -u rtla timerlat hist -T50 --trace -u
This fix is applied to both timerlat top and hist and to osnoise top and hist.
Here is the full testing for rtla timerlat hist. Before applying the patch
rtla timerlat hist -T50 -t=file.txt Works as expected, "file.txt"
rtla timerlat hist -T50 -tfile.txt Truncated file name "ile.txt"
rtla timerlat hist -T50 -t file.txt Default file name instead of file.txt
rtla timerlat hist -T50 --trace=file.txt Truncated file name "ile.txt"
rtla timerlat hist -T50 --trace file.txt Default file name "timerlat_trace.txt" instead of "file.txt"
After applying the patch:
rtla timerlat hist -T50 -t=file.txt Works as expected, "file.txt"
rtla timerlat hist -T50 -tfile.txt Works as expected, "file.txt"
rtla timerlat hist -T50 -t file.txt Works as expected, "file.txt"
rtla timerlat hist -T50 --trace=file.txt Works as expected, "file.txt"
rtla timerlat hist -T50 --trace file.txt Works as expected, "file.txt"
In addition the following tests were performed to make sure that the default file name worked as expected including with trailing options.
rtla timerlat hist -T50 -t Works as expected "timerlat_trace.txt"
rtla timerlat hist -T50 --trace Works as expected "timerlat_trace.txt"
rtla timerlat hist -T50 -t -u Works as expected "timerlat_trace.txt"
rtla timerlat hist -T50 --trace -u Works as expected "timerlat_trace.txt"
Link: https://lkml.kernel.org/r/20240515183024.59985-1-jkacur@redhat.com
Cc: Daniel Bristot de Oliveria <bristot@kernel.org> Signed-off-by: John Kacur <jkacur@redhat.com> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
show more ...
|
01b05fc0 | 10-May-2024 |
John Kacur <jkacur@redhat.com> |
rtla/timerlat: Fix histogram report when a cpu count is 0
On short runs it is possible to get no samples on a cpu, like this:
# rtla timerlat hist -u -T50
Index IRQ-001 Thr-001 Usr-001
rtla/timerlat: Fix histogram report when a cpu count is 0
On short runs it is possible to get no samples on a cpu, like this:
# rtla timerlat hist -u -T50
Index IRQ-001 Thr-001 Usr-001 IRQ-002 Thr-002 Usr-002 2 1 0 0 0 0 0 33 0 1 0 0 0 0 36 0 0 1 0 0 0 49 0 0 0 1 0 0 52 0 0 0 0 1 0 over: 0 0 0 0 0 0 count: 1 1 1 1 1 0 min: 2 33 36 49 52 18446744073709551615 avg: 2 33 36 49 52 - max: 2 33 36 49 52 0 rtla timerlat hit stop tracing IRQ handler delay: (exit from idle) 48.21 us (91.09 %) IRQ latency: 49.11 us Timerlat IRQ duration: 2.17 us (4.09 %) Blocking thread: 1.01 us (1.90 %) swapper/2:0 1.01 us ------------------------------------------------------------------------ Thread latency: 52.93 us (100%)
Max timerlat IRQ latency from idle: 49.11 us in cpu 2
Note, the value 18446744073709551615 is the same as ~0.
Fix this by reporting no results for the min, avg and max if the count is 0.
Link: https://lkml.kernel.org/r/20240510190318.44295-1-jkacur@redhat.com
Cc: stable@vger.kernel.org Fixes: 1eeb6328e8b3 ("rtla/timerlat: Add timerlat hist mode") Suggested-by: Daniel Bristot de Oliveria <bristot@kernel.org> Signed-off-by: John Kacur <jkacur@redhat.com> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
show more ...
|
e9a4062e | 16-May-2024 |
Daniel Bristot de Oliveira <bristot@kernel.org> |
rtla: Add --trace-buffer-size option
Add the option allow the users to set a different buffer size for the trace. For example, in large systems, the user might be interested on reducing the trace bu
rtla: Add --trace-buffer-size option
Add the option allow the users to set a different buffer size for the trace. For example, in large systems, the user might be interested on reducing the trace buffer to avoid large tracing files.
The buffer size is specified in kB, and it is only affecting the tracing instance.
The function trace_set_buffer_size() appears on libtracefs v1.6, so increase the minimum required version on Makefile.config.
Link: https://lkml.kernel.org/r/e7c9ca5b3865f28e131a49ec3b984fadf2d056c6.1715860611.git.bristot@kernel.org
Cc: Jonathan Corbet <corbet@lwn.net> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: John Kacur <jkacur@redhat.com> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
show more ...
|
fb9e90a6 | 24-Apr-2024 |
Daniel Bristot de Oliveira <bristot@kernel.org> |
rtla/timerlat: Make user-space threads the default
After ther -u addition, most of the known users are setting it. And it makes sense, as it adds more information, and inherits the default setup for
rtla/timerlat: Make user-space threads the default
After ther -u addition, most of the known users are setting it. And it makes sense, as it adds more information, and inherits the default setup for the threads - e.g., cgroups configs.
Thus, if the user-space interface is available, enable -u. Otherwise, use the in-kernel thread.
Add the -k option to allow the user to request kernel-threads.
Link: https://lkml.kernel.org/r/9241d3089de4091b124f780ed832a0e6646cadaa.1713968967.git.bristot@kernel.org
Cc: Jonathan Corbet <corbet@lwn.net> Cc: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
show more ...
|
cdbf7196 | 24-Apr-2024 |
Daniel Bristot de Oliveira <bristot@kernel.org> |
rtla: Add the --warm-up option
On many cases, the results right after the startup are different from the rest of the execution, biasing the results. For example, on osnoise, the scheduler might take
rtla: Add the --warm-up option
On many cases, the results right after the startup are different from the rest of the execution, biasing the results. For example, on osnoise, the scheduler might take some time to adapt to the new busy-loop workload.
Add the --warm-up <seconds> option, adding a warm-up phase (in seconds) where the workload is set, but the results are discarded.
Link: https://lkml.kernel.org/r/e682d5ce5af90f123bd13220f63d5c3d118a92be.1713968967.git.bristot@kernel.org
Cc: Jonathan Corbet <corbet@lwn.net> Cc: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
show more ...
|
1462501c | 24-Apr-2024 |
Daniel Bristot de Oliveira <bristot@kernel.org> |
rtla/timerlat: Add a summary for hist mode
Like on rtla timerlat top, add an overall summary at the bottom of timerlat hist. For instance:
# timerlat hist -c 0-1 -d 10s -E 20 # RTLA timerlat hi
rtla/timerlat: Add a summary for hist mode
Like on rtla timerlat top, add an overall summary at the bottom of timerlat hist. For instance:
# timerlat hist -c 0-1 -d 10s -E 20 # RTLA timerlat histogram # Time unit is microseconds (us) # Duration: 0 00:00:10 Index IRQ-000 Thr-000 IRQ-001 Thr-001 6 1 0 0 0 7 1 0 0 0 8 1 0 1 0 9 7 0 0 0 10 16 0 0 0 11 1 0 3 0 15 0 0 3 0 16 0 0 12 0 17 0 0 28 0 18 0 2 26 0 19 1 1 80 1 over: 9973 9998 9848 10000 count: 10001 10001 10001 10001 min: 6 18 8 19 avg: 185 204 95 113 max: 428 450 341 371 ALL: IRQ Thr count: 20002 20002 min: 6 18 avg: 140 159 max: 428 450
Link: https://lkml.kernel.org/r/a6bc06c798f72127edc57d1f99da8d57e1187cee.1713968967.git.bristot@kernel.org
Cc: Jonathan Corbet <corbet@lwn.net> Suggested-by: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
show more ...
|
285dcb76 | 24-Apr-2024 |
Daniel Bristot de Oliveira <bristot@kernel.org> |
rtla/timerlat: Add a summary for top mode
While the per-cpu values are the results to take into consideration, the overall system values are also useful.
Add a summary at the bottom of rtla timerla
rtla/timerlat: Add a summary for top mode
While the per-cpu values are the results to take into consideration, the overall system values are also useful.
Add a summary at the bottom of rtla timerlat top showing the overall results. For instance:
Timer Latency 0 00:00:10 | IRQ Timer Latency (us) | Thread Timer Latency (us) CPU COUNT | cur min avg max | cur min avg max 0 #10003 | 113 19 150 441 | 134 35 170 459 1 #10003 | 63 8 99 462 | 84 15 119 481 2 #10003 | 3 2 89 396 | 21 8 108 414 3 #10002 | 206 11 210 394 | 223 21 228 415 ---------------|----------------------------------------|--------------------------------------- ALL #40011 e0 | 2 137 462 | 8 156 481
Link: https://lkml.kernel.org/r/5eb510d6faeb4ce745e09395196752df75a2dd1a.1713968967.git.bristot@kernel.org
Cc: Jonathan Corbet <corbet@lwn.net> Suggested-by: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
show more ...
|
f5c0cdad | 24-Apr-2024 |
Daniel Bristot de Oliveira <bristot@kernel.org> |
rtla/timerlat: Use pretty formatting only on interactive tty
timerlat top does some background/font color formatting. While useful on terminal, it breaks the output on other formats. For example, wh
rtla/timerlat: Use pretty formatting only on interactive tty
timerlat top does some background/font color formatting. While useful on terminal, it breaks the output on other formats. For example, when piping the output for pastebin tools, the format strings are printed as characters. For instance:
[2;37;40m Timer Latency [0;0;0m 0 00:00:01 | IRQ Timer Latency (us) | Thread Timer Latency (us) [2;30;47mCPU COUNT | cur min avg max | cur min avg max[0;0;0m 0 #1013 | 1 0 1 54 | 5 2 4 57 1 #1013 | 3 0 1 10 | 6 2 4 15
To avoid this problem, do the formatting only if running on a tty, and in !quiet mode.
Link: https://lkml.kernel.org/r/8288e1544ceab21557d5dda93a0f00339497c649.1713968967.git.bristot@kernel.org
Cc: Jonathan Corbet <corbet@lwn.net> Cc: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
show more ...
|
a40e5e4d | 24-Apr-2024 |
Daniel Bristot de Oliveira <bristot@kernel.org> |
rtla/auto-analysis: Replace \t with spaces
When copying timerlat auto-analysis from a terminal to some web pages or chats, the \t are being replaced with a single ' ' or ' ', breaking the output.
rtla/auto-analysis: Replace \t with spaces
When copying timerlat auto-analysis from a terminal to some web pages or chats, the \t are being replaced with a single ' ' or ' ', breaking the output.
For example: ## CPU 3 hit stop tracing, analyzing it ## IRQ handler delay: 1.30 us (0.11 %) IRQ latency: 1.90 us Timerlat IRQ duration: 3.00 us (0.24 %) Blocking thread: 1223.16 us (99.00 %) insync:4048 1223.16 us IRQ interference 4.93 us (0.40 %) local_timer:236 4.93 us ------------------------------------------------------------------------ Thread latency: 1235.47 us (100%)
Replace \t with spaces to avoid this problem.
Link: https://lkml.kernel.org/r/ec7ed2b2809c22ab0dfc8eb7c805ab9cddc4254a.1713968967.git.bristot@kernel.org
Cc: stable@vger.kernel.org Cc: Jonathan Corbet <corbet@lwn.net> Cc: Juri Lelli <juri.lelli@redhat.com> Fixes: 27e348b221f6 ("rtla/timerlat: Add auto-analysis core") Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
show more ...
|