On Thu, Nov 19, 2015 at 01:00:07PM +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. > > v4: > - Introduce time_valid macro (Chris) > - Reduce amount of boilerplate code for calculating elapsed time > > v3: > - Do not exit directly from handler (Chris) > - Show elapsed time as -1 if it is not calculable > > v2: > - Cache the used clock (Chris) > - Do not change the clock during execution > - Spit out and error if monotonic time can not be read > > Cc: Thomas Wood <thomas.wood@xxxxxxxxx> > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > Signed-off-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > +static int gettime(struct timespec *ts) > { > memset(ts, 0, sizeof(*ts)); > + errno = 0; > > + // Stay on the same clock for consistency. We avoid using "//" for comments, even for single lines. -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx