tools/tracing/rtla: osnoise_hist: use total duration for average calculation
authorAndreas Ziegler <br015@umbiko.net>
Tue, 3 Jan 2023 10:33:59 +0000 (11:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:26 +0000 (09:33 +0100)
commitf86d50bf196998e04c3a9e6928cccdd38eb3e726
treedc894925d6b8c4ae247be10eb22bbe43717603f9
parent0cd7777c7476c8e18f89a361cc2f980f350d5701
tools/tracing/rtla: osnoise_hist: use total duration for average calculation

[ Upstream commit fe137a4fe0e77eb95396cfc5c3dd7df404421aa4 ]

Sampled durations must be weighted by observed quantity, to arrive at a correct
average duration value.

Perform calculation of total duration by summing (duration * count).

Link: https://lkml.kernel.org/r/20230103103400.275566-2-br015@umbiko.net
Fixes: 829a6c0b5698 ("rtla/osnoise: Add the hist mode")

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/tracing/rtla/src/osnoise_hist.c