All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915/pmu: Do not use colons or dashes in PMU names
Date: Fri, 10 Jan 2020 11:44:15 +0000	[thread overview]
Message-ID: <157865665529.10140.7391297430834605705@skylake-alporthouse-com> (raw)
In-Reply-To: <20200110113253.12535-1-tvrtko.ursulin@linux.intel.com>

Quoting Tvrtko Ursulin (2020-01-10 11:32:53)
> 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
> 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: 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 | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
> index f3ef6700a5f2..28a82c849bac 100644
> --- a/drivers/gpu/drm/i915/i915_pmu.c
> +++ b/drivers/gpu/drm/i915/i915_pmu.c
> @@ -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;

Sadly I have no nicer suggestion, so
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-01-10 11:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=157865665529.10140.7391297430834605705@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=ak@linux.intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.