summaryrefslogtreecommitdiff
path: root/tests/perf.c
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2018-02-28 13:59:37 +0000
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>2018-03-01 10:41:47 +0000
commita627cb3f2b8c8421fac612dffbc029fc72c38b0a (patch)
tree9e44442dc9362cc82822931d3faeece35ba31a9a /tests/perf.c
parent6a06d014a38fc8282f7dda7c11e5cacd9daf44ca (diff)
tests/perf: simplify enable-disable subtest
We're printing a bunch of values that were meant to try to figure out the issue of the OA unit not producing reports. After fixing the i915 driver with : https://patchwork.freedesktop.org/series/39112/ We don't need those values anymore. It turns out the issue was simply a race condition in the driver. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Diffstat (limited to 'tests/perf.c')
-rw-r--r--tests/perf.c47
1 files changed, 17 insertions, 30 deletions
diff --git a/tests/perf.c b/tests/perf.c
index 78bf6cdd..16c8aa39 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -2562,7 +2562,6 @@ test_enable_disable(void)
struct drm_i915_perf_record_header *header;
uint32_t first_timestamp = 0, last_timestamp = 0;
uint32_t last_periodic_report[64];
- double tick_per_period;
/* Giving enough time for an overflow might help catch whether
* the OA unit has been enabled even if the driver might at
@@ -2599,7 +2598,6 @@ test_enable_disable(void)
for (int offset = 0; offset < len; offset += header->size) {
uint32_t *report;
- double previous_tick_per_period;
header = (void *) (buf + offset);
report = (void *) (header + 1);
@@ -2612,38 +2610,27 @@ test_enable_disable(void)
first_timestamp = report[1];
last_timestamp = report[1];
- previous_tick_per_period = tick_per_period;
-
- if (n_periodic_reports > 0 &&
- oa_report_is_periodic(oa_exponent, report)) {
- tick_per_period =
- oa_reports_tick_per_period(last_periodic_report,
- report);
-
- if (!double_value_within(tick_per_period,
- previous_tick_per_period, 5))
- igt_debug("clock change!\n");
-
- igt_debug(" > report ts=%u"
- " ts_delta_last_periodic=%8u is_timer=%i ctx_id=%8x gpu_ticks=%u nb_periodic=%u\n",
- report[1],
- report[1] - last_periodic_report[1],
- oa_report_is_periodic(oa_exponent, report),
- oa_report_get_ctx_id(report),
- report[3] - last_periodic_report[3],
- n_periodic_reports);
+ igt_debug(" > report ts=%8x"
+ " ts_delta_last_periodic=%s%8u"
+ " is_timer=%i ctx_id=0x%8x\n",
+ report[1],
+ oa_report_is_periodic(oa_exponent, report) ? " " : "*",
+ n_periodic_reports > 0 ? (report[1] - last_periodic_report[1]) : 0,
+ oa_report_is_periodic(oa_exponent, report),
+ oa_report_get_ctx_id(report));
+ if (oa_report_is_periodic(oa_exponent, report)) {
memcpy(last_periodic_report, report,
sizeof(last_periodic_report));
- }
- /* We want to measure only the periodic
- * reports, ctx-switch might inflate the
- * content of the buffer and skew or
- * measurement.
- */
- n_periodic_reports +=
- oa_report_is_periodic(oa_exponent, report);
+ /* We want to measure only the
+ * periodic reports, ctx-switch
+ * might inflate the content of
+ * the buffer and skew or
+ * measurement.
+ */
+ n_periodic_reports++;
+ }
break;
case DRM_I915_PERF_RECORD_OA_BUFFER_LOST:
igt_assert(!"unexpected overflow");