summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2019-06-05 15:38:15 +0300
committerPetri Latvala <petri.latvala@intel.com>2019-07-25 15:42:38 +0300
commite8e8ee79bdcd0a0e138d6a9cebacc10b1322cc07 (patch)
treee00fcf9561e33017c81df969e83a1b8465082ecf /tests
parent9085f552a11156c5b856593361b30606a9424c01 (diff)
perf_pmu: Remove redundant check for engine
__for_each_physical_engine already iterates over only engines that exist, we don't need to check again that they exist. Removing the check also makes their respective subtest_groups not needed. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Andi Shyti <andi.shyti@intel.com> Tested-by: Andi Shyti <andi.shyti@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/perf_pmu.c223
1 files changed, 105 insertions, 118 deletions
diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 72b9166a..d392a67d 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1712,116 +1712,110 @@ igt_main
igt_subtest_f("init-sema-%s", e->name)
init(fd, e, I915_SAMPLE_SEMA);
- igt_subtest_group {
- igt_fixture {
- gem_context_has_engine(fd, 0, e->flags);
- }
+ /**
+ * Test that engines show no load when idle.
+ */
+ igt_subtest_f("idle-%s", e->name)
+ single(fd, e, 0);
- /**
- * Test that engines show no load when idle.
- */
- igt_subtest_f("idle-%s", e->name)
- single(fd, e, 0);
-
- /**
- * Test that a single engine reports load correctly.
- */
- igt_subtest_f("busy-%s", e->name)
- single(fd, e, TEST_BUSY);
- igt_subtest_f("busy-idle-%s", e->name)
- single(fd, e, TEST_BUSY | TEST_TRAILING_IDLE);
-
- /**
- * Test that when one engine is loaded other report no
- * load.
- */
- igt_subtest_f("busy-check-all-%s", e->name)
- busy_check_all(fd, e, num_engines, TEST_BUSY);
- igt_subtest_f("busy-idle-check-all-%s", e->name)
- busy_check_all(fd, e, num_engines,
- TEST_BUSY | TEST_TRAILING_IDLE);
-
- /**
- * Test that when all except one engine are loaded all
- * loads are correctly reported.
- */
- igt_subtest_f("most-busy-check-all-%s", e->name)
- most_busy_check_all(fd, e, num_engines,
- TEST_BUSY);
- igt_subtest_f("most-busy-idle-check-all-%s", e->name)
- most_busy_check_all(fd, e, num_engines,
- TEST_BUSY |
- TEST_TRAILING_IDLE);
-
- /**
- * Test that semphore counters report no activity on
- * idle or busy engines.
- */
- igt_subtest_f("idle-no-semaphores-%s", e->name)
- no_sema(fd, e, 0);
-
- igt_subtest_f("busy-no-semaphores-%s", e->name)
- no_sema(fd, e, TEST_BUSY);
-
- igt_subtest_f("busy-idle-no-semaphores-%s", e->name)
- no_sema(fd, e, TEST_BUSY | TEST_TRAILING_IDLE);
-
- /**
- * Test that semaphore waits are correctly reported.
- */
- igt_subtest_f("semaphore-wait-%s", e->name)
- sema_wait(fd, e, TEST_BUSY);
-
- igt_subtest_f("semaphore-wait-idle-%s", e->name)
- sema_wait(fd, e,
- TEST_BUSY | TEST_TRAILING_IDLE);
-
- /**
- * Check that two perf clients do not influence each
- * others observations.
- */
- igt_subtest_f("multi-client-%s", e->name)
- multi_client(fd, e);
-
- /**
- * Check that reported usage is correct when PMU is
- * enabled after the batch is running.
- */
- igt_subtest_f("busy-start-%s", e->name)
- busy_start(fd, e);
-
- /**
- * Check that reported usage is correct when PMU is
- * enabled after two batches are running.
- */
- igt_subtest_f("busy-double-start-%s", e->name) {
- gem_require_contexts(fd);
- busy_double_start(fd, e);
- }
+ /**
+ * Test that a single engine reports load correctly.
+ */
+ igt_subtest_f("busy-%s", e->name)
+ single(fd, e, TEST_BUSY);
+ igt_subtest_f("busy-idle-%s", e->name)
+ single(fd, e, TEST_BUSY | TEST_TRAILING_IDLE);
- /**
- * Check that the PMU can be safely enabled in face of
- * interrupt-heavy engine load.
- */
- igt_subtest_f("enable-race-%s", e->name)
- test_enable_race(fd, e);
-
- /**
- * Check engine busyness accuracy is as expected.
- */
- for (i = 0; i < ARRAY_SIZE(pct); i++) {
- igt_subtest_f("busy-accuracy-%u-%s",
- pct[i], e->name)
- accuracy(fd, e, pct[i], 10);
- }
+ /**
+ * Test that when one engine is loaded other report no
+ * load.
+ */
+ igt_subtest_f("busy-check-all-%s", e->name)
+ busy_check_all(fd, e, num_engines, TEST_BUSY);
+ igt_subtest_f("busy-idle-check-all-%s", e->name)
+ busy_check_all(fd, e, num_engines,
+ TEST_BUSY | TEST_TRAILING_IDLE);
+
+ /**
+ * Test that when all except one engine are loaded all
+ * loads are correctly reported.
+ */
+ igt_subtest_f("most-busy-check-all-%s", e->name)
+ most_busy_check_all(fd, e, num_engines,
+ TEST_BUSY);
+ igt_subtest_f("most-busy-idle-check-all-%s", e->name)
+ most_busy_check_all(fd, e, num_engines,
+ TEST_BUSY |
+ TEST_TRAILING_IDLE);
- igt_subtest_f("busy-hang-%s", e->name) {
- igt_hang_t hang = igt_allow_hang(fd, 0, 0);
+ /**
+ * Test that semphore counters report no activity on
+ * idle or busy engines.
+ */
+ igt_subtest_f("idle-no-semaphores-%s", e->name)
+ no_sema(fd, e, 0);
- single(fd, e, TEST_BUSY | FLAG_HANG);
+ igt_subtest_f("busy-no-semaphores-%s", e->name)
+ no_sema(fd, e, TEST_BUSY);
- igt_disallow_hang(fd, hang);
- }
+ igt_subtest_f("busy-idle-no-semaphores-%s", e->name)
+ no_sema(fd, e, TEST_BUSY | TEST_TRAILING_IDLE);
+
+ /**
+ * Test that semaphore waits are correctly reported.
+ */
+ igt_subtest_f("semaphore-wait-%s", e->name)
+ sema_wait(fd, e, TEST_BUSY);
+
+ igt_subtest_f("semaphore-wait-idle-%s", e->name)
+ sema_wait(fd, e,
+ TEST_BUSY | TEST_TRAILING_IDLE);
+
+ /**
+ * Check that two perf clients do not influence each
+ * others observations.
+ */
+ igt_subtest_f("multi-client-%s", e->name)
+ multi_client(fd, e);
+
+ /**
+ * Check that reported usage is correct when PMU is
+ * enabled after the batch is running.
+ */
+ igt_subtest_f("busy-start-%s", e->name)
+ busy_start(fd, e);
+
+ /**
+ * Check that reported usage is correct when PMU is
+ * enabled after two batches are running.
+ */
+ igt_subtest_f("busy-double-start-%s", e->name) {
+ gem_require_contexts(fd);
+ busy_double_start(fd, e);
+ }
+
+ /**
+ * Check that the PMU can be safely enabled in face of
+ * interrupt-heavy engine load.
+ */
+ igt_subtest_f("enable-race-%s", e->name)
+ test_enable_race(fd, e);
+
+ /**
+ * Check engine busyness accuracy is as expected.
+ */
+ for (i = 0; i < ARRAY_SIZE(pct); i++) {
+ igt_subtest_f("busy-accuracy-%u-%s",
+ pct[i], e->name)
+ accuracy(fd, e, pct[i], 10);
+ }
+
+ igt_subtest_f("busy-hang-%s", e->name) {
+ igt_hang_t hang = igt_allow_hang(fd, 0, 0);
+
+ single(fd, e, TEST_BUSY | FLAG_HANG);
+
+ igt_disallow_hang(fd, hang);
}
/**
@@ -1901,19 +1895,12 @@ igt_main
}
__for_each_physical_engine(render_fd, e) {
- igt_subtest_group {
- igt_fixture {
- gem_context_has_engine(render_fd,
- 0, e->flags);
- }
-
- igt_subtest_f("render-node-busy-%s", e->name)
- single(render_fd, e, TEST_BUSY);
- igt_subtest_f("render-node-busy-idle-%s",
- e->name)
- single(render_fd, e,
- TEST_BUSY | TEST_TRAILING_IDLE);
- }
+ igt_subtest_f("render-node-busy-%s", e->name)
+ single(render_fd, e, TEST_BUSY);
+ igt_subtest_f("render-node-busy-idle-%s",
+ e->name)
+ single(render_fd, e,
+ TEST_BUSY | TEST_TRAILING_IDLE);
}
igt_fixture {