* [PATCH] multipath-tools: sync valgrind.h with 3.12 upstream
@ 2017-02-20 13:37 Xose Vazquez Perez
2017-02-24 21:18 ` Bart Van Assche
2017-02-27 5:48 ` Christophe Varoqui
0 siblings, 2 replies; 3+ messages in thread
From: Xose Vazquez Perez @ 2017-02-20 13:37 UTC (permalink / raw)
Cc: Bart Van Assche, device-mapper development, Xose Vazquez Perez
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
---
third-party/valgrind/valgrind.h | 40 +++++++++++++++++++++++++++++++++++++---
1 file changed, 37 insertions(+), 3 deletions(-)
diff --git a/third-party/valgrind/valgrind.h b/third-party/valgrind/valgrind.h
index 4b8ef75..6892007 100644
--- a/third-party/valgrind/valgrind.h
+++ b/third-party/valgrind/valgrind.h
@@ -89,7 +89,7 @@
|| (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6))
*/
#define __VALGRIND_MAJOR__ 3
-#define __VALGRIND_MINOR__ 11
+#define __VALGRIND_MINOR__ 12
#include <stdarg.h>
@@ -946,7 +946,7 @@ typedef
"move %0, $11\n\t" /*result*/ \
: "=r" (_zzq_result) \
: "r" (_zzq_default), "r" (&_zzq_args[0]) \
- : "$11", "$12"); \
+ : "$11", "$12", "memory"); \
_zzq_result; \
})
@@ -1017,7 +1017,7 @@ typedef
"move %0, $11\n\t" /*result*/ \
: "=r" (_zzq_result) \
: "r" (_zzq_default), "r" (&_zzq_args[0]) \
- : "$11", "$12"); \
+ : "$11", "$12", "memory"); \
_zzq_result; \
})
@@ -6759,6 +6759,7 @@ __inline
VALGRIND_PRINTF(const char *format, ...)
{
#if defined(NVALGRIND)
+ if (format) *(volatile const char *)format; /* avoid compiler warning */
return 0;
#else /* NVALGRIND */
#if defined(_MSC_VER) || defined(__MINGW64__)
@@ -6797,6 +6798,7 @@ __inline
VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
{
#if defined(NVALGRIND)
+ if (format) *(volatile const char *)format; /* avoid compiler warning */
return 0;
#else /* NVALGRIND */
#if defined(_MSC_VER) || defined(__MINGW64__)
@@ -7007,6 +7009,38 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL, \
pool, rzB, is_zeroed, 0, 0)
+/* Create a memory pool with some flags specifying extended behaviour.
+ When flags is zero, the behaviour is identical to VALGRIND_CREATE_MEMPOOL.
+
+ The flag VALGRIND_MEMPOOL_METAPOOL specifies that the pieces of memory
+ associated with the pool using VALGRIND_MEMPOOL_ALLOC will be used
+ by the application as superblocks to dole out MALLOC_LIKE blocks using
+ VALGRIND_MALLOCLIKE_BLOCK. In other words, a meta pool is a "2 levels"
+ pool : first level is the blocks described by VALGRIND_MEMPOOL_ALLOC.
+ The second level blocks are described using VALGRIND_MALLOCLIKE_BLOCK.
+ Note that the association between the pool and the second level blocks
+ is implicit : second level blocks will be located inside first level
+ blocks. It is necessary to use the VALGRIND_MEMPOOL_METAPOOL flag
+ for such 2 levels pools, as otherwise valgrind will detect overlapping
+ memory blocks, and will abort execution (e.g. during leak search).
+
+ Such a meta pool can also be marked as an 'auto free' pool using the flag
+ VALGRIND_MEMPOOL_AUTO_FREE, which must be OR-ed together with the
+ VALGRIND_MEMPOOL_METAPOOL. For an 'auto free' pool, VALGRIND_MEMPOOL_FREE
+ will automatically free the second level blocks that are contained
+ inside the first level block freed with VALGRIND_MEMPOOL_FREE.
+ In other words, calling VALGRIND_MEMPOOL_FREE will cause implicit calls
+ to VALGRIND_FREELIKE_BLOCK for all the second level blocks included
+ in the first level block.
+ Note: it is an error to use the VALGRIND_MEMPOOL_AUTO_FREE flag
+ without the VALGRIND_MEMPOOL_METAPOOL flag.
+*/
+#define VALGRIND_MEMPOOL_AUTO_FREE 1
+#define VALGRIND_MEMPOOL_METAPOOL 2
+#define VALGRIND_CREATE_MEMPOOL_EXT(pool, rzB, is_zeroed, flags) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL, \
+ pool, rzB, is_zeroed, flags, 0)
+
/* Destroy a memory pool. */
#define VALGRIND_DESTROY_MEMPOOL(pool) \
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DESTROY_MEMPOOL, \
--
2.11.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] multipath-tools: sync valgrind.h with 3.12 upstream
2017-02-20 13:37 [PATCH] multipath-tools: sync valgrind.h with 3.12 upstream Xose Vazquez Perez
@ 2017-02-24 21:18 ` Bart Van Assche
2017-02-27 5:48 ` Christophe Varoqui
1 sibling, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2017-02-24 21:18 UTC (permalink / raw)
To: xose.vazquez@gmail.com; +Cc: dm-devel@redhat.com
On Mon, 2017-02-20 at 14:37 +0100, Xose Vazquez Perez wrote:
> Cc: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
> Cc: device-mapper development <dm-devel@redhat.com>
> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] multipath-tools: sync valgrind.h with 3.12 upstream
2017-02-20 13:37 [PATCH] multipath-tools: sync valgrind.h with 3.12 upstream Xose Vazquez Perez
2017-02-24 21:18 ` Bart Van Assche
@ 2017-02-27 5:48 ` Christophe Varoqui
1 sibling, 0 replies; 3+ messages in thread
From: Christophe Varoqui @ 2017-02-27 5:48 UTC (permalink / raw)
To: Xose Vazquez Perez; +Cc: Bart Van Assche, device-mapper development
[-- Attachment #1.1: Type: text/plain, Size: 4808 bytes --]
Applied.
On Mon, Feb 20, 2017 at 2:37 PM, Xose Vazquez Perez <xose.vazquez@gmail.com>
wrote:
> Cc: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
> Cc: device-mapper development <dm-devel@redhat.com>
> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
> ---
> third-party/valgrind/valgrind.h | 40 ++++++++++++++++++++++++++++++
> +++++++---
> 1 file changed, 37 insertions(+), 3 deletions(-)
>
> diff --git a/third-party/valgrind/valgrind.h b/third-party/valgrind/
> valgrind.h
> index 4b8ef75..6892007 100644
> --- a/third-party/valgrind/valgrind.h
> +++ b/third-party/valgrind/valgrind.h
> @@ -89,7 +89,7 @@
> || (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6))
> */
> #define __VALGRIND_MAJOR__ 3
> -#define __VALGRIND_MINOR__ 11
> +#define __VALGRIND_MINOR__ 12
>
>
> #include <stdarg.h>
> @@ -946,7 +946,7 @@ typedef
> "move %0, $11\n\t" /*result*/ \
> : "=r" (_zzq_result) \
> : "r" (_zzq_default), "r" (&_zzq_args[0]) \
> - : "$11", "$12"); \
> + : "$11", "$12", "memory"); \
> _zzq_result; \
> })
>
> @@ -1017,7 +1017,7 @@ typedef
> "move %0, $11\n\t" /*result*/ \
> : "=r" (_zzq_result) \
> : "r" (_zzq_default), "r" (&_zzq_args[0]) \
> - : "$11", "$12"); \
> + : "$11", "$12", "memory"); \
> _zzq_result; \
> })
>
> @@ -6759,6 +6759,7 @@ __inline
> VALGRIND_PRINTF(const char *format, ...)
> {
> #if defined(NVALGRIND)
> + if (format) *(volatile const char *)format; /* avoid compiler
> warning */
> return 0;
> #else /* NVALGRIND */
> #if defined(_MSC_VER) || defined(__MINGW64__)
> @@ -6797,6 +6798,7 @@ __inline
> VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
> {
> #if defined(NVALGRIND)
> + if (format) *(volatile const char *)format; /* avoid compiler
> warning */
> return 0;
> #else /* NVALGRIND */
> #if defined(_MSC_VER) || defined(__MINGW64__)
> @@ -7007,6 +7009,38 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
> VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL, \
> pool, rzB, is_zeroed, 0, 0)
>
> +/* Create a memory pool with some flags specifying extended behaviour.
> + When flags is zero, the behaviour is identical to
> VALGRIND_CREATE_MEMPOOL.
> +
> + The flag VALGRIND_MEMPOOL_METAPOOL specifies that the pieces of memory
> + associated with the pool using VALGRIND_MEMPOOL_ALLOC will be used
> + by the application as superblocks to dole out MALLOC_LIKE blocks using
> + VALGRIND_MALLOCLIKE_BLOCK. In other words, a meta pool is a "2 levels"
> + pool : first level is the blocks described by VALGRIND_MEMPOOL_ALLOC.
> + The second level blocks are described using VALGRIND_MALLOCLIKE_BLOCK.
> + Note that the association between the pool and the second level blocks
> + is implicit : second level blocks will be located inside first level
> + blocks. It is necessary to use the VALGRIND_MEMPOOL_METAPOOL flag
> + for such 2 levels pools, as otherwise valgrind will detect overlapping
> + memory blocks, and will abort execution (e.g. during leak search).
> +
> + Such a meta pool can also be marked as an 'auto free' pool using the
> flag
> + VALGRIND_MEMPOOL_AUTO_FREE, which must be OR-ed together with the
> + VALGRIND_MEMPOOL_METAPOOL. For an 'auto free' pool,
> VALGRIND_MEMPOOL_FREE
> + will automatically free the second level blocks that are contained
> + inside the first level block freed with VALGRIND_MEMPOOL_FREE.
> + In other words, calling VALGRIND_MEMPOOL_FREE will cause implicit calls
> + to VALGRIND_FREELIKE_BLOCK for all the second level blocks included
> + in the first level block.
> + Note: it is an error to use the VALGRIND_MEMPOOL_AUTO_FREE flag
> + without the VALGRIND_MEMPOOL_METAPOOL flag.
> +*/
> +#define VALGRIND_MEMPOOL_AUTO_FREE 1
> +#define VALGRIND_MEMPOOL_METAPOOL 2
> +#define VALGRIND_CREATE_MEMPOOL_EXT(pool, rzB, is_zeroed, flags) \
> + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL, \
> + pool, rzB, is_zeroed, flags, 0)
> +
> /* Destroy a memory pool. */
> #define VALGRIND_DESTROY_MEMPOOL(pool) \
> VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DESTROY_MEMPOOL, \
> --
> 2.11.1
>
>
[-- Attachment #1.2: Type: text/html, Size: 6395 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-27 5:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-20 13:37 [PATCH] multipath-tools: sync valgrind.h with 3.12 upstream Xose Vazquez Perez
2017-02-24 21:18 ` Bart Van Assche
2017-02-27 5:48 ` Christophe Varoqui
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.