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, 29 StatMopRange, 30 StatShadowProcessed, 31 StatShadowZero, 32 StatShadowNonZero, // Derived. 33 StatShadowSameSize, 34 StatShadowIntersect, 35 StatShadowNotIntersect, 36 StatShadowSameThread, 37 StatShadowAnotherThread, 38 StatShadowReplace, 39 40 // Func processing. 41 StatFuncEnter, 42 StatFuncExit, 43 44 // Trace processing. 45 StatEvents, 46 47 // Threads. 48 StatThreadCreate, 49 StatThreadFinish, 50 StatThreadReuse, 51 StatThreadMaxTid, 52 StatThreadMaxAlive, 53 54 // Mutexes. 55 StatMutexCreate, 56 StatMutexDestroy, 57 StatMutexLock, 58 StatMutexUnlock, 59 StatMutexRecLock, 60 StatMutexRecUnlock, 61 StatMutexReadLock, 62 StatMutexReadUnlock, 63 64 // Synchronization. 65 StatSyncCreated, 66 StatSyncDestroyed, 67 StatSyncAcquire, 68 StatSyncRelease, 69 70 // Atomics. 71 StatAtomic, 72 StatAtomicLoad, 73 StatAtomicStore, 74 StatAtomicExchange, 75 StatAtomicFetchAdd, 76 StatAtomicFetchAnd, 77 StatAtomicFetchOr, 78 StatAtomicFetchXor, 79 StatAtomicCAS, 80 StatAtomicFence, 81 StatAtomicRelaxed, 82 StatAtomicConsume, 83 StatAtomicAcquire, 84 StatAtomicRelease, 85 StatAtomicAcq_Rel, 86 StatAtomicSeq_Cst, 87 StatAtomic1, 88 StatAtomic2, 89 StatAtomic4, 90 StatAtomic8, 91 92 // Interceptors. 93 StatInterceptor, 94 StatInt_longjmp, 95 StatInt_siglongjmp, 96 StatInt_malloc, 97 StatInt_calloc, 98 StatInt_realloc, 99 StatInt_free, 100 StatInt_cfree, 101 StatInt_mmap, 102 StatInt_mmap64, 103 StatInt_munmap, 104 StatInt_memalign, 105 StatInt_valloc, 106 StatInt_pvalloc, 107 StatInt_posix_memalign, 108 StatInt__Znwm, 109 StatInt__ZnwmRKSt9nothrow_t, 110 StatInt__Znam, 111 StatInt__ZnamRKSt9nothrow_t, 112 StatInt__ZdlPv, 113 StatInt__ZdlPvRKSt9nothrow_t, 114 StatInt__ZdaPv, 115 StatInt__ZdaPvRKSt9nothrow_t, 116 StatInt_strlen, 117 StatInt_memset, 118 StatInt_memcpy, 119 StatInt_strcmp, 120 StatInt_memchr, 121 StatInt_memrchr, 122 StatInt_memmove, 123 StatInt_memcmp, 124 StatInt_strchr, 125 StatInt_strchrnul, 126 StatInt_strrchr, 127 StatInt_strncmp, 128 StatInt_strcpy, 129 StatInt_strncpy, 130 StatInt_strstr, 131 StatInt_atexit, 132 StatInt___cxa_guard_acquire, 133 StatInt___cxa_guard_release, 134 StatInt_pthread_create, 135 StatInt_pthread_join, 136 StatInt_pthread_detach, 137 StatInt_pthread_mutex_init, 138 StatInt_pthread_mutex_destroy, 139 StatInt_pthread_mutex_lock, 140 StatInt_pthread_mutex_trylock, 141 StatInt_pthread_mutex_timedlock, 142 StatInt_pthread_mutex_unlock, 143 StatInt_pthread_spin_init, 144 StatInt_pthread_spin_destroy, 145 StatInt_pthread_spin_lock, 146 StatInt_pthread_spin_trylock, 147 StatInt_pthread_spin_unlock, 148 StatInt_pthread_rwlock_init, 149 StatInt_pthread_rwlock_destroy, 150 StatInt_pthread_rwlock_rdlock, 151 StatInt_pthread_rwlock_tryrdlock, 152 StatInt_pthread_rwlock_timedrdlock, 153 StatInt_pthread_rwlock_wrlock, 154 StatInt_pthread_rwlock_trywrlock, 155 StatInt_pthread_rwlock_timedwrlock, 156 StatInt_pthread_rwlock_unlock, 157 StatInt_pthread_cond_init, 158 StatInt_pthread_cond_destroy, 159 StatInt_pthread_cond_signal, 160 StatInt_pthread_cond_broadcast, 161 StatInt_pthread_cond_wait, 162 StatInt_pthread_cond_timedwait, 163 StatInt_pthread_barrier_init, 164 StatInt_pthread_barrier_destroy, 165 StatInt_pthread_barrier_wait, 166 StatInt_pthread_once, 167 StatInt_sem_init, 168 StatInt_sem_destroy, 169 StatInt_sem_wait, 170 StatInt_sem_trywait, 171 StatInt_sem_timedwait, 172 StatInt_sem_post, 173 StatInt_sem_getvalue, 174 StatInt_read, 175 StatInt_pread, 176 StatInt_pread64, 177 StatInt_readv, 178 StatInt_preadv64, 179 StatInt_write, 180 StatInt_pwrite, 181 StatInt_pwrite64, 182 StatInt_writev, 183 StatInt_pwritev64, 184 StatInt_send, 185 StatInt_sendmsg, 186 StatInt_recv, 187 StatInt_recvmsg, 188 StatInt_unlink, 189 StatInt_fopen, 190 StatInt_fread, 191 StatInt_fwrite, 192 StatInt_puts, 193 StatInt_rmdir, 194 StatInt_opendir, 195 StatInt_epoll_ctl, 196 StatInt_epoll_wait, 197 StatInt_sigaction, 198 StatInt_signal, 199 StatInt_raise, 200 StatInt_kill, 201 StatInt_pthread_kill, 202 StatInt_sleep, 203 StatInt_usleep, 204 StatInt_nanosleep, 205 206 // Dynamic annotations. 207 StatAnnotation, 208 StatAnnotateHappensBefore, 209 StatAnnotateHappensAfter, 210 StatAnnotateCondVarSignal, 211 StatAnnotateCondVarSignalAll, 212 StatAnnotateMutexIsNotPHB, 213 StatAnnotateCondVarWait, 214 StatAnnotateRWLockCreate, 215 StatAnnotateRWLockCreateStatic, 216 StatAnnotateRWLockDestroy, 217 StatAnnotateRWLockAcquired, 218 StatAnnotateRWLockReleased, 219 StatAnnotateTraceMemory, 220 StatAnnotateFlushState, 221 StatAnnotateNewMemory, 222 StatAnnotateNoOp, 223 StatAnnotateFlushExpectedRaces, 224 StatAnnotateEnableRaceDetection, 225 StatAnnotateMutexIsUsedAsCondVar, 226 StatAnnotatePCQGet, 227 StatAnnotatePCQPut, 228 StatAnnotatePCQDestroy, 229 StatAnnotatePCQCreate, 230 StatAnnotateExpectRace, 231 StatAnnotateBenignRaceSized, 232 StatAnnotateBenignRace, 233 StatAnnotateIgnoreReadsBegin, 234 StatAnnotateIgnoreReadsEnd, 235 StatAnnotateIgnoreWritesBegin, 236 StatAnnotateIgnoreWritesEnd, 237 StatAnnotatePublishMemoryRange, 238 StatAnnotateUnpublishMemoryRange, 239 StatAnnotateThreadName, 240 241 // Internal mutex contentionz. 242 StatMtxTotal, 243 StatMtxTrace, 244 StatMtxThreads, 245 StatMtxReport, 246 StatMtxSyncVar, 247 StatMtxSyncTab, 248 StatMtxSlab, 249 StatMtxAnnotations, 250 StatMtxAtExit, 251 252 // This must be the last. 253 StatCnt, 254 }; 255 256 } // namespace __tsan 257 258 #endif // TSAN_STAT_H 259