Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Issue 201060: s/NDEBUG/NVALGRIND/g in base/dynamic_annotations.* to allow...

Created:
11 years, 3 months ago by the_wrong_timurrrr
Modified:
11 years, 3 months ago
Reviewers:
Dean McNamee, dank
CC:
chromium-reviews_googlegroups.com, brettw, kcc
Visibility:
Public.

Description

s/NDEBUG/NVALGRIND/g in base/dynamic_annotations.* to allow ThreadSanitizer runs on release binaries.

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -11 lines) Patch
M base/dynamic_annotations.h View 1 3 chunks +7 lines, -8 lines 0 comments Download
M base/dynamic_annotations.cc View 1 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
the_wrong_timurrrr
Hi Dan, Dean, Valgrind bots have recently switched to run release (O1) binaries. In the ...
11 years, 3 months ago (2009-09-09 14:08:25 UTC) #1
not_the_right_dank
Do we already define NVALGRIND? We have an open bug on that, http://code.google.com/p/chromium/issues/detail?id=3D11927 and I ...
11 years, 3 months ago (2009-09-09 14:13:05 UTC) #2
the_wrong_timurrrr
I'm not sure, looks like we don't. Should we ask someone to define it? I'm ...
11 years, 3 months ago (2009-09-10 19:44:41 UTC) #3
Dean McNamee
I would rather flip the logic, ifdef COMPILING_FOR_VALGRIND. Makes it a lot harder to screw ...
11 years, 3 months ago (2009-09-12 12:47:56 UTC) #4
the_wrong_timurrrr
11 years, 3 months ago (2009-09-14 10:51:46 UTC) #5
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
> >

Powered by Google App Engine
This is Rietveld 408576698