diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-01-03 17:11:17 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-01-14 10:29:08 +0000 |
commit | 97fbc5e17b47e96f2be3d20bcde7e16e137a17de (patch) | |
tree | 74bccaf3e3394aa58366c4b51b1cc8b701f1cdab /tests/i915/gem_exec_balancer.c | |
parent | 7239a5c9c721ce29725df659fa4959b723aeb0a1 (diff) |
i915/perf: Find the associated perf-type for a particular device
Since with multiple devices, we may have multiple different perf_pmu
each with their own type, we want to find the right one for the job.
The tests are run with a specific fd, from which we can extract the
appropriate bus-id and find the associated perf-type. The performance
monitoring tools are a little more general and not yet ready to probe
all device or bind to one in particular, so we just assume the default
igfx for the time being.
v2: Extract the bus address from out of sysfs
v3: A new name for a new decade!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: "Robert M. Fosha" <robert.m.fosha@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: "Robert M. Fosha" <robert.m.fosha@intel.com> #v2
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests/i915/gem_exec_balancer.c')
-rw-r--r-- | tests/i915/gem_exec_balancer.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c index f4909a97..cebcc39c 100644 --- a/tests/i915/gem_exec_balancer.c +++ b/tests/i915/gem_exec_balancer.c @@ -60,7 +60,7 @@ static bool has_class_instance(int i915, uint16_t class, uint16_t instance) { int fd; - fd = perf_i915_open(I915_PMU_ENGINE_BUSY(class, instance)); + fd = perf_i915_open(i915, I915_PMU_ENGINE_BUSY(class, instance)); if (fd != -1) { close(fd); return true; @@ -483,9 +483,11 @@ static void measure_all_load(int pmu, double *v, unsigned int num, int period_us } } -static int add_pmu(int pmu, const struct i915_engine_class_instance *ci) +static int +add_pmu(int i915, int pmu, const struct i915_engine_class_instance *ci) { - return perf_i915_open_group(I915_PMU_ENGINE_BUSY(ci->engine_class, + return perf_i915_open_group(i915, + I915_PMU_ENGINE_BUSY(ci->engine_class, ci->engine_instance), pmu); } @@ -514,7 +516,8 @@ static void check_individual_engine(int i915, double load; int pmu; - pmu = perf_i915_open(I915_PMU_ENGINE_BUSY(ci[idx].engine_class, + pmu = perf_i915_open(i915, + I915_PMU_ENGINE_BUSY(ci[idx].engine_class, ci[idx].engine_instance)); spin = igt_spin_new(i915, .ctx = ctx, .engine = idx + 1); @@ -636,8 +639,9 @@ static void bonded(int i915, unsigned int flags) pmu[0] = -1; for (int i = 0; i < limit; i++) - pmu[i] = add_pmu(pmu[0], &siblings[i]); - pmu[limit] = add_pmu(pmu[0], &master_engines[bond]); + pmu[i] = add_pmu(i915, pmu[0], &siblings[i]); + pmu[limit] = add_pmu(i915, + pmu[0], &master_engines[bond]); igt_assert(siblings[bond].engine_class != master_engines[bond].engine_class); @@ -1346,7 +1350,7 @@ static void full(int i915, unsigned int flags) for (unsigned int n = 0; n < count; n++) { uint32_t ctx; - pmu[n] = add_pmu(pmu[0], &ci[n]); + pmu[n] = add_pmu(i915, pmu[0], &ci[n]); if (flags & PULSE) { struct drm_i915_gem_execbuffer2 eb = { |