Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 1 | //===-- tsan_stat.h ---------------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file is a part of ThreadSanitizer (TSan), a race detector. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef TSAN_STAT_H |
| 15 | #define TSAN_STAT_H |
| 16 | |
| 17 | namespace __tsan { |
| 18 | |
| 19 | enum StatType { |
| 20 | // Memory access processing related stuff. |
| 21 | StatMop, |
| 22 | StatMopRead, |
| 23 | StatMopWrite, |
| 24 | StatMop1, // These must be consequtive. |
| 25 | StatMop2, |
| 26 | StatMop4, |
| 27 | StatMop8, |
| 28 | StatMopSame, |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 29 | StatMopIgnored, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 30 | StatMopRange, |
Dmitry Vyukov | 82dbc51 | 2013-03-20 13:21:50 +0000 | [diff] [blame] | 31 | StatMopRodata, |
| 32 | StatMopRangeRodata, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 33 | StatShadowProcessed, |
| 34 | StatShadowZero, |
| 35 | StatShadowNonZero, // Derived. |
| 36 | StatShadowSameSize, |
| 37 | StatShadowIntersect, |
| 38 | StatShadowNotIntersect, |
| 39 | StatShadowSameThread, |
| 40 | StatShadowAnotherThread, |
| 41 | StatShadowReplace, |
| 42 | |
| 43 | // Func processing. |
| 44 | StatFuncEnter, |
| 45 | StatFuncExit, |
| 46 | |
| 47 | // Trace processing. |
| 48 | StatEvents, |
| 49 | |
| 50 | // Threads. |
| 51 | StatThreadCreate, |
| 52 | StatThreadFinish, |
| 53 | StatThreadReuse, |
| 54 | StatThreadMaxTid, |
| 55 | StatThreadMaxAlive, |
| 56 | |
| 57 | // Mutexes. |
| 58 | StatMutexCreate, |
| 59 | StatMutexDestroy, |
| 60 | StatMutexLock, |
| 61 | StatMutexUnlock, |
| 62 | StatMutexRecLock, |
| 63 | StatMutexRecUnlock, |
| 64 | StatMutexReadLock, |
| 65 | StatMutexReadUnlock, |
| 66 | |
| 67 | // Synchronization. |
| 68 | StatSyncCreated, |
| 69 | StatSyncDestroyed, |
| 70 | StatSyncAcquire, |
| 71 | StatSyncRelease, |
| 72 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 73 | // Clocks - acquire. |
| 74 | StatClockAcquire, |
| 75 | StatClockAcquireEmpty, |
| 76 | StatClockAcquireFastRelease, |
| 77 | StatClockAcquireLarge, |
| 78 | StatClockAcquireRepeat, |
| 79 | StatClockAcquireFull, |
| 80 | StatClockAcquiredSomething, |
| 81 | // Clocks - release. |
| 82 | StatClockRelease, |
| 83 | StatClockReleaseResize, |
| 84 | StatClockReleaseFast1, |
| 85 | StatClockReleaseFast2, |
| 86 | StatClockReleaseSlow, |
| 87 | StatClockReleaseFull, |
| 88 | StatClockReleaseAcquired, |
| 89 | StatClockReleaseClearTail, |
| 90 | // Clocks - release store. |
| 91 | StatClockStore, |
| 92 | StatClockStoreResize, |
| 93 | StatClockStoreFast, |
| 94 | StatClockStoreFull, |
| 95 | StatClockStoreTail, |
| 96 | // Clocks - acquire-release. |
| 97 | StatClockAcquireRelease, |
| 98 | |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 99 | // Atomics. |
| 100 | StatAtomic, |
| 101 | StatAtomicLoad, |
| 102 | StatAtomicStore, |
| 103 | StatAtomicExchange, |
| 104 | StatAtomicFetchAdd, |
Dmitry Vyukov | 529cfa0 | 2012-10-04 10:08:23 +0000 | [diff] [blame] | 105 | StatAtomicFetchSub, |
Dmitry Vyukov | cdfb33a | 2012-05-14 15:33:00 +0000 | [diff] [blame] | 106 | StatAtomicFetchAnd, |
| 107 | StatAtomicFetchOr, |
| 108 | StatAtomicFetchXor, |
Dmitry Vyukov | 02b45d2 | 2012-11-26 09:42:56 +0000 | [diff] [blame] | 109 | StatAtomicFetchNand, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 110 | StatAtomicCAS, |
| 111 | StatAtomicFence, |
| 112 | StatAtomicRelaxed, |
| 113 | StatAtomicConsume, |
| 114 | StatAtomicAcquire, |
| 115 | StatAtomicRelease, |
| 116 | StatAtomicAcq_Rel, |
| 117 | StatAtomicSeq_Cst, |
| 118 | StatAtomic1, |
| 119 | StatAtomic2, |
| 120 | StatAtomic4, |
| 121 | StatAtomic8, |
Dmitry Vyukov | 63da509 | 2012-11-27 07:41:27 +0000 | [diff] [blame] | 122 | StatAtomic16, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 123 | |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 124 | // Dynamic annotations. |
| 125 | StatAnnotation, |
| 126 | StatAnnotateHappensBefore, |
| 127 | StatAnnotateHappensAfter, |
| 128 | StatAnnotateCondVarSignal, |
| 129 | StatAnnotateCondVarSignalAll, |
| 130 | StatAnnotateMutexIsNotPHB, |
| 131 | StatAnnotateCondVarWait, |
| 132 | StatAnnotateRWLockCreate, |
Dmitry Vyukov | c20e9ba | 2012-08-16 13:29:41 +0000 | [diff] [blame] | 133 | StatAnnotateRWLockCreateStatic, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 134 | StatAnnotateRWLockDestroy, |
| 135 | StatAnnotateRWLockAcquired, |
| 136 | StatAnnotateRWLockReleased, |
| 137 | StatAnnotateTraceMemory, |
| 138 | StatAnnotateFlushState, |
| 139 | StatAnnotateNewMemory, |
| 140 | StatAnnotateNoOp, |
| 141 | StatAnnotateFlushExpectedRaces, |
| 142 | StatAnnotateEnableRaceDetection, |
| 143 | StatAnnotateMutexIsUsedAsCondVar, |
| 144 | StatAnnotatePCQGet, |
| 145 | StatAnnotatePCQPut, |
| 146 | StatAnnotatePCQDestroy, |
| 147 | StatAnnotatePCQCreate, |
| 148 | StatAnnotateExpectRace, |
| 149 | StatAnnotateBenignRaceSized, |
| 150 | StatAnnotateBenignRace, |
| 151 | StatAnnotateIgnoreReadsBegin, |
| 152 | StatAnnotateIgnoreReadsEnd, |
| 153 | StatAnnotateIgnoreWritesBegin, |
| 154 | StatAnnotateIgnoreWritesEnd, |
Dmitry Vyukov | e1ddbf9 | 2013-10-10 15:58:12 +0000 | [diff] [blame] | 155 | StatAnnotateIgnoreSyncBegin, |
| 156 | StatAnnotateIgnoreSyncEnd, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 157 | StatAnnotatePublishMemoryRange, |
| 158 | StatAnnotateUnpublishMemoryRange, |
| 159 | StatAnnotateThreadName, |
| 160 | |
| 161 | // Internal mutex contentionz. |
| 162 | StatMtxTotal, |
| 163 | StatMtxTrace, |
| 164 | StatMtxThreads, |
| 165 | StatMtxReport, |
| 166 | StatMtxSyncVar, |
| 167 | StatMtxSyncTab, |
| 168 | StatMtxSlab, |
| 169 | StatMtxAnnotations, |
| 170 | StatMtxAtExit, |
Dmitry Vyukov | ad9da37 | 2012-12-06 12:16:15 +0000 | [diff] [blame] | 171 | StatMtxMBlock, |
Dmitry Vyukov | f4e4f93 | 2012-12-21 11:30:14 +0000 | [diff] [blame] | 172 | StatMtxJavaMBlock, |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 173 | StatMtxDeadlockDetector, |
Dmitry Vyukov | 52c70e5 | 2013-02-04 08:06:32 +0000 | [diff] [blame] | 174 | StatMtxFD, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 175 | |
| 176 | // This must be the last. |
Alexey Samsonov | 2135d8a | 2012-09-13 11:54:41 +0000 | [diff] [blame] | 177 | StatCnt |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 178 | }; |
| 179 | |
| 180 | } // namespace __tsan |
| 181 | |
| 182 | #endif // TSAN_STAT_H |