[Intel-gfx] [PATCH i-g-t 24/29] igt/perf: fix rc6 test

Lionel Landwerlin lionel.g.landwerlin at intel.com
Tue Apr 25 22:32:56 UTC 2017


From: Robert Bragg <robert at sixbynine.org>

When measuring that rc6 doesn't happen, we need to do so after opening
the OA stream.

Signed-off-by: Robert Bragg <robert at sixbynine.org>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 tests/perf.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/perf.c b/tests/perf.c
index 887836e2..9fd40ff0 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -3444,12 +3444,13 @@ test_rc6_disable(void)
 		.num_properties = sizeof(properties) / 16,
 		.properties_ptr = to_user_pointer(properties),
 	};
-	uint64_t n_events_start = read_debugfs_u64_record(drm_fd, "i915_drpc_info",
-							  "RC6 residency since boot");
-	uint64_t n_events_end;
+	uint64_t n_events_start, n_events_end;
 
 	stream_fd = __perf_open(drm_fd, &param);
 
+	n_events_start = read_debugfs_u64_record(drm_fd, "i915_drpc_info",
+						 "RC6 residency since boot");
+
 	nanosleep(&(struct timespec){ .tv_sec = 0, .tv_nsec = 500000000 }, NULL);
 
 	n_events_end = read_debugfs_u64_record(drm_fd, "i915_drpc_info",
@@ -3462,7 +3463,7 @@ test_rc6_disable(void)
 	n_events_start = read_debugfs_u64_record(drm_fd, "i915_drpc_info",
 						 "RC6 residency since boot");
 
-	nanosleep(&(struct timespec){ .tv_sec = 0, .tv_nsec = 500000000 }, NULL);
+	nanosleep(&(struct timespec){ .tv_sec = 1, .tv_nsec = 0 }, NULL);
 
 	n_events_end = read_debugfs_u64_record(drm_fd, "i915_drpc_info",
 					       "RC6 residency since boot");
-- 
2.11.0



More information about the Intel-gfx mailing list