diff mbox series

[i-g-t] i915/perf_pmu: Idle before measuring idle

Message ID 20190331210930.24358-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [i-g-t] i915/perf_pmu: Idle before measuring idle | expand

Commit Message

Chris Wilson March 31, 2019, 9:09 p.m. UTC
Before trying to measure the busyness reporting for the idle state, make
sure the gpu is actually idle and not still running any backgound system
task.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/perf_pmu.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Tvrtko Ursulin April 1, 2019, 8:15 a.m. UTC | #1
On 31/03/2019 22:09, Chris Wilson wrote:
> Before trying to measure the busyness reporting for the idle state, make
> sure the gpu is actually idle and not still running any backgound system
> task.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tests/perf_pmu.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index 1a08f564b..ef61c4d40 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -264,6 +264,7 @@ single(int gem_fd, const struct intel_execution_engine2 *e, unsigned int flags)
>   	uint64_t val;
>   	int fd;
>   
> +	gem_quiescent_gpu(gem_fd);
>   	fd = open_pmu(I915_PMU_ENGINE_BUSY(e->class, e->instance));
>   
>   	if (flags & TEST_BUSY)
> 

It's okay but where did it fail? Because subtest has quiescent at the 
end, and IGT has it at start.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
Chris Wilson April 1, 2019, 8:45 a.m. UTC | #2
Quoting Tvrtko Ursulin (2019-04-01 09:15:18)
> 
> On 31/03/2019 22:09, Chris Wilson wrote:
> > Before trying to measure the busyness reporting for the idle state, make
> > sure the gpu is actually idle and not still running any backgound system
> > task.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >   tests/perf_pmu.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> > index 1a08f564b..ef61c4d40 100644
> > --- a/tests/perf_pmu.c
> > +++ b/tests/perf_pmu.c
> > @@ -264,6 +264,7 @@ single(int gem_fd, const struct intel_execution_engine2 *e, unsigned int flags)
> >       uint64_t val;
> >       int fd;
> >   
> > +     gem_quiescent_gpu(gem_fd);
> >       fd = open_pmu(I915_PMU_ENGINE_BUSY(e->class, e->instance));
> >   
> >       if (flags & TEST_BUSY)
> > 
> 
> It's okay but where did it fail? Because subtest has quiescent at the 
> end, and IGT has it at start.

Honestly, not sure. I suspect it was just another idle worker. Other
than the selftest who's mission it is to detect such errors, this might
be the only test that is sensitive to stray requests being run in the
background. So it might be just shooting the canary.
-Chris
diff mbox series

Patch

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 1a08f564b..ef61c4d40 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -264,6 +264,7 @@  single(int gem_fd, const struct intel_execution_engine2 *e, unsigned int flags)
 	uint64_t val;
 	int fd;
 
+	gem_quiescent_gpu(gem_fd);
 	fd = open_pmu(I915_PMU_ENGINE_BUSY(e->class, e->instance));
 
 	if (flags & TEST_BUSY)