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

Viresh Kumar viresh.kumar@linaro.org
Mon Mar 8 11:17:32 CET 2021


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 ?

> +				tst_res(TINFO, "%s", tv->desc);
> +

I think you just need to add this to setup(), same is done for various
tests already.

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

-- 
viresh


More information about the ltp mailing list