tools/tracing/rtla: osnoise_hist: display average with two-digit precision

Calculate average value in osnoise-hist summary with two-digit
precision to avoid displaying too optimitic results.

Link: https://lkml.kernel.org/r/20230103103400.275566-3-br015@umbiko.net

Signed-off-by: Andreas Ziegler <br015@umbiko.net>
Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
Andreas Ziegler 2023-01-03 11:34:00 +01:00 committed by Steven Rostedt (Google)
parent fe137a4fe0
commit 1fab1469b6

View File

@ -335,8 +335,8 @@ osnoise_print_summary(struct osnoise_hist_params *params,
continue;
if (data->hist[cpu].count)
trace_seq_printf(trace->seq, "%9llu ",
data->hist[cpu].sum_sample / data->hist[cpu].count);
trace_seq_printf(trace->seq, "%9.2f ",
((double) data->hist[cpu].sum_sample) / data->hist[cpu].count);
else
trace_seq_printf(trace->seq, " - ");
}