mbox series

[0/2,v2] rtla osnoise hist average calculation

Message ID 20230103103400.275566-1-br015@umbiko.net (mailing list archive)
Headers show
Series rtla osnoise hist average calculation | expand

Message

Andreas Ziegler Jan. 3, 2023, 10:33 a.m. UTC
Version 2 of the proposed patch, with changes split in two separate commits, 
as suggested by Daniel Bristot de Oliveira

rtla osnoise hist always outputs '0' as average duration value. Example:

# rtla osnoise hist -P F:1 -c 0-1 -r 900000 -d 1M -b 1 -E 5000 -T 1
# RTLA osnoise histogram
# Time unit is microseconds (us)
# Duration:   0 00:01:00
  ...
count:     5629      1364
min:          1         1
avg:          0         0
max:       2955        56

This is due to sum_sample in osnoise_hist_update_multiple() being calculated 
as the sum (duration), not as sum (duration * count).

Truncating of the average value in final output suggests too optimistic 
results; display floating point value instead.

Andreas Ziegler (2):
  tools/tracing/rtla: osnoise_hist: use total duration for average
    calculation
  tools/tracing/rtla: osnoise_hist: display average with two-digit
    precision

 tools/tracing/rtla/src/osnoise_hist.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)