summaryrefslogtreecommitdiff
path: root/tests/perf_pmu.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-05-05 07:32:40 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-05-05 07:38:09 +0100
commitd9b69b3e0f0e48e55a3a0b5af36fc11e92f75f30 (patch)
tree55cbb173e2607b21d237ed54f2ad4afda91ed508 /tests/perf_pmu.c
parentab7bafeb9ccc687ecc62d162c7baf4eb403c8912 (diff)
i915/perf_pmu: Avoid skips inside forked children
For the unload test, we are trying to open as many pmu as possible, but don't require more than the first. Avoid the extra requires as some of the events will not be supported on all platforms. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests/perf_pmu.c')
-rw-r--r--tests/perf_pmu.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index d9270efb..206c8dd8 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1894,30 +1894,40 @@ static void test_unload(void)
igt_fork(child, 1) {
const struct intel_execution_engine2 *e;
uint64_t *buf;
- int count;
+ int count = 1;
int i915;
int fd;
i915 = __drm_open_driver(DRIVER_INTEL);
igt_debug("Opening perf events\n");
- fd = open_group(i915, I915_PMU_REQUESTED_FREQUENCY, -1);
- open_group(fd, I915_PMU_ACTUAL_FREQUENCY, fd);
- count = 2;
+ fd = open_group(i915, I915_PMU_INTERRUPTS, -1);
+
+ if (perf_i915_open_group(i915, I915_PMU_REQUESTED_FREQUENCY,fd))
+ count++;
+ if (perf_i915_open_group(i915, I915_PMU_ACTUAL_FREQUENCY, fd))
+ count++;
__for_each_physical_engine(i915, e) {
- open_group(i915,
- I915_PMU_ENGINE_BUSY(e->class, e->instance),
- fd);
- open_group(i915,
- I915_PMU_ENGINE_SEMA(e->class, e->instance),
- fd);
- open_group(i915,
- I915_PMU_ENGINE_WAIT(e->class, e->instance),
- fd);
- count += 3;
+ if (perf_i915_open_group(i915,
+ I915_PMU_ENGINE_BUSY(e->class, e->instance),
+ fd) != -1)
+ count++;
+
+ if (perf_i915_open_group(i915,
+ I915_PMU_ENGINE_SEMA(e->class, e->instance),
+ fd) != -1)
+ count++;
+
+ if (perf_i915_open_group(i915,
+ I915_PMU_ENGINE_WAIT(e->class, e->instance),
+ fd) != -1)
+ count++;
}
+ if (perf_i915_open_group(i915, I915_PMU_RC6_RESIDENCY,fd) != -1)
+ count++;
+
close(i915);
buf = calloc(count + 1, sizeof(uint64_t));