All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib: Silence Valgrind warning in synce_fence_status
Date: Thu, 27 Jun 2019 16:59:52 +0300	[thread overview]
Message-ID: <87v9wrp1rb.fsf@intel.com> (raw)
In-Reply-To: <20190627125521.10782-1-tvrtko.ursulin@linux.intel.com>

On Thu, 27 Jun 2019, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Let Valgrind know the ioctl initializes the passed in info block to reduce
> the noise while debugging.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  lib/sw_sync.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/lib/sw_sync.c b/lib/sw_sync.c
> index f208603312c2..73f3f7015d9d 100644
> --- a/lib/sw_sync.c
> +++ b/lib/sw_sync.c
> @@ -41,6 +41,15 @@
>  #include "drmtest.h"
>  #include "ioctl_wrappers.h"
>  
> +#ifdef HAVE_VALGRIND
> +#include <valgrind/valgrind.h>
> +#include <valgrind/memcheck.h>
> +
> +#define VG(x) x
> +#else
> +#define VG(x) do {} while (0)

OOC, why not just

#define VALGRIND_MAKE_MEM_DEFINED(...)

BR,
Jani.

> +#endif
> +
>  /**
>   * SECTION:sw_sync
>   * @short_description: Software sync (fencing) support library
> @@ -218,6 +227,8 @@ int sync_fence_status(int fence)
>  	if (file_info.num_fences != 1)
>  		return -EINVAL;
>  
> +	VG(VALGRIND_MAKE_MEM_DEFINED(&fence_info, sizeof(fence_info)));
> +
>  	return fence_info.status;
>  }

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] lib: Silence Valgrind warning in synce_fence_status
Date: Thu, 27 Jun 2019 16:59:52 +0300	[thread overview]
Message-ID: <87v9wrp1rb.fsf@intel.com> (raw)
In-Reply-To: <20190627125521.10782-1-tvrtko.ursulin@linux.intel.com>

On Thu, 27 Jun 2019, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Let Valgrind know the ioctl initializes the passed in info block to reduce
> the noise while debugging.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  lib/sw_sync.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/lib/sw_sync.c b/lib/sw_sync.c
> index f208603312c2..73f3f7015d9d 100644
> --- a/lib/sw_sync.c
> +++ b/lib/sw_sync.c
> @@ -41,6 +41,15 @@
>  #include "drmtest.h"
>  #include "ioctl_wrappers.h"
>  
> +#ifdef HAVE_VALGRIND
> +#include <valgrind/valgrind.h>
> +#include <valgrind/memcheck.h>
> +
> +#define VG(x) x
> +#else
> +#define VG(x) do {} while (0)

OOC, why not just

#define VALGRIND_MAKE_MEM_DEFINED(...)

BR,
Jani.

> +#endif
> +
>  /**
>   * SECTION:sw_sync
>   * @short_description: Software sync (fencing) support library
> @@ -218,6 +227,8 @@ int sync_fence_status(int fence)
>  	if (file_info.num_fences != 1)
>  		return -EINVAL;
>  
> +	VG(VALGRIND_MAKE_MEM_DEFINED(&fence_info, sizeof(fence_info)));
> +
>  	return fence_info.status;
>  }

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-06-27 13:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 12:55 [PATCH i-g-t] lib: Silence Valgrind warning in synce_fence_status Tvrtko Ursulin
2019-06-27 12:55 ` [igt-dev] " Tvrtko Ursulin
2019-06-27 13:06 ` Chris Wilson
2019-06-27 13:06   ` Chris Wilson
2019-06-27 13:59   ` Tvrtko Ursulin
2019-06-27 13:59     ` Tvrtko Ursulin
2019-06-27 14:06     ` Chris Wilson
2019-06-27 14:06       ` Chris Wilson
2019-06-27 13:59 ` Jani Nikula [this message]
2019-06-27 13:59   ` [Intel-gfx] " Jani Nikula
2019-06-27 14:01   ` Tvrtko Ursulin
2019-06-27 14:01     ` Tvrtko Ursulin
2019-06-27 14:01   ` Chris Wilson
2019-06-27 14:01     ` [igt-dev] [Intel-gfx] " Chris Wilson
2019-06-27 14:04   ` [igt-dev] " Jani Nikula
2019-06-27 14:04     ` Jani Nikula
2019-06-27 14:42 ` [igt-dev] ✗ Fi.CI.BAT: failure for " 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=87v9wrp1rb.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --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.