public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t] perf_pmu: Remove redundant check for engine
Date: Wed,  5 Jun 2019 15:38:15 +0300	[thread overview]
Message-ID: <20190605123815.28529-1-petri.latvala@intel.com> (raw)

__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>
---
 tests/perf_pmu.c | 223 ++++++++++++++++++++++-------------------------
 1 file 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 {
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-06-05 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 12:38 Petri Latvala [this message]
2019-06-05 14:17 ` [igt-dev] ✓ Fi.CI.BAT: success for perf_pmu: Remove redundant check for engine Patchwork
2019-06-06  9:46 ` [igt-dev] [PATCH i-g-t] " Andi Shyti
2019-06-06 23:37 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190605123815.28529-1-petri.latvala@intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox