[igt-dev] [PATCH i-g-t v2 2/3] tests/perf_pmu: Handle thermally throttled devices

Chris Wilson chris at chris-wilson.co.uk
Mon Feb 12 10:00:13 UTC 2018


Quoting Tvrtko Ursulin (2018-02-12 09:47:24)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> Some systems cannot reach the advertised maximum frequency due throttling.
> Handle them by considering a 100MHz lower limit.
> 
> v2: Use more relaxed tolerance only in the downward direction.
>     (Chris Wilson)
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>  tests/perf_pmu.c | 20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index afc7dc992681..a5224b05c7d3 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -120,11 +120,16 @@ static uint64_t pmu_read_multi(int fd, unsigned int num, uint64_t *val)
>         return buf[1];
>  }
>  
> +#define __assert_within_epsilon(x, ref, tol_up, tol_down) \
> +       igt_assert_f((double)(x) <= (1.0 + (tol_up)) * (double)(ref) && \
> +                    (double)(x) >= (1.0 - (tol_down)) * (double)(ref), \
> +                    "'%s' != '%s' (%f not within %f%%/%f%% tolerance of %f)\n",\

Would "not within (-%%, +%%)" or "...(%% below, %% above)" read better?

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list