Re: [PATCH v3] rt-tests: hwlatdetect: Add MTBF calculation

John Kacur <[email protected]>
Newsgroups org.kernel.vger.linux-rt-users
Message-ID <[email protected]>

On Fri, 20 Feb 2026, Costa Shulyupin wrote:

8< -----------

>  
> +    if exceeding > 1:
> +        info(f"MTBF: {(float(detect.last) - float(detect.first)) / (exceeding - 1):.3f} seconds")
> +

With newer kernels you can get multiple latency events ie, the count  per 
timestamp but you don't know when they occurred. (the timestamp measures the occurence 
of the first event)
Does it therefore make more sense to measure the mean time between samples 
(distinct timestamp entries)

Does the following make more sense? 

if detect.samples > 1:
    info(f"MTBF: {(float(detect.last) - float(detect.first)) / (len(detect.samples) - 1):.3f} seconds")

>      if detect.have_msr:
>          finishsmi = detect.getsmicounts()
>          total_smis = 0
> -- 

John
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.