Skip to content

Commit 88550e1

Browse files
tursulinjlahtine-intel
authored andcommitted
drm/i915/pmu: Do not use colons or dashes in PMU names
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 dash and colon characters we need to transliterate them to something else. We choose an underscore. v2: * Use strreplace. (Chris) * Dashes are not good either. (Chris) Signed-off-by: Tvrtko Ursulin <[email protected]> Reported-by: Dmitry Rogozhkin <[email protected]> Fixes: 0548867 ("drm/i915/pmu: Support multiple GPUs") Cc: Chris Wilson <[email protected]> Cc: Michal Wajdeczko <[email protected]> Cc: Andi Kleen <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit aebf3b5) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent dce54e8 commit 88550e1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/gpu/drm/i915/i915_pmu.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,12 +1074,17 @@ void i915_pmu_register(struct drm_i915_private *i915)
10741074
hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
10751075
pmu->timer.function = i915_sample;
10761076

1077-
if (!is_igp(i915))
1077+
if (!is_igp(i915)) {
10781078
pmu->name = kasprintf(GFP_KERNEL,
1079-
"i915-%s",
1079+
"i915_%s",
10801080
dev_name(i915->drm.dev));
1081-
else
1081+
if (pmu->name) {
1082+
/* tools/perf reserves colons as special. */
1083+
strreplace((char *)pmu->name, ':', '_');
1084+
}
1085+
} else {
10821086
pmu->name = "i915";
1087+
}
10831088
if (!pmu->name)
10841089
goto err;
10851090

0 commit comments

Comments
 (0)