|
From: Konstantin S. <kon...@gm...> - 2009-05-29 11:50:26
|
On Fri, May 29, 2009 at 3:19 PM, Bart Van Assche <bar...@gm...> wrote: > On Fri, May 29, 2009 at 12:58 PM, Konstantin Serebryany > <kon...@gm...> wrote: >> [changed subject] >> >> Do you plan to support annotations (aka client requests) in Helgrind >> and DRD in a compatible way (and possibly, in a way compatible with >> ThreadSanitizer)? >> Something like http://code.google.com/p/google-perftools/source/browse/trunk/src/base/dynamic_annotations.h, >> or completely different. >> Our experience shows that even a pure-happens-before race detector is >> completely useless w/o annotations if your code has lock-less >> synchronization and hundreds of benign races. > > Regarding the dynamic_annotations.h header file: which parts are > generic and which parts are ThreadSanitizer-specific ? Most are generic. But some of the annotations are usually required only with hybrid detectors. E.g. ANNOTATE_PUBLISH_MEMORY will be needed with a pure-h-b detector only if you publish your objects w/o locks. > I assume that > client programs should use the ANNOTATE_*() macro's and not the > Annotate*() functions ? Correct. Annotate*() functions are implementation details and may change. (comment at line 267) > > I assume that you have already developed unit tests for these macro's > in ThreadSanitizer. http://code.google.com/p/data-race-test/source/browse/trunk/unittest/racecheck_unittest.cc is a set of unittests for ThreadSanitizer. Some of the tests specifically test the annotations. > Are available under the GPL ? Yes, GPL v2+ As for annotations, I think they should go under a BSD-like license (as valgrind.h does) > > One aspect of the dynamic_annotations.h header file that I do not like > is that enabling / disabling the ANNOTATE*() macro's is controlled by > the NDEBUG macro. IMHO a new macro should be defined that allows to > enable / disable the ANNOTATE*() macro's. I don't have a strong opinion here. > > Adding support for the ANNOTATE_*() macro's in drd/drd.h is probably > not too hard. I'll have a look at it. Implementation-wise you need to support Annotate*() functions, or rewrite ANNOTATE*() macro's using client requests and support those client requests. I find the approach with Annotate*() functions simpler to maintain. --kcc > > Bart. > |