<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body dir="auto"><div dir="auto">Hi,</div><div dir="auto"><br></div><div dir="auto">Oops. I missed that. Please reject this patch.</div><div dir="auto"><br></div><div dir="auto">BR, Piotr</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div id="composer_signature" dir="auto"><div style="font-size:85%;color:#575757" dir="auto">Wysłano z mojego smartfona Samsung Galaxy.</div></div><div><br></div><div style="font-size:100%;color:#000000" dir="auto"><!-- originalMessage --><div>-------- Oryginalna wiadomość --------</div><div>Od: Cyril Hrubis <chrubis@suse.cz> </div><div>Data: 25.07.2019  16:45  (GMT+01:00) </div><div>Do: Piotr Gawel <piotr.krzysztof.gawel@gmail.com> </div><div>DW: ltp@lists.linux.it </div><div>Temat: Re: [LTP] [PATCH] tst_timer: fix verification of execution time </div><div><br></div></div>Hi!<br>> Each sample needs to be in range:<br>>     t < s[i] < t + threshold<br>> Thus for i from the interval [d...n]:<br>>     (n-d)*t < sum(s[d...n]) < (n-d)*(t + threshold)<br>> This patch fixes that check.<br><br>As far as I can tell the function compute_treshold() multiplies the<br>threshold per call by keep_samples already, so it's a threashold per run<br>not a treshold per call, or do I miss something?<br><br>> Signed-off-by: Piotr Gawel <piotr.krzysztof.gawel@gmail.com><br>> ---<br>>  lib/tst_timer_test.c | 2 +-<br>>  1 file changed, 1 insertion(+), 1 deletion(-)<br>> <br>> diff --git a/lib/tst_timer_test.c b/lib/tst_timer_test.c<br>> index f6459e5..4508e29 100644<br>> --- a/lib/tst_timer_test.c<br>> +++ b/lib/tst_timer_test.c<br>> @@ -306,7 +306,7 @@ void do_timer_test(long long usec, unsigned int nsamples)<br>>             samples[nsamples-1], samples[0], median,<br>>             1.00 * trunc_mean / keep_samples, discard);<br>>  <br>> -        if (trunc_mean > (nsamples - discard) * usec + threshold) {<br>> +  if (trunc_mean > keep_samples * (usec + threshold)) {<br>>             tst_res(TFAIL, "%s slept for too long", scall);<br>>            if (!print_frequency_plot)<br>> -- <br>> 2.7.4<br>> <br>> <br>> -- <br>> Mailing list info: https://lists.linux.it/listinfo/ltp<br><br>-- <br>Cyril Hrubis<br>chrubis@suse.cz<br></body></html>