public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi@etezian.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH i-g-t] i915/gem_exec_nop: Keep a copy of the names
Date: Tue, 11 Feb 2020 02:42:55 +0200	[thread overview]
Message-ID: <20200211004255.GA2535@jack.zhora.eu> (raw)
In-Reply-To: <20200211003742.863630-1-chris@chris-wilson.co.uk>

Hi Chris,

On Tue, Feb 11, 2020 at 12:37:42AM +0000, Chris Wilson wrote:
> The engine names are now stored inside the iterator and not as static
> strings. If we wish to use them later, we need to make a copy.

But we are not using them later. Your patch just copies and frees
an array.

Is there a follow-up?

Andi

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  tests/i915/gem_exec_nop.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/i915/gem_exec_nop.c b/tests/i915/gem_exec_nop.c
> index ed9568e5a..fc7f11827 100644
> --- a/tests/i915/gem_exec_nop.c
> +++ b/tests/i915/gem_exec_nop.c
> @@ -436,7 +436,7 @@ static void parallel(int fd, uint32_t handle, int timeout)
>  	struct drm_i915_gem_execbuffer2 execbuf;
>  	struct drm_i915_gem_exec_object2 obj;
>  	unsigned engines[16];
> -	const char *names[16];
> +	char *names[16];
>  	unsigned nengine;
>  	unsigned long count;
>  	double time, sum;
> @@ -445,7 +445,7 @@ static void parallel(int fd, uint32_t handle, int timeout)
>  	nengine = 0;
>  	__for_each_physical_engine(fd, e) {
>  		engines[nengine] = e->flags;
> -		names[nengine++] = e->name;
> +		names[nengine++] = strdup(e->name);
>  
>  		time = nop_on_ring(fd, handle, e, 1, &count) / count;
>  		sum += time;
> @@ -485,10 +485,11 @@ static void parallel(int fd, uint32_t handle, int timeout)
>  		time = elapsed(&start, &now) / count;
>  		igt_info("%s: %ld cycles, %.3fus\n", names[child], count, 1e6*time);
>  	}
> +	while (nengine--)
> +		free(names[nengine]);
>  
>  	igt_waitchildren();
>  	igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> -
>  }
>  
>  static void series(int fd, uint32_t handle, int timeout)
> -- 
> 2.25.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-02-11  0:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11  0:37 [igt-dev] [PATCH i-g-t] i915/gem_exec_nop: Keep a copy of the names Chris Wilson
2020-02-11  0:42 ` Andi Shyti [this message]
2020-02-11 10:37   ` [igt-dev] [Intel-gfx] " Chris Wilson
2020-02-11 13:00     ` Tvrtko Ursulin
2020-02-11 13:05       ` Chris Wilson
2020-02-11 13:21         ` Tvrtko Ursulin
2020-02-11  1:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-02-12 13:52 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20200211004255.GA2535@jack.zhora.eu \
    --to=andi@etezian.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox