lib/igt_core: Prefer CLOCK_MONOTONIC_RAW
lib/igt_core: Prefer CLOCK_MONOTONIC_RAW

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.

v6:
- Whitespace corrections (Chris)

v5:
- Do not use C99 style comments (Chris)

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 <b9025d6a953b68f894a0f6a80fd2af6d55b0badd@intel.com>
Reviewed-by: Chris Wilson <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <a11ca63949063c01fa551bf27c25e0fe898387c4@linux.intel.com>
Signed-off-by: Thomas Wood <b9025d6a953b68f894a0f6a80fd2af6d55b0badd@intel.com>

tiagovignatti/intel-gpu-tools,tiagovignatti/intel-gpu-tools,tiagovignatti/intel-gpu-tools,tiagovignatti/intel-gpu-tools