On Wed, Nov 18, 2015 at 02:18:52PM +0200, Joonas Lahtinen wrote:
> CLOCK_MONOTONIC_RAW is not affected by NTP, so it should be THE clock
> used for timing execution of tests.
> 
> When fetching either the starting or ending time of a test, show the
> time as -1.000s.
> 
> v3:
> - Do not exit directly from handler (Chris)
> - Show elapsed time as -1 if it is not calculable

Aye, that's better for the subtest handling.

> @@ -832,10 +851,16 @@ static void exit_subtest(const char *result)
>  {
>       struct timespec now;
>       double elapsed;
> +     int err;
>  
> -     gettime(&now);
> -     elapsed = now.tv_sec - subtest_time.tv_sec;
> -     elapsed += (now.tv_nsec - subtest_time.tv_nsec) * 1e-9;
> +     err = gettime(&now);
> +     if (!err && subtest_time.tv_sec != 0 &&
> +         subtest_time.tv_nsec != 0) {

A little paranoid? If we want the paranoia perhaps move it to gettime
and return an error?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to