All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/pmu: Do not use colon characters in PMU names
@ 2020-01-10 11:11 Tvrtko Ursulin
  2020-01-10 11:21 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tvrtko Ursulin @ 2020-01-10 11:11 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Andi Kleen

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

We use PCI device path in the registered PMU name in order to distinguish
between multiple GPUs. But since tools/perf reserves a special meaning to
the colon character we need to transliterate them to something else. We
choose a dash.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reported-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Fixes: 05488673a4d4 ("drm/i915/pmu: Support multiple GPUs")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_pmu.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index f3ef6700a5f2..ecbd0e1f1a90 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -1117,12 +1117,22 @@ void i915_pmu_register(struct drm_i915_private *i915)
 	hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	pmu->timer.function = i915_sample;
 
-	if (!is_igp(i915))
+	if (!is_igp(i915)) {
 		pmu->name = kasprintf(GFP_KERNEL,
 				      "i915-%s",
 				      dev_name(i915->drm.dev));
-	else
+		if (pmu->name) {
+			char *p;
+
+			/* tools/perf reserves colons as special. */
+			for (p = (char *)pmu->name; *p; p++) {
+				if (*p == ':')
+					*p = '-';
+			}
+		}
+	} else {
 		pmu->name = "i915";
+	}
 	if (!pmu->name)
 		goto err;
 
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-01-10 15:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-10 11:11 [Intel-gfx] [PATCH] drm/i915/pmu: Do not use colon characters in PMU names Tvrtko Ursulin
2020-01-10 11:21 ` Chris Wilson
2020-01-10 11:27   ` Tvrtko Ursulin
2020-01-10 11:32     ` Chris Wilson
2020-01-10 11:40       ` Tvrtko Ursulin
2020-01-10 11:32 ` [Intel-gfx] [PATCH v2] drm/i915/pmu: Do not use colons or dashes " Tvrtko Ursulin
2020-01-10 11:44   ` Chris Wilson
2020-01-10 15:47 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/pmu: Do not use colon characters in PMU names (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.