linux/tools/tracing/rtla
Tomas Glozar 6cc45f8c1f rtla/timerlat: Fix histogram ALL for zero samples
rtla timerlat hist currently computers the minimum, maximum and average
latency even in cases when there are zero samples. This leads to
nonsensical values being calculated for maximum and minimum, and to
divide by zero for average.

A similar bug is fixed by 01b05fc0e5 ("rtla/timerlat: Fix histogram
report when a cpu count is 0") but the bug still remains for printing
the sum over all CPUs in timerlat_print_stats_all.

The issue can be reproduced with this command:

$ rtla timerlat hist -U -d 1s
Index
over:
count:
min:
avg:
max:
Floating point exception (core dumped)

(There are always no samples with -U unless the user workload is
created.)

Fix the bug by omitting max/min/avg when sample count is zero,
displaying a dash instead, just like we already do for the individual
CPUs. The logic is moved into a new function called
format_summary_value, which is used for both the individual CPUs
and for the overall summary.

Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/20241127134130.51171-1-tglozar@redhat.com
Fixes: 1462501c7a ("rtla/timerlat: Add a summary for hist mode")
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2024-12-27 11:21:46 -05:00
..
sample tools/rtla: Improve exception handling in timerlat_load.py 2024-11-19 08:57:13 -05:00
src rtla/timerlat: Fix histogram ALL for zero samples 2024-12-27 11:21:46 -05:00
.gitignore tools/rtla: Use tools/build makefiles to build rtla 2024-03-20 05:39:06 +01:00
Build tools/rtla: Use tools/build makefiles to build rtla 2024-03-20 05:39:06 +01:00
Makefile rtla: Add optional dependency on libcpupower 2024-10-17 17:13:15 -04:00
Makefile.config rtla: Add optional dependency on libcpupower 2024-10-17 17:13:15 -04:00
Makefile.rtla tools/rtla: Fix installation from out-of-tree build 2024-10-03 16:43:22 -04:00
Makefile.standalone tools/rtla: Use tools/build makefiles to build rtla 2024-03-20 05:39:06 +01:00
README.txt rtla: Documentation: Mention --deepest-idle-state 2024-10-17 17:13:16 -04:00

RTLA: Real-Time Linux Analysis tools

The rtla meta-tool includes a set of commands that aims to analyze
the real-time properties of Linux. Instead of testing Linux as a black box,
rtla leverages kernel tracing capabilities to provide precise information
about the properties and root causes of unexpected results.

Installing RTLA

RTLA depends on the following libraries and tools:

 - libtracefs
 - libtraceevent
 - libcpupower (optional, for --deepest-idle-state)

It also depends on python3-docutils to compile man pages.

For development, we suggest the following steps for compiling rtla:

  $ git clone git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git
  $ cd libtraceevent/
  $ make
  $ sudo make install
  $ cd ..
  $ git clone git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git
  $ cd libtracefs/
  $ make
  $ sudo make install
  $ cd ..
  $ cd $libcpupower_src
  $ make
  $ sudo make install
  $ cd $rtla_src
  $ make
  $ sudo make install

For further information, please refer to the rtla man page.