mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-21 17:51:17 +07:00
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 <tvrtko.ursulin@intel.com>
Reported-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Fixes: 05488673a4
("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>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200110113253.12535-1-tvrtko.ursulin@linux.intel.com
This commit is contained in:
parent
d713e3ab93
commit
aebf3b521b
@ -1117,12 +1117,17 @@ 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",
|
||||
"i915_%s",
|
||||
dev_name(i915->drm.dev));
|
||||
else
|
||||
if (pmu->name) {
|
||||
/* tools/perf reserves colons as special. */
|
||||
strreplace((char *)pmu->name, ':', '_');
|
||||
}
|
||||
} else {
|
||||
pmu->name = "i915";
|
||||
}
|
||||
if (!pmu->name)
|
||||
goto err;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user