Kostya Serebryany | 4ad375f | 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, |
Dmitry Vyukov | afdcc96 | 2014-05-30 13:36:29 +0000 | [diff] [blame] | 29 | StatMopIgnored, |
Kostya Serebryany | 4ad375f | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 30 | StatMopRange, |
Dmitry Vyukov | b62c158 | 2013-03-20 13:21:50 +0000 | [diff] [blame] | 31 | StatMopRodata, |
| 32 | StatMopRangeRodata, |
Kostya Serebryany | 4ad375f | 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 | |
Dmitry Vyukov | d23118c | 2014-03-24 18:54:20 +0000 | [diff] [blame] | 73 | // Clocks - acquire. |
| 74 | StatClockAcquire, |
| 75 | StatClockAcquireEmpty, |
| 76 | StatClockAcquireFastRelease, |
Dmitry Vyukov | d23118c | 2014-03-24 18:54:20 +0000 | [diff] [blame] | 77 | StatClockAcquireFull, |
| 78 | StatClockAcquiredSomething, |
| 79 | // Clocks - release. |
| 80 | StatClockRelease, |
| 81 | StatClockReleaseResize, |
Dmitry Vyukov | 1fa7299 | 2017-07-12 12:54:38 +0000 | [diff] [blame] | 82 | StatClockReleaseFast, |
Dmitry Vyukov | b5eb8f0 | 2014-04-11 15:38:03 +0000 | [diff] [blame] | 83 | StatClockReleaseSlow, |
Dmitry Vyukov | d23118c | 2014-03-24 18:54:20 +0000 | [diff] [blame] | 84 | StatClockReleaseFull, |
| 85 | StatClockReleaseAcquired, |
| 86 | StatClockReleaseClearTail, |
Dmitry Vyukov | d23118c | 2014-03-24 18:54:20 +0000 | [diff] [blame] | 87 | // Clocks - release store. |
| 88 | StatClockStore, |
| 89 | StatClockStoreResize, |
| 90 | StatClockStoreFast, |
| 91 | StatClockStoreFull, |
| 92 | StatClockStoreTail, |
| 93 | // Clocks - acquire-release. |
| 94 | StatClockAcquireRelease, |
| 95 | |
Kostya Serebryany | 4ad375f | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 96 | // Atomics. |
| 97 | StatAtomic, |
| 98 | StatAtomicLoad, |
| 99 | StatAtomicStore, |
| 100 | StatAtomicExchange, |
| 101 | StatAtomicFetchAdd, |
Dmitry Vyukov | b96a7b5 | 2012-10-04 10:08:23 +0000 | [diff] [blame] | 102 | StatAtomicFetchSub, |
Dmitry Vyukov | 572c5b2 | 2012-05-14 15:33:00 +0000 | [diff] [blame] | 103 | StatAtomicFetchAnd, |
| 104 | StatAtomicFetchOr, |
| 105 | StatAtomicFetchXor, |
Dmitry Vyukov | 3b45012 | 2012-11-26 09:42:56 +0000 | [diff] [blame] | 106 | StatAtomicFetchNand, |
Kostya Serebryany | 4ad375f | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 107 | StatAtomicCAS, |
| 108 | StatAtomicFence, |
| 109 | StatAtomicRelaxed, |
| 110 | StatAtomicConsume, |
| 111 | StatAtomicAcquire, |
| 112 | StatAtomicRelease, |
| 113 | StatAtomicAcq_Rel, |
| 114 | StatAtomicSeq_Cst, |
| 115 | StatAtomic1, |
| 116 | StatAtomic2, |
| 117 | StatAtomic4, |
| 118 | StatAtomic8, |
Dmitry Vyukov | 59d5866 | 2012-11-27 07:41:27 +0000 | [diff] [blame] | 119 | StatAtomic16, |
Kostya Serebryany | 4ad375f | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 120 | |
Kostya Serebryany | 4ad375f | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 121 | // Dynamic annotations. |
| 122 | StatAnnotation, |
| 123 | StatAnnotateHappensBefore, |
| 124 | StatAnnotateHappensAfter, |
| 125 | StatAnnotateCondVarSignal, |
| 126 | StatAnnotateCondVarSignalAll, |
| 127 | StatAnnotateMutexIsNotPHB, |
| 128 | StatAnnotateCondVarWait, |
| 129 | StatAnnotateRWLockCreate, |
Dmitry Vyukov | 4723e6b | 2012-08-16 13:29:41 +0000 | [diff] [blame] | 130 | StatAnnotateRWLockCreateStatic, |
Kostya Serebryany | 4ad375f | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 131 | StatAnnotateRWLockDestroy, |
| 132 | StatAnnotateRWLockAcquired, |
| 133 | StatAnnotateRWLockReleased, |
| 134 | StatAnnotateTraceMemory, |
| 135 | StatAnnotateFlushState, |
| 136 | StatAnnotateNewMemory, |
| 137 | StatAnnotateNoOp, |
| 138 | StatAnnotateFlushExpectedRaces, |
| 139 | StatAnnotateEnableRaceDetection, |
| 140 | StatAnnotateMutexIsUsedAsCondVar, |
| 141 | StatAnnotatePCQGet, |
| 142 | StatAnnotatePCQPut, |
| 143 | StatAnnotatePCQDestroy, |
| 144 | StatAnnotatePCQCreate, |
| 145 | StatAnnotateExpectRace, |
| 146 | StatAnnotateBenignRaceSized, |
| 147 | StatAnnotateBenignRace, |
| 148 | StatAnnotateIgnoreReadsBegin, |
| 149 | StatAnnotateIgnoreReadsEnd, |
| 150 | StatAnnotateIgnoreWritesBegin, |
| 151 | StatAnnotateIgnoreWritesEnd, |
Dmitry Vyukov | fbb194f | 2013-10-10 15:58:12 +0000 | [diff] [blame] | 152 | StatAnnotateIgnoreSyncBegin, |
| 153 | StatAnnotateIgnoreSyncEnd, |
Kostya Serebryany | 4ad375f | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 154 | StatAnnotatePublishMemoryRange, |
| 155 | StatAnnotateUnpublishMemoryRange, |
| 156 | StatAnnotateThreadName, |
Dmitry Vyukov | 8096a8c | 2017-03-26 15:27:04 +0000 | [diff] [blame] | 157 | Stat__tsan_mutex_create, |
| 158 | Stat__tsan_mutex_destroy, |
| 159 | Stat__tsan_mutex_pre_lock, |
| 160 | Stat__tsan_mutex_post_lock, |
| 161 | Stat__tsan_mutex_pre_unlock, |
| 162 | Stat__tsan_mutex_post_unlock, |
| 163 | Stat__tsan_mutex_pre_signal, |
| 164 | Stat__tsan_mutex_post_signal, |
| 165 | Stat__tsan_mutex_pre_divert, |
| 166 | Stat__tsan_mutex_post_divert, |
Kostya Serebryany | 4ad375f | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 167 | |
| 168 | // Internal mutex contentionz. |
| 169 | StatMtxTotal, |
| 170 | StatMtxTrace, |
| 171 | StatMtxThreads, |
| 172 | StatMtxReport, |
| 173 | StatMtxSyncVar, |
| 174 | StatMtxSyncTab, |
| 175 | StatMtxSlab, |
| 176 | StatMtxAnnotations, |
| 177 | StatMtxAtExit, |
Dmitry Vyukov | fd5ebcd | 2012-12-06 12:16:15 +0000 | [diff] [blame] | 178 | StatMtxMBlock, |
Kostya Serebryany | 0548c79 | 2014-02-21 15:07:18 +0000 | [diff] [blame] | 179 | StatMtxDeadlockDetector, |
Dmitry Vyukov | 3464dac | 2015-09-03 11:20:46 +0000 | [diff] [blame] | 180 | StatMtxFired, |
| 181 | StatMtxRacy, |
Dmitry Vyukov | 606de60 | 2013-02-04 08:06:32 +0000 | [diff] [blame] | 182 | StatMtxFD, |
Dmitry Vyukov | 144eafd | 2016-05-06 19:35:22 +0000 | [diff] [blame] | 183 | StatMtxGlobalProc, |
Kostya Serebryany | 4ad375f | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 184 | |
| 185 | // This must be the last. |
Alexey Samsonov | 046248c | 2012-09-13 11:54:41 +0000 | [diff] [blame] | 186 | StatCnt |
Kostya Serebryany | 4ad375f | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 187 | }; |
| 188 | |
| 189 | } // namespace __tsan |
| 190 | |
| 191 | #endif // TSAN_STAT_H |