<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Richard,</div></div><br><div class="gmail_quote"><div class="gmail_default" style="font-size:small">After trying that there were new problems with the below two comments.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> +static void verify_setitimer(unsigned int i)<br>
> +{<br>
> + struct tcase *tc = &tcases[i];<br>
> +<br>
> + si_flag = 0;<br>
> + value->it_value.tv_sec = SEC1;<br>
> + value->it_value.tv_usec = SEC0;<br>
<br>
Why not test usecs instead?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Yes, But the point we need attention here is to avoid defining</div><div class="gmail_default" style="font-size:small">a very tiny value for USEC. Otherwise, test will sometimes get</div><div class="gmail_default" style="font-size:small">first-timer expiration too early so that it has not had enough time</div><div class="gmail_default" style="font-size:small">for the rest code get an execution.</div></div><div><div class="gmail_default" style="font-size:small"><br></div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> + if (ovalue->it_value.tv_sec <= SEC1)<br>
> + tst_res(TPASS, "setitimer functionality is correct");<br>
> + else<br>
> + tst_brk(TFAIL, "old timer value is not equal to expected value");<br>
> +<br>
> + for (;;) {<br>
<br>
Could we use sigwait here instead?<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">sigwait() function suspends the calling progress which will</div><div class="gmail_default">disturb the target process counts down the user-mode CPU time.</div><div class="gmail_default" style="font-size:small">This led to the test hanging and never expiring the timer.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
We seem to be burning CPU cycles for no reason and if we get a spurious<br>
signal the test will still pass if we get the correct one afterwards.<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">And, these three signals all will terminate the process, so maybe</div><div class="gmail_default" style="font-size:small">another resolution is to test in children and check if they exit by</div><div class="gmail_default" style="font-size:small">the expected signal.</div><div class="gmail_default" style="font-size:small"><br></div></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>