diff options
author | Tomas Glozar <tglozar@redhat.com> | 2024-11-27 14:41:30 +0100 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2024-12-27 11:21:46 -0500 |
commit | 6cc45f8c1f898570916044f606be9890d295e129 (patch) | |
tree | f25f49c8fd2e9bd5d4a71d7432a3d18ff56c5107 /arch/sparc/mm/generic_32.c | |
parent | 4bbf9020becbfd8fc2c3da790855b7042fad455b (diff) | |
download | lwn-6cc45f8c1f898570916044f606be9890d295e129.tar.gz lwn-6cc45f8c1f898570916044f606be9890d295e129.zip |
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 01b05fc0e5f3 ("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: 1462501c7a8 ("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>
Diffstat (limited to 'arch/sparc/mm/generic_32.c')
0 files changed, 0 insertions, 0 deletions