|
|
Created:
11 years, 3 months ago by the_wrong_timurrrr Modified:
11 years, 3 months ago CC:
chromium-reviews_googlegroups.com, brettw, kcc Base URL:
http://src.chromium.org/svn/trunk/src/ Visibility:
Public. |
Descriptions/NDEBUG/NVALGRIND/g in base/dynamic_annotations.* to allow
ThreadSanitizer runs on release binaries.
Patch Set 1 #Patch Set 2 : '' #Patch Set 3 : '' #
Messages
Total messages: 5 (0 generated)
Hi Dan, Dean, Valgrind bots have recently switched to run release (O1) binaries. In the current version of base/dynamic_annotations.*, we strip ThreadSanitizer annotations if NDEBUG is defined. I've replaced NDEBUG with NVALGRIND. Can you please review this changelist? Thank you, Timur Iskhodzhanov
Do we already define NVALGRIND? We have an open bug on that, http://code.google.com/p/chromium/issues/detail?id=3D11927 and I didn't see it in a quick grep. On Wed, Sep 9, 2009 at 7:08 AM, <timurrrr@gmail.com> wrote: > > Reviewers: Dean McNamee, dank, > > Message: > Hi Dan, Dean, > > Valgrind bots have recently switched to run release (O1) binaries. > In the current version of base/dynamic_annotations.*, we strip > ThreadSanitizer annotations if NDEBUG is defined. > I've replaced NDEBUG with NVALGRIND. > > Can you please review this changelist? > > Thank you, > Timur Iskhodzhanov > > Description: > s/NDEBUG/NVALGRIND/g in base/dynamic_annotations.* to allow > ThreadSanitizer runs on release binaries. > > Please review this at http://codereview.chromium.org/201060 > > SVN Base: http://src.chromium.org/svn/trunk/src/ > > Affected files: > =A0M =A0 =A0 base/dynamic_annotations.h > =A0M =A0 =A0 base/dynamic_annotations.cc > > > Index: base/dynamic_annotations.cc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- base/dynamic_annotations.cc (revision 25716) > +++ base/dynamic_annotations.cc (working copy) > @@ -5,7 +5,7 @@ > =A0#include "base/dynamic_annotations.h" > =A0#include "base/third_party/valgrind/valgrind.h" > > -#ifndef NDEBUG > +#ifndef NVALGRIND > =A0// Each function is empty and called (via a macro) only in debug mode. > =A0// The arguments are captured by dynamic tools at runtime. > > @@ -56,7 +56,7 @@ > =A0extern "C" void AnnotateIgnoreWritesEnd(const char *file, int line) {} > =A0extern "C" void AnnotateNoOp(const char *file, int line, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const volatile= void *arg) {} > -#endif // NDEBUG > +#endif // NVALGRIND > > =A0// When running under valgrind, a non-zero value will be returned. > =A0extern "C" int RunningOnValgrind() { > Index: base/dynamic_annotations.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- base/dynamic_annotations.h =A0(revision 25716) > +++ base/dynamic_annotations.h =A0(working copy) > @@ -17,19 +17,16 @@ > =A0// dynamic analysis tool being used. > =A0// > =A0// This file supports the following dynamic analysis tools: > -// - None (NDEBUG is defined). > +// - None (NVALGRIND is defined). > =A0// =A0 =A0Macros are defined empty. > -// - ThreadSanitizer (NDEBUG is not defined). > +// - ThreadSanitizer (NVALGRIND is not defined). > =A0// =A0 =A0Macros are defined as calls to non-inlinable empty functions > =A0// =A0 =A0that are intercepted by ThreadSanitizer. > =A0// > =A0#ifndef BASE_DYNAMIC_ANNOTATIONS_H_ > =A0#define BASE_DYNAMIC_ANNOTATIONS_H_ > > -// All the annotation macros are in effect only in debug mode. > -#ifndef NDEBUG > -// Debug build. > - > +#ifndef NVALGRIND > =A0// ------------------------------------------------------------- > =A0// Annotations useful when implementing condition variables such as > CondVar, > =A0// using conditional critical sections (Await/LockWhen) and when > constructing > @@ -309,8 +306,8 @@ > =A0 =A0 static static_var ## _annotator the ## static_var ## _annotator;\ > =A0 } > > -#else =A0// NDEBUG is defined > -// Release build, empty macros. > +#else > +// NVALGRIND is defined, empty macros. > > =A0#define ANNOTATE_RWLOCK_CREATE(lock) // empty > =A0#define ANNOTATE_RWLOCK_DESTROY(lock) // empty > @@ -344,7 +341,7 @@ > =A0#define ANNOTATE_UNPROTECTED_READ(x) (x) > =A0#define ANNOTATE_BENIGN_RACE_STATIC(static_var, description) =A0// emp= ty > > -#endif =A0// NDEBUG > +#endif =A0// NVALGRIND > > =A0// Return non-zero value if running under valgrind. > =A0extern "C" int RunningOnValgrind(); > > >
I'm not sure, looks like we don't. Should we ask someone to define it? I'm not sure I'll do that right straightaway On 2009/09/09 14:13:05, not_the_right_dank wrote: > Do we already define NVALGRIND? We have an open > bug on that, > http://code.google.com/p/chromium/issues/detail?id=3D11927 > and I didn't see it in a quick grep. > > On Wed, Sep 9, 2009 at 7:08 AM, <mailto:timurrrr@gmail.com> wrote: > > > > Reviewers: Dean McNamee, dank, > > > > Message: > > Hi Dan, Dean, > > > > Valgrind bots have recently switched to run release (O1) binaries. > > In the current version of base/dynamic_annotations.*, we strip > > ThreadSanitizer annotations if NDEBUG is defined. > > I've replaced NDEBUG with NVALGRIND. > > > > Can you please review this changelist? > > > > Thank you, > > Timur Iskhodzhanov > > > > Description: > > s/NDEBUG/NVALGRIND/g in base/dynamic_annotations.* to allow > > ThreadSanitizer runs on release binaries. > > > > Please review this at http://codereview.chromium.org/201060 > > > > SVN Base: http://src.chromium.org/svn/trunk/src/ > > > > Affected files: > > =A0M =A0 =A0 base/dynamic_annotations.h > > =A0M =A0 =A0 base/dynamic_annotations.cc > > > > > > Index: base/dynamic_annotations.cc > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- base/dynamic_annotations.cc (revision 25716) > > +++ base/dynamic_annotations.cc (working copy) > > @@ -5,7 +5,7 @@ > > =A0#include "base/dynamic_annotations.h" > > =A0#include "base/third_party/valgrind/valgrind.h" > > > > -#ifndef NDEBUG > > +#ifndef NVALGRIND > > =A0// Each function is empty and called (via a macro) only in debug mode. > > =A0// The arguments are captured by dynamic tools at runtime. > > > > @@ -56,7 +56,7 @@ > > =A0extern "C" void AnnotateIgnoreWritesEnd(const char *file, int line) {} > > =A0extern "C" void AnnotateNoOp(const char *file, int line, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const volatile= > void *arg) {} > > -#endif // NDEBUG > > +#endif // NVALGRIND > > > > =A0// When running under valgrind, a non-zero value will be returned. > > =A0extern "C" int RunningOnValgrind() { > > Index: base/dynamic_annotations.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- base/dynamic_annotations.h =A0(revision 25716) > > +++ base/dynamic_annotations.h =A0(working copy) > > @@ -17,19 +17,16 @@ > > =A0// dynamic analysis tool being used. > > =A0// > > =A0// This file supports the following dynamic analysis tools: > > -// - None (NDEBUG is defined). > > +// - None (NVALGRIND is defined). > > =A0// =A0 =A0Macros are defined empty. > > -// - ThreadSanitizer (NDEBUG is not defined). > > +// - ThreadSanitizer (NVALGRIND is not defined). > > =A0// =A0 =A0Macros are defined as calls to non-inlinable empty functions > > =A0// =A0 =A0that are intercepted by ThreadSanitizer. > > =A0// > > =A0#ifndef BASE_DYNAMIC_ANNOTATIONS_H_ > > =A0#define BASE_DYNAMIC_ANNOTATIONS_H_ > > > > -// All the annotation macros are in effect only in debug mode. > > -#ifndef NDEBUG > > -// Debug build. > > - > > +#ifndef NVALGRIND > > =A0// ------------------------------------------------------------- > > =A0// Annotations useful when implementing condition variables such as > > CondVar, > > =A0// using conditional critical sections (Await/LockWhen) and when > > constructing > > @@ -309,8 +306,8 @@ > > =A0 =A0 static static_var ## _annotator the ## static_var ## _annotator;\ > > =A0 } > > > > -#else =A0// NDEBUG is defined > > -// Release build, empty macros. > > +#else > > +// NVALGRIND is defined, empty macros. > > > > =A0#define ANNOTATE_RWLOCK_CREATE(lock) // empty > > =A0#define ANNOTATE_RWLOCK_DESTROY(lock) // empty > > @@ -344,7 +341,7 @@ > > =A0#define ANNOTATE_UNPROTECTED_READ(x) (x) > > =A0#define ANNOTATE_BENIGN_RACE_STATIC(static_var, description) =A0// emp= > ty > > > > -#endif =A0// NDEBUG > > +#endif =A0// NVALGRIND > > > > =A0// Return non-zero value if running under valgrind. > > =A0extern "C" int RunningOnValgrind(); > > > > > >
I would rather flip the logic, ifdef COMPILING_FOR_VALGRIND. Makes it a lot harder to screw up and end up with valgrind specific code in our official binaries. On Thu, Sep 10, 2009 at 9:44 PM, <timurrrr@gmail.com> wrote: > I'm not sure, looks like we don't. > Should we ask someone to define it? I'm not sure I'll do that right > straightaway > > On 2009/09/09 14:13:05, not_the_right_dank wrote: >> >> Do we already define NVALGRIND? =A0We have an open >> bug on that, >> http://code.google.com/p/chromium/issues/detail?id=3D3D11927 >> and I didn't see it in a quick grep. > >> On Wed, Sep 9, 2009 at 7:08 AM, <mailto:timurrrr@gmail.com> wrote: >> > >> > Reviewers: Dean McNamee, dank, >> > >> > Message: >> > Hi Dan, Dean, >> > >> > Valgrind bots have recently switched to run release (O1) binaries. >> > In the current version of base/dynamic_annotations.*, we strip >> > ThreadSanitizer annotations if NDEBUG is defined. >> > I've replaced NDEBUG with NVALGRIND. >> > >> > Can you please review this changelist? >> > >> > Thank you, >> > Timur Iskhodzhanov >> > >> > Description: >> > s/NDEBUG/NVALGRIND/g in base/dynamic_annotations.* to allow >> > ThreadSanitizer runs on release binaries. >> > >> > Please review this at http://codereview.chromium.org/201060 >> > >> > SVN Base: http://src.chromium.org/svn/trunk/src/ >> > >> > Affected files: >> > =3DA0M =3DA0 =3DA0 base/dynamic_annotations.h >> > =3DA0M =3DA0 =3DA0 base/dynamic_annotations.cc >> > >> > >> > Index: base/dynamic_annotations.cc >> > >> > =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >> >> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D >> > --- base/dynamic_annotations.cc (revision 25716) >> > +++ base/dynamic_annotations.cc (working copy) >> > @@ -5,7 +5,7 @@ >> > =3DA0#include "base/dynamic_annotations.h" >> > =3DA0#include "base/third_party/valgrind/valgrind.h" >> > >> > -#ifndef NDEBUG >> > +#ifndef NVALGRIND >> > =3DA0// Each function is empty and called (via a macro) only in debug >> > mode. >> > =3DA0// The arguments are captured by dynamic tools at runtime. >> > >> > @@ -56,7 +56,7 @@ >> > =3DA0extern "C" void AnnotateIgnoreWritesEnd(const char *file, int lin= e) >> > {} >> > =3DA0extern "C" void AnnotateNoOp(const char *file, int line, >> > =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA= 0 =3DA0 =3DA0 =3DA0const >> > volatile=3D >> =A0void *arg) {} >> > -#endif // NDEBUG >> > +#endif // NVALGRIND >> > >> > =3DA0// When running under valgrind, a non-zero value will be returned= . >> > =3DA0extern "C" int RunningOnValgrind() { >> > Index: base/dynamic_annotations.h >> > >> > =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >> >> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D >> > --- base/dynamic_annotations.h =3DA0(revision 25716) >> > +++ base/dynamic_annotations.h =3DA0(working copy) >> > @@ -17,19 +17,16 @@ >> > =3DA0// dynamic analysis tool being used. >> > =3DA0// >> > =3DA0// This file supports the following dynamic analysis tools: >> > -// - None (NDEBUG is defined). >> > +// - None (NVALGRIND is defined). >> > =3DA0// =3DA0 =3DA0Macros are defined empty. >> > -// - ThreadSanitizer (NDEBUG is not defined). >> > +// - ThreadSanitizer (NVALGRIND is not defined). >> > =3DA0// =3DA0 =3DA0Macros are defined as calls to non-inlinable empty >> > functions >> > =3DA0// =3DA0 =3DA0that are intercepted by ThreadSanitizer. >> > =3DA0// >> > =3DA0#ifndef BASE_DYNAMIC_ANNOTATIONS_H_ >> > =3DA0#define BASE_DYNAMIC_ANNOTATIONS_H_ >> > >> > -// All the annotation macros are in effect only in debug mode. >> > -#ifndef NDEBUG >> > -// Debug build. >> > - >> > +#ifndef NVALGRIND >> > =3DA0// ------------------------------------------------------------- >> > =3DA0// Annotations useful when implementing condition variables such = as >> > CondVar, >> > =3DA0// using conditional critical sections (Await/LockWhen) and when >> > constructing >> > @@ -309,8 +306,8 @@ >> > =3DA0 =3DA0 static static_var ## _annotator the ## static_var ## >> > _annotator;\ >> > =3DA0 } >> > >> > -#else =3DA0// NDEBUG is defined >> > -// Release build, empty macros. >> > +#else >> > +// NVALGRIND is defined, empty macros. >> > >> > =3DA0#define ANNOTATE_RWLOCK_CREATE(lock) // empty >> > =3DA0#define ANNOTATE_RWLOCK_DESTROY(lock) // empty >> > @@ -344,7 +341,7 @@ >> > =3DA0#define ANNOTATE_UNPROTECTED_READ(x) (x) >> > =3DA0#define ANNOTATE_BENIGN_RACE_STATIC(static_var, description) =3DA= 0// >> > emp=3D >> ty >> > >> > -#endif =3DA0// NDEBUG >> > +#endif =3DA0// NVALGRIND >> > >> > =3DA0// Return non-zero value if running under valgrind. >> > =3DA0extern "C" int RunningOnValgrind(); >> > >> > >> > > > > > http://codereview.chromium.org/201060 >
I've created http://codereview.chromium.org/195078 to define NVALGRIND for non-valgrind builds On 2009/09/12 12:47:56, Dean McNamee wrote: > I would rather flip the logic, ifdef COMPILING_FOR_VALGRIND. Makes it > a lot harder to screw up and end up with valgrind specific code in our > official binaries. > > On Thu, Sep 10, 2009 at 9:44 PM, <mailto:timurrrr@gmail.com> wrote: > > I'm not sure, looks like we don't. > > Should we ask someone to define it? I'm not sure I'll do that right > > straightaway > > > > On 2009/09/09 14:13:05, not_the_right_dank wrote: > >> > >> Do we already define NVALGRIND? =A0We have an open > >> bug on that, > >> http://code.google.com/p/chromium/issues/detail?id=3D3D11927 > >> and I didn't see it in a quick grep. > > > >> On Wed, Sep 9, 2009 at 7:08 AM, <mailto:timurrrr@gmail.com> wrote: > >> > > >> > Reviewers: Dean McNamee, dank, > >> > > >> > Message: > >> > Hi Dan, Dean, > >> > > >> > Valgrind bots have recently switched to run release (O1) binaries. > >> > In the current version of base/dynamic_annotations.*, we strip > >> > ThreadSanitizer annotations if NDEBUG is defined. > >> > I've replaced NDEBUG with NVALGRIND. > >> > > >> > Can you please review this changelist? > >> > > >> > Thank you, > >> > Timur Iskhodzhanov > >> > > >> > Description: > >> > s/NDEBUG/NVALGRIND/g in base/dynamic_annotations.* to allow > >> > ThreadSanitizer runs on release binaries. > >> > > >> > Please review this at http://codereview.chromium.org/201060 > >> > > >> > SVN Base: http://src.chromium.org/svn/trunk/src/ > >> > > >> > Affected files: > >> > =3DA0M =3DA0 =3DA0 base/dynamic_annotations.h > >> > =3DA0M =3DA0 =3DA0 base/dynamic_annotations.cc > >> > > >> > > >> > Index: base/dynamic_annotations.cc > >> > > >> > =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= > =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D > >> > >> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= > =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D > >> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= > =3D3D=3D3D=3D3D=3D3D > >> > --- base/dynamic_annotations.cc (revision 25716) > >> > +++ base/dynamic_annotations.cc (working copy) > >> > @@ -5,7 +5,7 @@ > >> > =3DA0#include "base/dynamic_annotations.h" > >> > =3DA0#include "base/third_party/valgrind/valgrind.h" > >> > > >> > -#ifndef NDEBUG > >> > +#ifndef NVALGRIND > >> > =3DA0// Each function is empty and called (via a macro) only in debug > >> > mode. > >> > =3DA0// The arguments are captured by dynamic tools at runtime. > >> > > >> > @@ -56,7 +56,7 @@ > >> > =3DA0extern "C" void AnnotateIgnoreWritesEnd(const char *file, int lin= > e) > >> > {} > >> > =3DA0extern "C" void AnnotateNoOp(const char *file, int line, > >> > =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA0 =3DA= > 0 =3DA0 =3DA0 =3DA0const > >> > volatile=3D > >> =A0void *arg) {} > >> > -#endif // NDEBUG > >> > +#endif // NVALGRIND > >> > > >> > =3DA0// When running under valgrind, a non-zero value will be returned= > . > >> > =3DA0extern "C" int RunningOnValgrind() { > >> > Index: base/dynamic_annotations.h > >> > > >> > =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= > =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D > >> > >> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= > =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D > >> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= > =3D3D=3D3D=3D3D=3D3D > >> > --- base/dynamic_annotations.h =3DA0(revision 25716) > >> > +++ base/dynamic_annotations.h =3DA0(working copy) > >> > @@ -17,19 +17,16 @@ > >> > =3DA0// dynamic analysis tool being used. > >> > =3DA0// > >> > =3DA0// This file supports the following dynamic analysis tools: > >> > -// - None (NDEBUG is defined). > >> > +// - None (NVALGRIND is defined). > >> > =3DA0// =3DA0 =3DA0Macros are defined empty. > >> > -// - ThreadSanitizer (NDEBUG is not defined). > >> > +// - ThreadSanitizer (NVALGRIND is not defined). > >> > =3DA0// =3DA0 =3DA0Macros are defined as calls to non-inlinable empty > >> > functions > >> > =3DA0// =3DA0 =3DA0that are intercepted by ThreadSanitizer. > >> > =3DA0// > >> > =3DA0#ifndef BASE_DYNAMIC_ANNOTATIONS_H_ > >> > =3DA0#define BASE_DYNAMIC_ANNOTATIONS_H_ > >> > > >> > -// All the annotation macros are in effect only in debug mode. > >> > -#ifndef NDEBUG > >> > -// Debug build. > >> > - > >> > +#ifndef NVALGRIND > >> > =3DA0// ------------------------------------------------------------- > >> > =3DA0// Annotations useful when implementing condition variables such = > as > >> > CondVar, > >> > =3DA0// using conditional critical sections (Await/LockWhen) and when > >> > constructing > >> > @@ -309,8 +306,8 @@ > >> > =3DA0 =3DA0 static static_var ## _annotator the ## static_var ## > >> > _annotator;\ > >> > =3DA0 } > >> > > >> > -#else =3DA0// NDEBUG is defined > >> > -// Release build, empty macros. > >> > +#else > >> > +// NVALGRIND is defined, empty macros. > >> > > >> > =3DA0#define ANNOTATE_RWLOCK_CREATE(lock) // empty > >> > =3DA0#define ANNOTATE_RWLOCK_DESTROY(lock) // empty > >> > @@ -344,7 +341,7 @@ > >> > =3DA0#define ANNOTATE_UNPROTECTED_READ(x) (x) > >> > =3DA0#define ANNOTATE_BENIGN_RACE_STATIC(static_var, description) =3DA= > 0// > >> > emp=3D > >> ty > >> > > >> > -#endif =3DA0// NDEBUG > >> > +#endif =3DA0// NVALGRIND > >> > > >> > =3DA0// Return non-zero value if running under valgrind. > >> > =3DA0extern "C" int RunningOnValgrind(); > >> > > >> > > >> > > > > > > > > > http://codereview.chromium.org/201060 > > |