[ofa-general] [PATCH] librdmacm 1/2: add valgrind support to auto-tools configuration file

Dotan Barak dotanb at dev.mellanox.co.il
Thu Aug 16 02:03:10 PDT 2007


Sean Hefty wrote:
>> +if test x$with_valgrind = x || test x$with_valgrind = xno; then
>> +    want_valgrind=no
>> +    AC_DEFINE([NVALGRIND], 1, [Define to 1 to disable Valgrind 
>> annotations.])
>
>
>> +AC_CHECK_HEADER(valgrind/memcheck.h,
>> +    [AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
>> +        [Define to 1 if you have the <valgrind/memcheck.h> header 
>> file.])],
>
> What's the difference between including memcheck.h with NVALGRIND=1, 
> versus not including it if valgrind support is not enabled.
>
> - Sean
>
Here is some text from the file valgrind.h that will answer this question:

/* This file is for inclusion into client (your!) code.

   You can use these macros to manipulate and query Valgrind's
   execution inside your own programs.

   The resulting executables will still run without Valgrind, just a
   little bit more slowly than they otherwise would, but otherwise
   unchanged.  When not running on valgrind, each client request
   consumes very few (eg. 7) instructions, so the resulting performance
   loss is negligible unless you plan to execute client requests
   millions of times per second.  Nevertheless, if that is still a
   problem, you can compile with the NVALGRIND symbol defined (gcc
   -DNVALGRIND) so that client requests are not even compiled in.  */



thanks
Dotan



More information about the general mailing list