[Intel-gfx] [PATCH igt 2/3] igt/perf_pmu: Test for supported perf before starting test_interrupts

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 22 18:05:22 UTC 2017


Check for the perf event prior to calibrating the nop batch, so that we
don't spend 4.5s before skipping.

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

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 420eb6c9..dd7a1761 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -898,11 +898,11 @@ test_interrupts(int gem_fd)
 	unsigned int i;
 	int fd;
 
+	fd = open_pmu(I915_PMU_INTERRUPTS);
+
 	cal = calibrate_nop(gem_fd, calibration_us);
 	sz = batch_len_us * cal / calibration_us;
 
-	fd = open_pmu(I915_PMU_INTERRUPTS);
-
 	gem_quiescent_gpu(gem_fd);
 
 	/* Wait for idle state. */
-- 
2.15.0



More information about the Intel-gfx mailing list