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

[Xen-changelog] [xen master] tools/libxc: Add Valgrind client requests



commit 171c6d7ac17e29e0f4dcf058aa6c4ee11088f6c7
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Tue Jun 10 15:41:07 2014 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Thu Jun 12 10:04:44 2014 +0100

    tools/libxc: Add Valgrind client requests
    
    Valgrind client requests can be used by code to provide extra debugging
    information about memory ranges, or to request checks at specific points.
    
    Reference:
      http://valgrind.org/docs/manual/mc-manual.html#mc-manual.clientreqs
    
    Client requests are safe to compile into code for running outside of
    valgrind.  Therefore, enable client requests whenever autoconf can find
    memcheck.h and debug builds are enabled.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
    CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    [ ijc -- reran autogen.sh ]
---
 tools/config.h.in        |    3 +++
 tools/configure          |    2 +-
 tools/configure.ac       |    2 +-
 tools/libxc/Makefile     |    3 +++
 tools/libxc/xc_private.h |    7 +++++++
 5 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/config.h.in b/tools/config.h.in
index 015f2a1..bb34f32 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -48,6 +48,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
+#undef HAVE_VALGRIND_MEMCHECK_H
+
 /* Define to 1 if you have the <yajl/yajl_version.h> header file. */
 #undef HAVE_YAJL_YAJL_VERSION_H
 
diff --git a/tools/configure b/tools/configure
index d4a7919..ea2ad80 100755
--- a/tools/configure
+++ b/tools/configure
@@ -8057,7 +8057,7 @@ fi
 esac
 
 # Checks for header files.
-for ac_header in yajl/yajl_version.h sys/eventfd.h
+for ac_header in yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" 
"$ac_includes_default"
diff --git a/tools/configure.ac b/tools/configure.ac
index 25d7ca3..89f1ac7 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -245,7 +245,7 @@ AC_CHECK_LIB([fdt], [fdt_create], [], [AC_MSG_ERROR([Could 
not find libfdt])])
 esac
 
 # Checks for header files.
-AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h])
+AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h])
 
 AC_OUTPUT()
 
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index a74b19e..215101d 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -104,6 +104,9 @@ GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
 OSDEP_LIB_OBJS := $(patsubst %.c,%.o,$(OSDEP_SRCS-y))
 OSDEP_PIC_OBJS := $(patsubst %.c,%.opic,$(OSDEP_SRCS-y))
 
+$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) $(OSDEP_LIB_OBJS) \
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS) $(OSDEP_PIC_OBJS) : CFLAGS += -include 
$(XEN_ROOT)/tools/config.h
+
 LIB := libxenctrl.a
 ifneq ($(stubdom),y)
 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 4447cec..c7730f2 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -34,6 +34,13 @@
 
 #include <xen/sys/privcmd.h>
 
+#if defined(HAVE_VALGRIND_MEMCHECK_H) && !defined(NDEBUG)
+/* 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
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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