| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/dynamic_annotations.h" | |
| 6 | |
| 7 #ifndef NVALGRIND | |
| 8 // Each function is empty and called (via a macro) only in debug mode. | |
| 9 // The arguments are captured by dynamic tools at runtime. | |
| 10 | |
| 11 extern "C" void AnnotateRWLockCreate(const char *file, int line, | |
| 12 const volatile void *lock) {} | |
| 13 extern "C" void AnnotateRWLockDestroy(const char *file, int line, | |
| 14 const volatile void *lock) {} | |
| 15 extern "C" void AnnotateRWLockAcquired(const char *file, int line, | |
| 16 const volatile void *lock, long is_w) {} | |
| 17 extern "C" void AnnotateRWLockReleased(const char *file, int line, | |
| 18 const volatile void *lock, long is_w) {} | |
| 19 extern "C" void AnnotateCondVarWait(const char *file, int line, | |
| 20 const volatile void *cv, | |
| 21 const volatile void *lock) {} | |
| 22 extern "C" void AnnotateCondVarSignal(const char *file, int line, | |
| 23 const volatile void *cv) {} | |
| 24 extern "C" void AnnotateCondVarSignalAll(const char *file, int line, | |
| 25 const volatile void *cv) {} | |
| 26 extern "C" void AnnotatePublishMemoryRange(const char *file, int line, | |
| 27 const volatile void *address, | |
| 28 long size) {} | |
| 29 extern "C" void AnnotatePCQCreate(const char *file, int line, | |
| 30 const volatile void *pcq) {} | |
| 31 extern "C" void AnnotatePCQDestroy(const char *file, int line, | |
| 32 const volatile void *pcq) {} | |
| 33 extern "C" void AnnotatePCQPut(const char *file, int line, | |
| 34 const volatile void *pcq) {} | |
| 35 extern "C" void AnnotatePCQGet(const char *file, int line, | |
| 36 const volatile void *pcq) {} | |
| 37 extern "C" void AnnotateNewMemory(const char *file, int line, | |
| 38 const volatile void *mem, | |
| 39 long size) {} | |
| 40 extern "C" void AnnotateExpectRace(const char *file, int line, | |
| 41 const volatile void *mem, | |
| 42 const char *description) {} | |
| 43 extern "C" void AnnotateBenignRace(const char *file, int line, | |
| 44 const volatile void *mem, | |
| 45 const char *description) {} | |
| 46 extern "C" void AnnotateMutexIsUsedAsCondVar(const char *file, int line, | |
| 47 const volatile void *mu) {} | |
| 48 extern "C" void AnnotateTraceMemory(const char *file, int line, | |
| 49 const volatile void *arg) {} | |
| 50 extern "C" void AnnotateThreadName(const char *file, int line, | |
| 51 const char *name) {} | |
| 52 extern "C" void AnnotateIgnoreReadsBegin(const char *file, int line) {} | |
| 53 extern "C" void AnnotateIgnoreReadsEnd(const char *file, int line) {} | |
| 54 extern "C" void AnnotateIgnoreWritesBegin(const char *file, int line) {} | |
| 55 extern "C" void AnnotateIgnoreWritesEnd(const char *file, int line) {} | |
| 56 extern "C" void AnnotateNoOp(const char *file, int line, | |
| 57 const volatile void *arg) {} | |
| 58 #endif // NVALGRIND | |
| 59 | |
| 60 // When running under valgrind, a non-zero value will be returned. | |
| 61 extern "C" int RunningOnValgrind() { | |
| 62 #if defined(NVALGRIND) || !defined(RUNNING_ON_VALGRIND) | |
| 63 return 0; | |
| 64 #else | |
| 65 return RUNNING_ON_VALGRIND; | |
| 66 #endif | |
| 67 } | |
| OLD | NEW |