public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/perf: add a stress test opening/closing the stream
@ 2020-02-27 10:17 Lionel Landwerlin
  2020-02-27 10:23 ` Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Lionel Landwerlin @ 2020-02-27 10:17 UTC (permalink / raw)
  To: igt-dev

This appears to trigger hard hangs...

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 tests/perf.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/tests/perf.c b/tests/perf.c
index d9bac561..d9ff4edb 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -3995,6 +3995,34 @@ test_rc6_disable(void)
 	igt_assert_neq(n_events_end - n_events_start, 0);
 }
 
+static void
+test_stress_open_close(void)
+{
+	igt_until_timeout(2) {
+		int oa_exponent = 5; /* 5 micro seconds */
+		uint64_t properties[] = {
+			/* XXX: even without periodic sampling we have to
+			 * specify at least one sample layout property...
+			 */
+			DRM_I915_PERF_PROP_SAMPLE_OA, true,
+
+			/* OA unit configuration */
+			DRM_I915_PERF_PROP_OA_METRICS_SET, test_set->perf_oa_metrics_set,
+			DRM_I915_PERF_PROP_OA_FORMAT, test_set->perf_oa_format,
+			DRM_I915_PERF_PROP_OA_EXPONENT, oa_exponent,
+		};
+		struct drm_i915_perf_open_param param = {
+			.flags = I915_PERF_FLAG_FD_CLOEXEC |
+			         I915_PERF_FLAG_DISABLED, /* XXX: open disabled */
+			.num_properties = sizeof(properties) / 16,
+			.properties_ptr = to_user_pointer(properties),
+		};
+
+		stream_fd = __perf_open(drm_fd, &param, false);
+		__perf_close(stream_fd);
+	}
+}
+
 static int __i915_perf_add_config(int fd, struct drm_i915_perf_oa_config *config)
 {
 	int ret = igt_ioctl(fd, DRM_IOCTL_I915_PERF_ADD_CONFIG, config);
@@ -4590,6 +4618,9 @@ igt_main
 	igt_subtest("rc6-disable")
 		test_rc6_disable();
 
+	igt_subtest("stress-open-close")
+		test_stress_open_close();
+
 	igt_subtest("invalid-create-userspace-config")
 		test_invalid_create_userspace_config();
 
-- 
2.25.1

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-28 14:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-27 10:17 [igt-dev] [PATCH i-g-t] tests/perf: add a stress test opening/closing the stream Lionel Landwerlin
2020-02-27 10:23 ` Chris Wilson
2020-02-27 11:10   ` Lionel Landwerlin
2020-02-27 14:04 ` [igt-dev] ✗ GitLab.Pipeline: failure for " Patchwork
2020-02-27 14:37 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2020-02-28 14:09 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox