diff mbox

[i-g-t,1/3] lib: Assert that we do manage to submit at least one batch when measuring

Message ID 20180530103314.30565-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson May 30, 2018, 10:33 a.m. UTC
As we measure the ring size, we never expect to find we can not submit
no batches at all. Assert against the unexpected.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
---
 lib/i915/gem_ring.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Antonio Argenziano May 30, 2018, 4:27 p.m. UTC | #1
On 30/05/18 03:33, Chris Wilson wrote:
> As we measure the ring size, we never expect to find we can not submit
> no batches at all. Assert against the unexpected.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
>   lib/i915/gem_ring.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c
> index 10d2f2cd4..7d64165eb 100644
> --- a/lib/i915/gem_ring.c
> +++ b/lib/i915/gem_ring.c
> @@ -100,6 +100,7 @@ __gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags
>   	} while (1);
>   
>   	igt_assert_eq(__execbuf(fd, &execbuf), -EINTR);
> +	igt_assert(count);

Maybe a courtesy print?

With or without,
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>

>   
>   	memset(&itv, 0, sizeof(itv));
>   	setitimer(ITIMER_REAL, &itv, NULL);
>
diff mbox

Patch

diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c
index 10d2f2cd4..7d64165eb 100644
--- a/lib/i915/gem_ring.c
+++ b/lib/i915/gem_ring.c
@@ -100,6 +100,7 @@  __gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags
 	} while (1);
 
 	igt_assert_eq(__execbuf(fd, &execbuf), -EINTR);
+	igt_assert(count);
 
 	memset(&itv, 0, sizeof(itv));
 	setitimer(ITIMER_REAL, &itv, NULL);