[igt-dev] [PATCH i-g-t 1/3] tests/perf_pmu: Tighten busy measurement

Chris Wilson chris at chris-wilson.co.uk
Thu Feb 1 12:57:55 UTC 2018


Quoting Tvrtko Ursulin (2018-02-01 12:47:44)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> In cases where we manually terminate the busy batch, we always want to
> sample busyness while the batch is running, just before we will
> terminate it, and not the other way around. This way we make the window
> for unwated idleness getting sampled smaller.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>  tests/perf_pmu.c | 28 +++++++++++++---------------
>  1 file changed, 13 insertions(+), 15 deletions(-)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index 2f7d33414a53..bf16e5e8b1f9 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -146,10 +146,9 @@ single(int gem_fd, const struct intel_execution_engine2 *e, bool busy)
>                 spin = NULL;
>  
>         slept = measured_usleep(batch_duration_ns / 1000);
> -       igt_spin_batch_end(spin);
> -
>         val = pmu_read_single(fd);
>  
> +       igt_spin_batch_end(spin);

But that's the wrong way round as we are measuring busyness, and the
sampling should terminate as soon as the spin-batch ends, before we even
read the PMU sample? For the timer sampler, it's lost in the noise.

So the idea was to cancel the busyness asap so that the sampler stops
updating before we even have to cross into the kernel for the PMU read.
-Chris


More information about the igt-dev mailing list