tsan_stat.h revision ea72768894e32f367607c2142a7dfab603310da0
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 17namespace __tsan { 18 19enum 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 StatMopRodata, 31 StatMopRangeRodata, 32 StatShadowProcessed, 33 StatShadowZero, 34 StatShadowNonZero, // Derived. 35 StatShadowSameSize, 36 StatShadowIntersect, 37 StatShadowNotIntersect, 38 StatShadowSameThread, 39 StatShadowAnotherThread, 40 StatShadowReplace, 41 42 // Func processing. 43 StatFuncEnter, 44 StatFuncExit, 45 46 // Trace processing. 47 StatEvents, 48 49 // Threads. 50 StatThreadCreate, 51 StatThreadFinish, 52 StatThreadReuse, 53 StatThreadMaxTid, 54 StatThreadMaxAlive, 55 56 // Mutexes. 57 StatMutexCreate, 58 StatMutexDestroy, 59 StatMutexLock, 60 StatMutexUnlock, 61 StatMutexRecLock, 62 StatMutexRecUnlock, 63 StatMutexReadLock, 64 StatMutexReadUnlock, 65 66 // Synchronization. 67 StatSyncCreated, 68 StatSyncDestroyed, 69 StatSyncAcquire, 70 StatSyncRelease, 71 72 // Atomics. 73 StatAtomic, 74 StatAtomicLoad, 75 StatAtomicStore, 76 StatAtomicExchange, 77 StatAtomicFetchAdd, 78 StatAtomicFetchSub, 79 StatAtomicFetchAnd, 80 StatAtomicFetchOr, 81 StatAtomicFetchXor, 82 StatAtomicFetchNand, 83 StatAtomicCAS, 84 StatAtomicFence, 85 StatAtomicRelaxed, 86 StatAtomicConsume, 87 StatAtomicAcquire, 88 StatAtomicRelease, 89 StatAtomicAcq_Rel, 90 StatAtomicSeq_Cst, 91 StatAtomic1, 92 StatAtomic2, 93 StatAtomic4, 94 StatAtomic8, 95 StatAtomic16, 96 97 // Interceptors. 98 StatInterceptor, 99 StatInt_longjmp, 100 StatInt_siglongjmp, 101 StatInt_malloc, 102 StatInt___libc_memalign, 103 StatInt_calloc, 104 StatInt_realloc, 105 StatInt_free, 106 StatInt_cfree, 107 StatInt_malloc_usable_size, 108 StatInt_mmap, 109 StatInt_mmap64, 110 StatInt_munmap, 111 StatInt_memalign, 112 StatInt_valloc, 113 StatInt_pvalloc, 114 StatInt_posix_memalign, 115 StatInt__Znwm, 116 StatInt__ZnwmRKSt9nothrow_t, 117 StatInt__Znam, 118 StatInt__ZnamRKSt9nothrow_t, 119 StatInt__ZdlPv, 120 StatInt__ZdlPvRKSt9nothrow_t, 121 StatInt__ZdaPv, 122 StatInt__ZdaPvRKSt9nothrow_t, 123 StatInt_strlen, 124 StatInt_memset, 125 StatInt_memcpy, 126 StatInt_strcmp, 127 StatInt_memchr, 128 StatInt_memrchr, 129 StatInt_memmove, 130 StatInt_memcmp, 131 StatInt_strchr, 132 StatInt_strchrnul, 133 StatInt_strrchr, 134 StatInt_strncmp, 135 StatInt_strcpy, 136 StatInt_strncpy, 137 StatInt_strcasecmp, 138 StatInt_strncasecmp, 139 StatInt_strstr, 140 StatInt_atexit, 141 StatInt___cxa_guard_acquire, 142 StatInt___cxa_guard_release, 143 StatInt___cxa_guard_abort, 144 StatInt_pthread_create, 145 StatInt_pthread_join, 146 StatInt_pthread_detach, 147 StatInt_pthread_mutex_init, 148 StatInt_pthread_mutex_destroy, 149 StatInt_pthread_mutex_lock, 150 StatInt_pthread_mutex_trylock, 151 StatInt_pthread_mutex_timedlock, 152 StatInt_pthread_mutex_unlock, 153 StatInt_pthread_spin_init, 154 StatInt_pthread_spin_destroy, 155 StatInt_pthread_spin_lock, 156 StatInt_pthread_spin_trylock, 157 StatInt_pthread_spin_unlock, 158 StatInt_pthread_rwlock_init, 159 StatInt_pthread_rwlock_destroy, 160 StatInt_pthread_rwlock_rdlock, 161 StatInt_pthread_rwlock_tryrdlock, 162 StatInt_pthread_rwlock_timedrdlock, 163 StatInt_pthread_rwlock_wrlock, 164 StatInt_pthread_rwlock_trywrlock, 165 StatInt_pthread_rwlock_timedwrlock, 166 StatInt_pthread_rwlock_unlock, 167 StatInt_pthread_cond_init, 168 StatInt_pthread_cond_destroy, 169 StatInt_pthread_cond_signal, 170 StatInt_pthread_cond_broadcast, 171 StatInt_pthread_cond_wait, 172 StatInt_pthread_cond_timedwait, 173 StatInt_pthread_barrier_init, 174 StatInt_pthread_barrier_destroy, 175 StatInt_pthread_barrier_wait, 176 StatInt_pthread_once, 177 StatInt_pthread_getschedparam, 178 StatInt_sem_init, 179 StatInt_sem_destroy, 180 StatInt_sem_wait, 181 StatInt_sem_trywait, 182 StatInt_sem_timedwait, 183 StatInt_sem_post, 184 StatInt_sem_getvalue, 185 StatInt_stat, 186 StatInt___xstat, 187 StatInt_stat64, 188 StatInt___xstat64, 189 StatInt_lstat, 190 StatInt___lxstat, 191 StatInt_lstat64, 192 StatInt___lxstat64, 193 StatInt_fstat, 194 StatInt___fxstat, 195 StatInt_fstat64, 196 StatInt___fxstat64, 197 StatInt_open, 198 StatInt_open64, 199 StatInt_creat, 200 StatInt_creat64, 201 StatInt_dup, 202 StatInt_dup2, 203 StatInt_dup3, 204 StatInt_eventfd, 205 StatInt_signalfd, 206 StatInt_inotify_init, 207 StatInt_inotify_init1, 208 StatInt_socket, 209 StatInt_socketpair, 210 StatInt_connect, 211 StatInt_bind, 212 StatInt_listen, 213 StatInt_accept, 214 StatInt_accept4, 215 StatInt_epoll_create, 216 StatInt_epoll_create1, 217 StatInt_close, 218 StatInt___close, 219 StatInt___res_iclose, 220 StatInt_pipe, 221 StatInt_pipe2, 222 StatInt_read, 223 StatInt_prctl, 224 StatInt_pread, 225 StatInt_pread64, 226 StatInt_readv, 227 StatInt_preadv, 228 StatInt_preadv64, 229 StatInt_write, 230 StatInt_pwrite, 231 StatInt_pwrite64, 232 StatInt_writev, 233 StatInt_pwritev, 234 StatInt_pwritev64, 235 StatInt_send, 236 StatInt_sendmsg, 237 StatInt_recv, 238 StatInt_recvmsg, 239 StatInt_unlink, 240 StatInt_fopen, 241 StatInt_freopen, 242 StatInt_fclose, 243 StatInt_fread, 244 StatInt_fwrite, 245 StatInt_fflush, 246 StatInt_abort, 247 StatInt_puts, 248 StatInt_rmdir, 249 StatInt_opendir, 250 StatInt_epoll_ctl, 251 StatInt_epoll_wait, 252 StatInt_poll, 253 StatInt_sigaction, 254 StatInt_signal, 255 StatInt_raise, 256 StatInt_kill, 257 StatInt_pthread_kill, 258 StatInt_sleep, 259 StatInt_usleep, 260 StatInt_nanosleep, 261 StatInt_gettimeofday, 262 StatInt_fork, 263 StatInt_vscanf, 264 StatInt_vsscanf, 265 StatInt_vfscanf, 266 StatInt_scanf, 267 StatInt_sscanf, 268 StatInt_fscanf, 269 StatInt___isoc99_vscanf, 270 StatInt___isoc99_vsscanf, 271 StatInt___isoc99_vfscanf, 272 StatInt___isoc99_scanf, 273 StatInt___isoc99_sscanf, 274 StatInt___isoc99_fscanf, 275 StatInt_on_exit, 276 StatInt___cxa_atexit, 277 StatInt_localtime, 278 StatInt_localtime_r, 279 StatInt_gmtime, 280 StatInt_gmtime_r, 281 StatInt_ctime, 282 StatInt_ctime_r, 283 StatInt_asctime, 284 StatInt_asctime_r, 285 StatInt_frexp, 286 StatInt_frexpf, 287 StatInt_frexpl, 288 StatInt_getpwnam, 289 StatInt_getpwuid, 290 StatInt_getgrnam, 291 StatInt_getgrgid, 292 StatInt_getpwnam_r, 293 StatInt_getpwuid_r, 294 StatInt_getgrnam_r, 295 StatInt_getgrgid_r, 296 StatInt_clock_getres, 297 StatInt_clock_gettime, 298 StatInt_clock_settime, 299 StatInt_getitimer, 300 StatInt_setitimer, 301 StatInt_time, 302 StatInt_glob, 303 StatInt_glob64, 304 StatInt_wait, 305 StatInt_waitid, 306 StatInt_waitpid, 307 StatInt_wait3, 308 StatInt_wait4, 309 StatInt_inet_ntop, 310 StatInt_inet_pton, 311 StatInt_inet_aton, 312 StatInt_getaddrinfo, 313 StatInt_getnameinfo, 314 StatInt_getsockname, 315 StatInt_gethostent, 316 StatInt_gethostbyname, 317 StatInt_gethostbyname2, 318 StatInt_gethostbyaddr, 319 StatInt_gethostent_r, 320 StatInt_gethostbyname_r, 321 StatInt_gethostbyname2_r, 322 StatInt_gethostbyaddr_r, 323 StatInt_getsockopt, 324 StatInt_modf, 325 StatInt_modff, 326 StatInt_modfl, 327 StatInt_getpeername, 328 StatInt_ioctl, 329 StatInt_sysinfo, 330 StatInt_readdir, 331 StatInt_readdir64, 332 StatInt_readdir_r, 333 StatInt_readdir64_r, 334 StatInt_ptrace, 335 StatInt_setlocale, 336 StatInt_getcwd, 337 StatInt_get_current_dir_name, 338 StatInt_strtoimax, 339 StatInt_strtoumax, 340 StatInt_mbstowcs, 341 StatInt_mbsrtowcs, 342 StatInt_mbsnrtowcs, 343 StatInt_wcstombs, 344 StatInt_wcsrtombs, 345 StatInt_wcsnrtombs, 346 StatInt_tcgetattr, 347 348 // Dynamic annotations. 349 StatAnnotation, 350 StatAnnotateHappensBefore, 351 StatAnnotateHappensAfter, 352 StatAnnotateCondVarSignal, 353 StatAnnotateCondVarSignalAll, 354 StatAnnotateMutexIsNotPHB, 355 StatAnnotateCondVarWait, 356 StatAnnotateRWLockCreate, 357 StatAnnotateRWLockCreateStatic, 358 StatAnnotateRWLockDestroy, 359 StatAnnotateRWLockAcquired, 360 StatAnnotateRWLockReleased, 361 StatAnnotateTraceMemory, 362 StatAnnotateFlushState, 363 StatAnnotateNewMemory, 364 StatAnnotateNoOp, 365 StatAnnotateFlushExpectedRaces, 366 StatAnnotateEnableRaceDetection, 367 StatAnnotateMutexIsUsedAsCondVar, 368 StatAnnotatePCQGet, 369 StatAnnotatePCQPut, 370 StatAnnotatePCQDestroy, 371 StatAnnotatePCQCreate, 372 StatAnnotateExpectRace, 373 StatAnnotateBenignRaceSized, 374 StatAnnotateBenignRace, 375 StatAnnotateIgnoreReadsBegin, 376 StatAnnotateIgnoreReadsEnd, 377 StatAnnotateIgnoreWritesBegin, 378 StatAnnotateIgnoreWritesEnd, 379 StatAnnotatePublishMemoryRange, 380 StatAnnotateUnpublishMemoryRange, 381 StatAnnotateThreadName, 382 383 // Internal mutex contentionz. 384 StatMtxTotal, 385 StatMtxTrace, 386 StatMtxThreads, 387 StatMtxReport, 388 StatMtxSyncVar, 389 StatMtxSyncTab, 390 StatMtxSlab, 391 StatMtxAnnotations, 392 StatMtxAtExit, 393 StatMtxMBlock, 394 StatMtxJavaMBlock, 395 StatMtxFD, 396 397 // This must be the last. 398 StatCnt 399}; 400 401} // namespace __tsan 402 403#endif // TSAN_STAT_H 404