tsan_stat.h revision b916e6a9b3efa4907b70a2dcd418c76b044171e7
1ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org//===-- tsan_stat.h ---------------------------------------------*- C++ -*-===// 23484964a86451e86dcf04be9bd8c0d76ee04f081rossberg@chromium.org// 33484964a86451e86dcf04be9bd8c0d76ee04f081rossberg@chromium.org// The LLVM Compiler Infrastructure 4ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org// 5ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org// This file is distributed under the University of Illinois Open Source 6ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org// License. See LICENSE.TXT for details. 71e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org// 81e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org//===----------------------------------------------------------------------===// 9ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org// 10ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org// This file is a part of ThreadSanitizer (TSan), a race detector. 11ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org// 12ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org//===----------------------------------------------------------------------===// 13ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org 14ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org#ifndef TSAN_STAT_H 15ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org#define TSAN_STAT_H 16ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org 17ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.orgnamespace __tsan { 18ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org 19ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.orgenum StatType { 20ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org // Memory access processing related stuff. 21ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMop, 22ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMopRead, 23ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMopWrite, 241e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org StatMop1, // These must be consequtive. 25ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMop2, 26ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMop4, 27ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMop8, 28ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMopSame, 29ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMopRange, 30ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMopRodata, 31ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMopRangeRodata, 32ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatShadowProcessed, 33ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatShadowZero, 34ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatShadowNonZero, // Derived. 35ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatShadowSameSize, 36ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatShadowIntersect, 37ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatShadowNotIntersect, 38ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatShadowSameThread, 39ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatShadowAnotherThread, 40ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatShadowReplace, 41ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org 42ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org // Func processing. 43ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatFuncEnter, 44ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatFuncExit, 45ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org 46ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org // Trace processing. 47ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatEvents, 48ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org 49ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org // Threads. 50ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatThreadCreate, 51ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatThreadFinish, 52ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatThreadReuse, 53ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatThreadMaxTid, 541e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org StatThreadMaxAlive, 55ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org 56ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org // Mutexes. 57ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMutexCreate, 58ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMutexDestroy, 59ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMutexLock, 60ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMutexUnlock, 611e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org StatMutexRecLock, 62ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMutexRecUnlock, 63ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMutexReadLock, 64ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatMutexReadUnlock, 65ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org 66ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org // Synchronization. 67ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatSyncCreated, 68ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatSyncDestroyed, 69ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatSyncAcquire, 70ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatSyncRelease, 711e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org 72ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org // Atomics. 73ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomic, 74ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicLoad, 75ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicStore, 761e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org StatAtomicExchange, 77ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicFetchAdd, 78ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicFetchSub, 79ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicFetchAnd, 80ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicFetchOr, 81ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicFetchXor, 82ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicFetchNand, 83ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicCAS, 84ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicFence, 85ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicRelaxed, 861e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org StatAtomicConsume, 87ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicAcquire, 88ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicRelease, 89ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicAcq_Rel, 90ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomicSeq_Cst, 911e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org StatAtomic1, 92ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomic2, 93ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomic4, 94ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatAtomic8, 951e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org StatAtomic16, 96ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org 97ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org // Interceptors. 98ca2f2040e0e1a10df95bec18e69499f85f4c1316machenbach@chromium.org StatInterceptor, 991e2d50cf3d94ff48285da107b7a9da1ad0fc873dmachenbach@chromium.org 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_getaddrinfo, 312 StatInt_getsockname, 313 StatInt_gethostent, 314 StatInt_gethostbyname, 315 StatInt_gethostbyname2, 316 StatInt_gethostbyaddr, 317 StatInt_gethostent_r, 318 StatInt_gethostbyname_r, 319 StatInt_gethostbyname2_r, 320 StatInt_gethostbyaddr_r, 321 StatInt_getsockopt, 322 StatInt_modf, 323 StatInt_modff, 324 StatInt_modfl, 325 StatInt_getpeername, 326 StatInt_ioctl, 327 328 // Dynamic annotations. 329 StatAnnotation, 330 StatAnnotateHappensBefore, 331 StatAnnotateHappensAfter, 332 StatAnnotateCondVarSignal, 333 StatAnnotateCondVarSignalAll, 334 StatAnnotateMutexIsNotPHB, 335 StatAnnotateCondVarWait, 336 StatAnnotateRWLockCreate, 337 StatAnnotateRWLockCreateStatic, 338 StatAnnotateRWLockDestroy, 339 StatAnnotateRWLockAcquired, 340 StatAnnotateRWLockReleased, 341 StatAnnotateTraceMemory, 342 StatAnnotateFlushState, 343 StatAnnotateNewMemory, 344 StatAnnotateNoOp, 345 StatAnnotateFlushExpectedRaces, 346 StatAnnotateEnableRaceDetection, 347 StatAnnotateMutexIsUsedAsCondVar, 348 StatAnnotatePCQGet, 349 StatAnnotatePCQPut, 350 StatAnnotatePCQDestroy, 351 StatAnnotatePCQCreate, 352 StatAnnotateExpectRace, 353 StatAnnotateBenignRaceSized, 354 StatAnnotateBenignRace, 355 StatAnnotateIgnoreReadsBegin, 356 StatAnnotateIgnoreReadsEnd, 357 StatAnnotateIgnoreWritesBegin, 358 StatAnnotateIgnoreWritesEnd, 359 StatAnnotatePublishMemoryRange, 360 StatAnnotateUnpublishMemoryRange, 361 StatAnnotateThreadName, 362 363 // Internal mutex contentionz. 364 StatMtxTotal, 365 StatMtxTrace, 366 StatMtxThreads, 367 StatMtxReport, 368 StatMtxSyncVar, 369 StatMtxSyncTab, 370 StatMtxSlab, 371 StatMtxAnnotations, 372 StatMtxAtExit, 373 StatMtxMBlock, 374 StatMtxJavaMBlock, 375 StatMtxFD, 376 377 // This must be the last. 378 StatCnt 379}; 380 381} // namespace __tsan 382 383#endif // TSAN_STAT_H 384