| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/dynamic_annotations.h" | 5 #include "base/dynamic_annotations.h" |
| 6 #include "base/third_party/valgrind/valgrind.h" | |
| 7 | 6 |
| 8 #ifndef NDEBUG | 7 #ifndef NVALGRIND |
| 9 // Each function is empty and called (via a macro) only in debug mode. | 8 // Each function is empty and called (via a macro) only in debug mode. |
| 10 // The arguments are captured by dynamic tools at runtime. | 9 // The arguments are captured by dynamic tools at runtime. |
| 11 | 10 |
| 12 extern "C" void AnnotateRWLockCreate(const char *file, int line, | 11 extern "C" void AnnotateRWLockCreate(const char *file, int line, |
| 13 const volatile void *lock) {} | 12 const volatile void *lock) {} |
| 14 extern "C" void AnnotateRWLockDestroy(const char *file, int line, | 13 extern "C" void AnnotateRWLockDestroy(const char *file, int line, |
| 15 const volatile void *lock) {} | 14 const volatile void *lock) {} |
| 16 extern "C" void AnnotateRWLockAcquired(const char *file, int line, | 15 extern "C" void AnnotateRWLockAcquired(const char *file, int line, |
| 17 const volatile void *lock, long is_w) {} | 16 const volatile void *lock, long is_w) {} |
| 18 extern "C" void AnnotateRWLockReleased(const char *file, int line, | 17 extern "C" void AnnotateRWLockReleased(const char *file, int line, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 49 extern "C" void AnnotateTraceMemory(const char *file, int line, | 48 extern "C" void AnnotateTraceMemory(const char *file, int line, |
| 50 const volatile void *arg) {} | 49 const volatile void *arg) {} |
| 51 extern "C" void AnnotateThreadName(const char *file, int line, | 50 extern "C" void AnnotateThreadName(const char *file, int line, |
| 52 const char *name) {} | 51 const char *name) {} |
| 53 extern "C" void AnnotateIgnoreReadsBegin(const char *file, int line) {} | 52 extern "C" void AnnotateIgnoreReadsBegin(const char *file, int line) {} |
| 54 extern "C" void AnnotateIgnoreReadsEnd(const char *file, int line) {} | 53 extern "C" void AnnotateIgnoreReadsEnd(const char *file, int line) {} |
| 55 extern "C" void AnnotateIgnoreWritesBegin(const char *file, int line) {} | 54 extern "C" void AnnotateIgnoreWritesBegin(const char *file, int line) {} |
| 56 extern "C" void AnnotateIgnoreWritesEnd(const char *file, int line) {} | 55 extern "C" void AnnotateIgnoreWritesEnd(const char *file, int line) {} |
| 57 extern "C" void AnnotateNoOp(const char *file, int line, | 56 extern "C" void AnnotateNoOp(const char *file, int line, |
| 58 const volatile void *arg) {} | 57 const volatile void *arg) {} |
| 59 #endif // NDEBUG | 58 #endif // NVALGRIND |
| 60 | 59 |
| 61 // When running under valgrind, a non-zero value will be returned. | 60 // When running under valgrind, a non-zero value will be returned. |
| 62 extern "C" int RunningOnValgrind() { | 61 extern "C" int RunningOnValgrind() { |
| 63 #if defined(NVALGRIND) | 62 #if defined(NVALGRIND) |
| 64 return 0; | 63 return 0; |
| 65 #else | 64 #else |
| 66 return RUNNING_ON_VALGRIND; | 65 return RUNNING_ON_VALGRIND; |
| 67 #endif | 66 #endif |
| 68 } | 67 } |
| OLD | NEW |