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, |
| 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, |
Dmitry Vyukov | 529cfa0 | 2012-10-04 10:08:23 +0000 | [diff] [blame] | 76 | StatAtomicFetchSub, |
Dmitry Vyukov | cdfb33a | 2012-05-14 15:33:00 +0000 | [diff] [blame] | 77 | StatAtomicFetchAnd, |
| 78 | StatAtomicFetchOr, |
| 79 | StatAtomicFetchXor, |
Dmitry Vyukov | 02b45d2 | 2012-11-26 09:42:56 +0000 | [diff] [blame] | 80 | StatAtomicFetchNand, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 81 | StatAtomicCAS, |
| 82 | StatAtomicFence, |
| 83 | StatAtomicRelaxed, |
| 84 | StatAtomicConsume, |
| 85 | StatAtomicAcquire, |
| 86 | StatAtomicRelease, |
| 87 | StatAtomicAcq_Rel, |
| 88 | StatAtomicSeq_Cst, |
| 89 | StatAtomic1, |
| 90 | StatAtomic2, |
| 91 | StatAtomic4, |
| 92 | StatAtomic8, |
Dmitry Vyukov | 63da509 | 2012-11-27 07:41:27 +0000 | [diff] [blame] | 93 | StatAtomic16, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 94 | |
| 95 | // Interceptors. |
| 96 | StatInterceptor, |
Dmitry Vyukov | f037f56 | 2012-05-31 18:03:59 +0000 | [diff] [blame] | 97 | StatInt_longjmp, |
| 98 | StatInt_siglongjmp, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 99 | StatInt_malloc, |
Dmitry Vyukov | 07ba8ef | 2012-11-30 17:27:58 +0000 | [diff] [blame] | 100 | StatInt___libc_memalign, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 101 | StatInt_calloc, |
| 102 | StatInt_realloc, |
| 103 | StatInt_free, |
| 104 | StatInt_cfree, |
| 105 | StatInt_mmap, |
| 106 | StatInt_mmap64, |
| 107 | StatInt_munmap, |
| 108 | StatInt_memalign, |
| 109 | StatInt_valloc, |
| 110 | StatInt_pvalloc, |
| 111 | StatInt_posix_memalign, |
| 112 | StatInt__Znwm, |
| 113 | StatInt__ZnwmRKSt9nothrow_t, |
| 114 | StatInt__Znam, |
| 115 | StatInt__ZnamRKSt9nothrow_t, |
| 116 | StatInt__ZdlPv, |
| 117 | StatInt__ZdlPvRKSt9nothrow_t, |
| 118 | StatInt__ZdaPv, |
| 119 | StatInt__ZdaPvRKSt9nothrow_t, |
| 120 | StatInt_strlen, |
| 121 | StatInt_memset, |
| 122 | StatInt_memcpy, |
| 123 | StatInt_strcmp, |
| 124 | StatInt_memchr, |
| 125 | StatInt_memrchr, |
| 126 | StatInt_memmove, |
| 127 | StatInt_memcmp, |
| 128 | StatInt_strchr, |
| 129 | StatInt_strchrnul, |
| 130 | StatInt_strrchr, |
| 131 | StatInt_strncmp, |
| 132 | StatInt_strcpy, |
| 133 | StatInt_strncpy, |
| 134 | StatInt_strstr, |
| 135 | StatInt_atexit, |
| 136 | StatInt___cxa_guard_acquire, |
| 137 | StatInt___cxa_guard_release, |
Dmitry Vyukov | 1ffeded | 2012-12-05 12:10:22 +0000 | [diff] [blame] | 138 | StatInt___cxa_guard_abort, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 139 | StatInt_pthread_create, |
| 140 | StatInt_pthread_join, |
| 141 | StatInt_pthread_detach, |
| 142 | StatInt_pthread_mutex_init, |
| 143 | StatInt_pthread_mutex_destroy, |
| 144 | StatInt_pthread_mutex_lock, |
| 145 | StatInt_pthread_mutex_trylock, |
| 146 | StatInt_pthread_mutex_timedlock, |
| 147 | StatInt_pthread_mutex_unlock, |
| 148 | StatInt_pthread_spin_init, |
| 149 | StatInt_pthread_spin_destroy, |
| 150 | StatInt_pthread_spin_lock, |
| 151 | StatInt_pthread_spin_trylock, |
| 152 | StatInt_pthread_spin_unlock, |
| 153 | StatInt_pthread_rwlock_init, |
| 154 | StatInt_pthread_rwlock_destroy, |
| 155 | StatInt_pthread_rwlock_rdlock, |
| 156 | StatInt_pthread_rwlock_tryrdlock, |
| 157 | StatInt_pthread_rwlock_timedrdlock, |
| 158 | StatInt_pthread_rwlock_wrlock, |
| 159 | StatInt_pthread_rwlock_trywrlock, |
| 160 | StatInt_pthread_rwlock_timedwrlock, |
| 161 | StatInt_pthread_rwlock_unlock, |
| 162 | StatInt_pthread_cond_init, |
| 163 | StatInt_pthread_cond_destroy, |
| 164 | StatInt_pthread_cond_signal, |
| 165 | StatInt_pthread_cond_broadcast, |
| 166 | StatInt_pthread_cond_wait, |
| 167 | StatInt_pthread_cond_timedwait, |
| 168 | StatInt_pthread_barrier_init, |
| 169 | StatInt_pthread_barrier_destroy, |
| 170 | StatInt_pthread_barrier_wait, |
| 171 | StatInt_pthread_once, |
| 172 | StatInt_sem_init, |
| 173 | StatInt_sem_destroy, |
| 174 | StatInt_sem_wait, |
| 175 | StatInt_sem_trywait, |
| 176 | StatInt_sem_timedwait, |
| 177 | StatInt_sem_post, |
| 178 | StatInt_sem_getvalue, |
Dmitry Vyukov | ba3ae35 | 2012-12-07 18:30:40 +0000 | [diff] [blame] | 179 | StatInt_open, |
Dmitry Vyukov | c78839f | 2012-12-12 11:59:30 +0000 | [diff] [blame] | 180 | StatInt_open64, |
Dmitry Vyukov | ba3ae35 | 2012-12-07 18:30:40 +0000 | [diff] [blame] | 181 | StatInt_creat, |
Dmitry Vyukov | c78839f | 2012-12-12 11:59:30 +0000 | [diff] [blame] | 182 | StatInt_creat64, |
Dmitry Vyukov | ba3ae35 | 2012-12-07 18:30:40 +0000 | [diff] [blame] | 183 | StatInt_dup, |
| 184 | StatInt_dup2, |
| 185 | StatInt_dup3, |
Dmitry Vyukov | 68230a1 | 2012-12-07 19:23:59 +0000 | [diff] [blame] | 186 | StatInt_eventfd, |
Dmitry Vyukov | 45d4324 | 2012-12-18 12:35:31 +0000 | [diff] [blame] | 187 | StatInt_signalfd, |
| 188 | StatInt_inotify_init, |
| 189 | StatInt_inotify_init1, |
Dmitry Vyukov | 68230a1 | 2012-12-07 19:23:59 +0000 | [diff] [blame] | 190 | StatInt_socket, |
Dmitry Vyukov | 983518e | 2012-12-14 09:57:42 +0000 | [diff] [blame] | 191 | StatInt_socketpair, |
Dmitry Vyukov | 68230a1 | 2012-12-07 19:23:59 +0000 | [diff] [blame] | 192 | StatInt_connect, |
| 193 | StatInt_accept, |
| 194 | StatInt_accept4, |
| 195 | StatInt_epoll_create, |
| 196 | StatInt_epoll_create1, |
Dmitry Vyukov | ddeb2c3 | 2012-12-07 15:32:56 +0000 | [diff] [blame] | 197 | StatInt_close, |
Dmitry Vyukov | c78839f | 2012-12-12 11:59:30 +0000 | [diff] [blame] | 198 | StatInt___close, |
Dmitry Vyukov | ddeb2c3 | 2012-12-07 15:32:56 +0000 | [diff] [blame] | 199 | StatInt_pipe, |
| 200 | StatInt_pipe2, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 201 | StatInt_read, |
| 202 | StatInt_pread, |
| 203 | StatInt_pread64, |
| 204 | StatInt_readv, |
| 205 | StatInt_preadv64, |
| 206 | StatInt_write, |
| 207 | StatInt_pwrite, |
| 208 | StatInt_pwrite64, |
| 209 | StatInt_writev, |
| 210 | StatInt_pwritev64, |
| 211 | StatInt_send, |
| 212 | StatInt_sendmsg, |
| 213 | StatInt_recv, |
| 214 | StatInt_recvmsg, |
| 215 | StatInt_unlink, |
| 216 | StatInt_fopen, |
Dmitry Vyukov | c78839f | 2012-12-12 11:59:30 +0000 | [diff] [blame] | 217 | StatInt_freopen, |
| 218 | StatInt_fclose, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 219 | StatInt_fread, |
| 220 | StatInt_fwrite, |
| 221 | StatInt_puts, |
| 222 | StatInt_rmdir, |
| 223 | StatInt_opendir, |
| 224 | StatInt_epoll_ctl, |
| 225 | StatInt_epoll_wait, |
Dmitry Vyukov | ee8ee24 | 2012-11-15 17:40:49 +0000 | [diff] [blame] | 226 | StatInt_poll, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 227 | StatInt_sigaction, |
Dmitry Vyukov | d91d067 | 2012-05-21 08:26:51 +0000 | [diff] [blame] | 228 | StatInt_signal, |
| 229 | StatInt_raise, |
| 230 | StatInt_kill, |
| 231 | StatInt_pthread_kill, |
Dmitry Vyukov | 8485311 | 2012-08-31 17:27:49 +0000 | [diff] [blame] | 232 | StatInt_sleep, |
| 233 | StatInt_usleep, |
| 234 | StatInt_nanosleep, |
Dmitry Vyukov | aad173b | 2012-11-09 19:55:06 +0000 | [diff] [blame] | 235 | StatInt_gettimeofday, |
Dmitry Vyukov | 4554b7a | 2012-12-18 14:44:44 +0000 | [diff] [blame] | 236 | StatInt_fork, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 237 | |
| 238 | // Dynamic annotations. |
| 239 | StatAnnotation, |
| 240 | StatAnnotateHappensBefore, |
| 241 | StatAnnotateHappensAfter, |
| 242 | StatAnnotateCondVarSignal, |
| 243 | StatAnnotateCondVarSignalAll, |
| 244 | StatAnnotateMutexIsNotPHB, |
| 245 | StatAnnotateCondVarWait, |
| 246 | StatAnnotateRWLockCreate, |
Dmitry Vyukov | c20e9ba | 2012-08-16 13:29:41 +0000 | [diff] [blame] | 247 | StatAnnotateRWLockCreateStatic, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 248 | StatAnnotateRWLockDestroy, |
| 249 | StatAnnotateRWLockAcquired, |
| 250 | StatAnnotateRWLockReleased, |
| 251 | StatAnnotateTraceMemory, |
| 252 | StatAnnotateFlushState, |
| 253 | StatAnnotateNewMemory, |
| 254 | StatAnnotateNoOp, |
| 255 | StatAnnotateFlushExpectedRaces, |
| 256 | StatAnnotateEnableRaceDetection, |
| 257 | StatAnnotateMutexIsUsedAsCondVar, |
| 258 | StatAnnotatePCQGet, |
| 259 | StatAnnotatePCQPut, |
| 260 | StatAnnotatePCQDestroy, |
| 261 | StatAnnotatePCQCreate, |
| 262 | StatAnnotateExpectRace, |
| 263 | StatAnnotateBenignRaceSized, |
| 264 | StatAnnotateBenignRace, |
| 265 | StatAnnotateIgnoreReadsBegin, |
| 266 | StatAnnotateIgnoreReadsEnd, |
| 267 | StatAnnotateIgnoreWritesBegin, |
| 268 | StatAnnotateIgnoreWritesEnd, |
| 269 | StatAnnotatePublishMemoryRange, |
| 270 | StatAnnotateUnpublishMemoryRange, |
| 271 | StatAnnotateThreadName, |
| 272 | |
| 273 | // Internal mutex contentionz. |
| 274 | StatMtxTotal, |
| 275 | StatMtxTrace, |
| 276 | StatMtxThreads, |
| 277 | StatMtxReport, |
| 278 | StatMtxSyncVar, |
| 279 | StatMtxSyncTab, |
| 280 | StatMtxSlab, |
| 281 | StatMtxAnnotations, |
| 282 | StatMtxAtExit, |
Dmitry Vyukov | ad9da37 | 2012-12-06 12:16:15 +0000 | [diff] [blame] | 283 | StatMtxMBlock, |
Dmitry Vyukov | f4e4f93 | 2012-12-21 11:30:14 +0000 | [diff] [blame^] | 284 | StatMtxJavaMBlock, |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 285 | |
| 286 | // This must be the last. |
Alexey Samsonov | 2135d8a | 2012-09-13 11:54:41 +0000 | [diff] [blame] | 287 | StatCnt |
Kostya Serebryany | 7ac4148 | 2012-05-10 13:48:04 +0000 | [diff] [blame] | 288 | }; |
| 289 | |
| 290 | } // namespace __tsan |
| 291 | |
| 292 | #endif // TSAN_STAT_H |