[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 6/6] tools/libxc: Add Valgrind client requests



On Mon, 2014-06-09 at 16:41 +0100, Andrew Cooper wrote:
> diff --git a/tools/configure.ac b/tools/configure.ac
> index 25d7ca3..452cfd5 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -246,6 +246,8 @@ esac
>  
>  # Checks for header files.
>  AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h])
> +AC_CHECK_HEADER([valgrind/memcheck.h], [HAVE_MEMCHECK_H="y"])
> +AC_SUBST(HAVE_MEMCHECK_H)

If you use AC_CHECK_HEADERS (just extending the list right above) then
autoconf will give you HAVE_VALGRIND_MEMCHECK_H automatically, including
in config.h I think.

>  
>  AC_OUTPUT()
>  
> diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
> index a74b19e..3d55757 100644
> --- a/tools/libxc/Makefile
> +++ b/tools/libxc/Makefile
> @@ -95,6 +95,10 @@ CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
>  
>  CFLAGS       += $(PTHREAD_CFLAGS)
>  
> +ifeq ($(HAVE_MEMCHECK_H)$(debug),yy)
> +CFLAGS       += -DVALGRIND
> +endif

Which means that this can move become part of the conditional in
xc_private.h using NDEBUG and HAVE_VALGRIND_MEMCHECK_H.

> +
>  CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
>  CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
>  
> diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
> index 213f607..52d8c96 100644
> --- a/tools/libxc/xc_private.h
> +++ b/tools/libxc/xc_private.h
> @@ -34,6 +34,13 @@
>  
>  #include <xen/sys/privcmd.h>
>  
> +#ifdef VALGRIND
> +/* Compile in Valgrind client requests? */
> +#include <valgrind/memcheck.h>
> +#else
> +#define VALGRIND_MAKE_MEM_UNDEFINED(addr, len) /* addr, len */
> +#endif
> +
>  #define DECLARE_HYPERCALL privcmd_hypercall_t hypercall
>  #define DECLARE_DOMCTL struct xen_domctl domctl
>  #define DECLARE_SYSCTL struct xen_sysctl sysctl



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.