[LTP] [PATCH] clock_gettime04: print more info to help debugging

Li Wang liwang@redhat.com
Mon Mar 8 11:59:03 CET 2021


On Mon, Mar 8, 2021 at 6:17 PM Viresh Kumar <viresh.kumar@linaro.org> wrote:

> On 08-03-21, 06:53, Li Wang wrote:
> > We get some sporadically failures like below, but we don't know which
> > loop it comes from. So adding more prints to help locate issue.
> >
> >   tst_test.c:1286: TINFO: Timeout per run is 0h 05m 00s
> >   vdso_helpers.c:76: TINFO: Couldn't find vdso_gettime64()
> >   clock_gettime04.c:157: TPASS: CLOCK_REALTIME: Difference between
> successive readings is reasonable
> >   clock_gettime04.c:150: TFAIL: CLOCK_REALTIME_COARSE: Difference
> between successive readings greater than 5 ms (1): 8
> >   clock_gettime04.c:157: TPASS: CLOCK_MONOTONIC: Difference between
> successive readings is reasonable
> >   clock_gettime04.c:150: TFAIL: CLOCK_MONOTONIC_COARSE: Difference
> between successive readings greater than 5 ms (0): 5
> >   clock_gettime04.c:157: TPASS: CLOCK_MONOTONIC_RAW: Difference between
> successive readings is reasonable
> >   clock_gettime04.c:157: TPASS: CLOCK_BOOTTIME: Difference between
> successive readings is reasonable
> >
> > Btw, it occurs on a x86_64 (not virtualized) with kernel 5.11.0.
> >
> > Signed-off-by: Li Wang <liwang@redhat.com>
> > ---
> >  testcases/kernel/syscalls/clock_gettime/clock_gettime04.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
> b/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
> > index 5f8264cc6..4dc9093c7 100644
> > --- a/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
> > +++ b/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
> > @@ -108,6 +108,9 @@ static void run(unsigned int i)
> >                       if (tv->clock_gettime == my_gettimeofday &&
> clks[i] != CLOCK_REALTIME)
> >                               continue;
> >
> > +                     if (tv->clock_gettime && count == 10000)
>
> clock_gettime will always be valid here, isn't it ?
>

Yes, but that's not harmful. If you remove all entries of varaints[] you can
still get PASS from the test, that's something strange to us. So I just add
this check there.



>
> > +                             tst_res(TINFO, "%s", tv->desc);
> > +
>
> I think you just need to add this to setup(), same is done for various
> tests already.
>

No, that will only print the first entry instruct variants because you're
using two iterations in the run(), the second loop 'j' is to traverse the
variants[] actually.



>
>         tst_res(TINFO, "Testing variant: %s", variants[tst_variant].desc);
>
> --
> viresh
>
>

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210308/603d0d14/attachment.htm>


More information about the ltp mailing list