summaryrefslogtreecommitdiff
path: root/overlay
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-01-03 17:11:17 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2020-01-14 10:29:08 +0000
commit97fbc5e17b47e96f2be3d20bcde7e16e137a17de (patch)
tree74bccaf3e3394aa58366c4b51b1cc8b701f1cdab /overlay
parent7239a5c9c721ce29725df659fa4959b723aeb0a1 (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 'overlay')
-rw-r--r--overlay/gem-interrupts.c2
-rw-r--r--overlay/gpu-freq.c4
-rw-r--r--overlay/gpu-top.c12
-rw-r--r--overlay/rc6.c2
4 files changed, 10 insertions, 10 deletions
diff --git a/overlay/gem-interrupts.c b/overlay/gem-interrupts.c
index 0233fbb0..be73b693 100644
--- a/overlay/gem-interrupts.c
+++ b/overlay/gem-interrupts.c
@@ -113,7 +113,7 @@ int gem_interrupts_init(struct gem_interrupts *irqs)
{
memset(irqs, 0, sizeof(*irqs));
- irqs->fd = perf_i915_open(I915_PMU_INTERRUPTS);
+ irqs->fd = perf_igfx_open(I915_PMU_INTERRUPTS);
if (irqs->fd < 0 && interrupts_read() < 0)
irqs->error = ENODEV;
diff --git a/overlay/gpu-freq.c b/overlay/gpu-freq.c
index 0d803259..b73157d3 100644
--- a/overlay/gpu-freq.c
+++ b/overlay/gpu-freq.c
@@ -37,8 +37,8 @@ static int perf_open(void)
{
int fd;
- fd = perf_i915_open_group(I915_PMU_ACTUAL_FREQUENCY, -1);
- if (perf_i915_open_group(I915_PMU_REQUESTED_FREQUENCY, fd) < 0) {
+ fd = perf_igfx_open_group(I915_PMU_ACTUAL_FREQUENCY, -1);
+ if (perf_igfx_open_group(I915_PMU_REQUESTED_FREQUENCY, fd) < 0) {
close(fd);
fd = -1;
}
diff --git a/overlay/gpu-top.c b/overlay/gpu-top.c
index 6cec2e94..32123abd 100644
--- a/overlay/gpu-top.c
+++ b/overlay/gpu-top.c
@@ -58,16 +58,16 @@ static int perf_init(struct gpu_top *gt)
d = &engines[0];
- gt->fd = perf_i915_open_group(I915_PMU_ENGINE_BUSY(d->class, d->inst),
+ gt->fd = perf_igfx_open_group(I915_PMU_ENGINE_BUSY(d->class, d->inst),
-1);
if (gt->fd < 0)
return -1;
- if (perf_i915_open_group(I915_PMU_ENGINE_WAIT(d->class, d->inst),
+ if (perf_igfx_open_group(I915_PMU_ENGINE_WAIT(d->class, d->inst),
gt->fd) >= 0)
gt->have_wait = 1;
- if (perf_i915_open_group(I915_PMU_ENGINE_SEMA(d->class, d->inst),
+ if (perf_igfx_open_group(I915_PMU_ENGINE_SEMA(d->class, d->inst),
gt->fd) >= 0)
gt->have_sema = 1;
@@ -75,19 +75,19 @@ static int perf_init(struct gpu_top *gt)
gt->num_rings = 1;
for (d++; d->name; d++) {
- if (perf_i915_open_group(I915_PMU_ENGINE_BUSY(d->class,
+ if (perf_igfx_open_group(I915_PMU_ENGINE_BUSY(d->class,
d->inst),
gt->fd) < 0)
continue;
if (gt->have_wait &&
- perf_i915_open_group(I915_PMU_ENGINE_WAIT(d->class,
+ perf_igfx_open_group(I915_PMU_ENGINE_WAIT(d->class,
d->inst),
gt->fd) < 0)
return -1;
if (gt->have_sema &&
- perf_i915_open_group(I915_PMU_ENGINE_SEMA(d->class,
+ perf_igfx_open_group(I915_PMU_ENGINE_SEMA(d->class,
d->inst),
gt->fd) < 0)
return -1;
diff --git a/overlay/rc6.c b/overlay/rc6.c
index b5286f0c..69f95f28 100644
--- a/overlay/rc6.c
+++ b/overlay/rc6.c
@@ -39,7 +39,7 @@ int rc6_init(struct rc6 *rc6)
{
memset(rc6, 0, sizeof(*rc6));
- rc6->fd = perf_i915_open(I915_PMU_RC6_RESIDENCY);
+ rc6->fd = perf_igfx_open(I915_PMU_RC6_RESIDENCY);
if (rc6->fd < 0) {
struct stat st;
if (stat("/sys/class/drm/card0/power", &st) < 0)