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 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_sigsuspend, 256 StatInt_raise, 257 StatInt_kill, 258 StatInt_pthread_kill, 259 StatInt_sleep, 260 StatInt_usleep, 261 StatInt_nanosleep, 262 StatInt_gettimeofday, 263 StatInt_fork, 264 StatInt_vscanf, 265 StatInt_vsscanf, 266 StatInt_vfscanf, 267 StatInt_scanf, 268 StatInt_sscanf, 269 StatInt_fscanf, 270 StatInt___isoc99_vscanf, 271 StatInt___isoc99_vsscanf, 272 StatInt___isoc99_vfscanf, 273 StatInt___isoc99_scanf, 274 StatInt___isoc99_sscanf, 275 StatInt___isoc99_fscanf, 276 StatInt_on_exit, 277 StatInt___cxa_atexit, 278 StatInt_localtime, 279 StatInt_localtime_r, 280 StatInt_gmtime, 281 StatInt_gmtime_r, 282 StatInt_ctime, 283 StatInt_ctime_r, 284 StatInt_asctime, 285 StatInt_asctime_r, 286 StatInt_frexp, 287 StatInt_frexpf, 288 StatInt_frexpl, 289 StatInt_getpwnam, 290 StatInt_getpwuid, 291 StatInt_getgrnam, 292 StatInt_getgrgid, 293 StatInt_getpwnam_r, 294 StatInt_getpwuid_r, 295 StatInt_getgrnam_r, 296 StatInt_getgrgid_r, 297 StatInt_clock_getres, 298 StatInt_clock_gettime, 299 StatInt_clock_settime, 300 StatInt_getitimer, 301 StatInt_setitimer, 302 StatInt_time, 303 StatInt_glob, 304 StatInt_glob64, 305 StatInt_wait, 306 StatInt_waitid, 307 StatInt_waitpid, 308 StatInt_wait3, 309 StatInt_wait4, 310 StatInt_inet_ntop, 311 StatInt_inet_pton, 312 StatInt_inet_aton, 313 StatInt_getaddrinfo, 314 StatInt_getnameinfo, 315 StatInt_getsockname, 316 StatInt_gethostent, 317 StatInt_gethostbyname, 318 StatInt_gethostbyname2, 319 StatInt_gethostbyaddr, 320 StatInt_gethostent_r, 321 StatInt_gethostbyname_r, 322 StatInt_gethostbyname2_r, 323 StatInt_gethostbyaddr_r, 324 StatInt_getsockopt, 325 StatInt_modf, 326 StatInt_modff, 327 StatInt_modfl, 328 StatInt_getpeername, 329 StatInt_ioctl, 330 StatInt_sysinfo, 331 StatInt_readdir, 332 StatInt_readdir64, 333 StatInt_readdir_r, 334 StatInt_readdir64_r, 335 StatInt_ptrace, 336 StatInt_setlocale, 337 StatInt_getcwd, 338 StatInt_get_current_dir_name, 339 StatInt_strtoimax, 340 StatInt_strtoumax, 341 StatInt_mbstowcs, 342 StatInt_mbsrtowcs, 343 StatInt_mbsnrtowcs, 344 StatInt_wcstombs, 345 StatInt_wcsrtombs, 346 StatInt_wcsnrtombs, 347 StatInt_tcgetattr, 348 StatInt_realpath, 349 StatInt_canonicalize_file_name, 350 StatInt_confstr, 351 StatInt_sched_getaffinity, 352 353 // Dynamic annotations. 354 StatAnnotation, 355 StatAnnotateHappensBefore, 356 StatAnnotateHappensAfter, 357 StatAnnotateCondVarSignal, 358 StatAnnotateCondVarSignalAll, 359 StatAnnotateMutexIsNotPHB, 360 StatAnnotateCondVarWait, 361 StatAnnotateRWLockCreate, 362 StatAnnotateRWLockCreateStatic, 363 StatAnnotateRWLockDestroy, 364 StatAnnotateRWLockAcquired, 365 StatAnnotateRWLockReleased, 366 StatAnnotateTraceMemory, 367 StatAnnotateFlushState, 368 StatAnnotateNewMemory, 369 StatAnnotateNoOp, 370 StatAnnotateFlushExpectedRaces, 371 StatAnnotateEnableRaceDetection, 372 StatAnnotateMutexIsUsedAsCondVar, 373 StatAnnotatePCQGet, 374 StatAnnotatePCQPut, 375 StatAnnotatePCQDestroy, 376 StatAnnotatePCQCreate, 377 StatAnnotateExpectRace, 378 StatAnnotateBenignRaceSized, 379 StatAnnotateBenignRace, 380 StatAnnotateIgnoreReadsBegin, 381 StatAnnotateIgnoreReadsEnd, 382 StatAnnotateIgnoreWritesBegin, 383 StatAnnotateIgnoreWritesEnd, 384 StatAnnotatePublishMemoryRange, 385 StatAnnotateUnpublishMemoryRange, 386 StatAnnotateThreadName, 387 388 // Internal mutex contentionz. 389 StatMtxTotal, 390 StatMtxTrace, 391 StatMtxThreads, 392 StatMtxReport, 393 StatMtxSyncVar, 394 StatMtxSyncTab, 395 StatMtxSlab, 396 StatMtxAnnotations, 397 StatMtxAtExit, 398 StatMtxMBlock, 399 StatMtxJavaMBlock, 400 StatMtxFD, 401 402 // This must be the last. 403 StatCnt 404 }; 405 406 } // namespace __tsan 407 408 #endif // TSAN_STAT_H 409