On Sun, Mar 9, 2008 at 10:15 PM, Julian Seward <[EMAIL PROTECTED]> wrote:
> On Sunday 09 March 2008 14:38, Bart Van Assche wrote:
>  > As far as I understood the libgomp source code directly, libgomp has
>  > its own barrier implementation based on the futex system call. This
>  > means that if I want to support OpenMP in DRD, I have to intercept the
>  > futex system call.
>
>  sys_futex is only called (iow, the kernel is only involved) when a
>  lock is contended.  Since that is in general very rare, monitoring
>  sys_futex will not work as you will miss most inter-thread dependencies.
>
>  > Is there a better way than adding calls to
>  > appropriate tracking functions in PRE(sys_futex) and POST(sys_futex)
>  > (defined in coregrind/m_syswrap/syswrap-linux.c) ?
>
>  Patch libgomp as described in the README in the tarball and make
>  sure you configure the gcc build with --disable-linux-futex.

What I had in mind is to handle sys_futex() only when it is not called
from inside the POSIX threads library. Recompiling with
--disable-linux-futex is an even better solution from the point of
view of Helgrind and DRD. Can you explain the purpose of the libgomp
patch ? DRD does not report any false positives after recompiling
unmodified gcc 4.2.3 sources with --disable-linux-futex.

The most convenient solution for Valgrind users is that they are able
to use the libgomp library provided with their Linux distribution. I'm
not sure we will be able to convince the gcc developers and/or Linux
distributors to make --disable-linux-futex the default. Is it easy to
intercept system calls like sys_futex() at instrumentation time, such
that I do not have to modify the core/tool interface ?

Bart.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to