tsan_stat.cc revision fae2bff6de8be5a319ca17fd713731ce8a887476
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//===-- tsan_stat.cc ------------------------------------------------------===// 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The LLVM Compiler Infrastructure 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This file is distributed under the University of Illinois Open Source 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// License. See LICENSE.TXT for details. 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//===----------------------------------------------------------------------===// 9c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// 10ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch// This file is a part of ThreadSanitizer (TSan), a race detector. 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//===----------------------------------------------------------------------===// 135c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu#include "tsan_stat.h" 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "tsan_rtl.h" 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace __tsan { 172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)void StatAggregate(u64 *dst, u64 *src) { 192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) if (!kCollectStats) 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return; 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) for (int i = 0; i < StatCnt; i++) 222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) dst[i] += src[i]; 232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)void StatOutput(u64 *stat) { 265c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu if (!kCollectStats) 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return; 282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) stat[StatShadowNonZero] = stat[StatShadowProcessed] - stat[StatShadowZero]; 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) static const char *name[StatCnt] = {}; 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatMop] = "Memory accesses "; 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatMopRead] = " Including reads "; 34c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatMopWrite] = " writes "; 35c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatMop1] = " Including size 1 "; 36c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatMop2] = " size 2 "; 37c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatMop4] = " size 4 "; 38c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatMop8] = " size 8 "; 39c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatMopSame] = " Including same "; 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatMopRange] = " Including range "; 412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatMopRodata] = " Including .rodata "; 422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatMopRangeRodata] = " Including .rodata range "; 432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatShadowProcessed] = "Shadow processed "; 442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatShadowZero] = " Including empty "; 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatShadowNonZero] = " Including non empty "; 46c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatShadowSameSize] = " Including same size "; 47c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatShadowIntersect] = " intersect "; 48c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatShadowNotIntersect] = " not intersect "; 49c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatShadowSameThread] = " Including same thread "; 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatShadowAnotherThread] = " another thread "; 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatShadowReplace] = " Including evicted "; 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatFuncEnter] = "Function entries "; 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatFuncExit] = "Function exits "; 555c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu name[StatEvents] = "Events collected "; 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 57f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) name[StatThreadCreate] = "Total threads created "; 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatThreadFinish] = " threads finished "; 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatThreadReuse] = " threads reused "; 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatThreadMaxTid] = " max tid "; 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatThreadMaxAlive] = " max alive threads "; 622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatMutexCreate] = "Mutexes created "; 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatMutexDestroy] = " destroyed "; 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatMutexLock] = " lock "; 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatMutexUnlock] = " unlock "; 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatMutexRecLock] = " recursive lock "; 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatMutexRecUnlock] = " recursive unlock "; 692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatMutexReadLock] = " read lock "; 702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatMutexReadUnlock] = " read unlock "; 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatSyncCreated] = "Sync objects created "; 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatSyncDestroyed] = " destroyed "; 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatSyncAcquire] = " acquired "; 755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatSyncRelease] = " released "; 765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomic] = "Atomic operations "; 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomicLoad] = " Including load "; 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomicStore] = " store "; 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomicExchange] = " exchange "; 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomicFetchAdd] = " fetch_add "; 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomicFetchSub] = " fetch_sub "; 83f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) name[StatAtomicFetchAnd] = " fetch_and "; 84f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) name[StatAtomicFetchOr] = " fetch_or "; 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomicFetchXor] = " fetch_xor "; 862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatAtomicFetchNand] = " fetch_nand "; 872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatAtomicCAS] = " compare_exchange "; 882a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) name[StatAtomicFence] = " fence "; 89c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatAtomicRelaxed] = " Including relaxed "; 90c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatAtomicConsume] = " consume "; 91c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) name[StatAtomicAcquire] = " acquire "; 925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomicRelease] = " release "; 935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomicAcq_Rel] = " acq_rel "; 945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomicSeq_Cst] = " seq_cst "; 955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomic1] = " Including size 1 "; 965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomic2] = " size 2 "; 975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) name[StatAtomic4] = " size 4 "; 98 name[StatAtomic8] = " size 8 "; 99 name[StatAtomic16] = " size 16 "; 100 101 name[StatInterceptor] = "Interceptors "; 102 name[StatInt_longjmp] = " longjmp "; 103 name[StatInt_siglongjmp] = " siglongjmp "; 104 name[StatInt_malloc] = " malloc "; 105 name[StatInt___libc_memalign] = " __libc_memalign "; 106 name[StatInt_calloc] = " calloc "; 107 name[StatInt_realloc] = " realloc "; 108 name[StatInt_free] = " free "; 109 name[StatInt_cfree] = " cfree "; 110 name[StatInt_malloc_usable_size] = " malloc_usable_size "; 111 name[StatInt_mmap] = " mmap "; 112 name[StatInt_mmap64] = " mmap64 "; 113 name[StatInt_munmap] = " munmap "; 114 name[StatInt_memalign] = " memalign "; 115 name[StatInt_valloc] = " valloc "; 116 name[StatInt_pvalloc] = " pvalloc "; 117 name[StatInt_posix_memalign] = " posix_memalign "; 118 name[StatInt__Znwm] = " _Znwm "; 119 name[StatInt__ZnwmRKSt9nothrow_t] = " _ZnwmRKSt9nothrow_t "; 120 name[StatInt__Znam] = " _Znam "; 121 name[StatInt__ZnamRKSt9nothrow_t] = " _ZnamRKSt9nothrow_t "; 122 name[StatInt__ZdlPv] = " _ZdlPv "; 123 name[StatInt__ZdlPvRKSt9nothrow_t] = " _ZdlPvRKSt9nothrow_t "; 124 name[StatInt__ZdaPv] = " _ZdaPv "; 125 name[StatInt__ZdaPvRKSt9nothrow_t] = " _ZdaPvRKSt9nothrow_t "; 126 name[StatInt_strlen] = " strlen "; 127 name[StatInt_memset] = " memset "; 128 name[StatInt_memcpy] = " memcpy "; 129 name[StatInt_strcmp] = " strcmp "; 130 name[StatInt_memchr] = " memchr "; 131 name[StatInt_memrchr] = " memrchr "; 132 name[StatInt_memmove] = " memmove "; 133 name[StatInt_memcmp] = " memcmp "; 134 name[StatInt_strchr] = " strchr "; 135 name[StatInt_strchrnul] = " strchrnul "; 136 name[StatInt_strrchr] = " strrchr "; 137 name[StatInt_strncmp] = " strncmp "; 138 name[StatInt_strcpy] = " strcpy "; 139 name[StatInt_strncpy] = " strncpy "; 140 name[StatInt_strstr] = " strstr "; 141 name[StatInt_strcasecmp] = " strcasecmp "; 142 name[StatInt_strncasecmp] = " strncasecmp "; 143 name[StatInt_atexit] = " atexit "; 144 name[StatInt___cxa_guard_acquire] = " __cxa_guard_acquire "; 145 name[StatInt___cxa_guard_release] = " __cxa_guard_release "; 146 name[StatInt___cxa_guard_abort] = " __cxa_guard_abort "; 147 name[StatInt_pthread_create] = " pthread_create "; 148 name[StatInt_pthread_join] = " pthread_join "; 149 name[StatInt_pthread_detach] = " pthread_detach "; 150 name[StatInt_pthread_mutex_init] = " pthread_mutex_init "; 151 name[StatInt_pthread_mutex_destroy] = " pthread_mutex_destroy "; 152 name[StatInt_pthread_mutex_lock] = " pthread_mutex_lock "; 153 name[StatInt_pthread_mutex_trylock] = " pthread_mutex_trylock "; 154 name[StatInt_pthread_mutex_timedlock] = " pthread_mutex_timedlock "; 155 name[StatInt_pthread_mutex_unlock] = " pthread_mutex_unlock "; 156 name[StatInt_pthread_spin_init] = " pthread_spin_init "; 157 name[StatInt_pthread_spin_destroy] = " pthread_spin_destroy "; 158 name[StatInt_pthread_spin_lock] = " pthread_spin_lock "; 159 name[StatInt_pthread_spin_trylock] = " pthread_spin_trylock "; 160 name[StatInt_pthread_spin_unlock] = " pthread_spin_unlock "; 161 name[StatInt_pthread_rwlock_init] = " pthread_rwlock_init "; 162 name[StatInt_pthread_rwlock_destroy] = " pthread_rwlock_destroy "; 163 name[StatInt_pthread_rwlock_rdlock] = " pthread_rwlock_rdlock "; 164 name[StatInt_pthread_rwlock_tryrdlock] = " pthread_rwlock_tryrdlock "; 165 name[StatInt_pthread_rwlock_timedrdlock] 166 = " pthread_rwlock_timedrdlock "; 167 name[StatInt_pthread_rwlock_wrlock] = " pthread_rwlock_wrlock "; 168 name[StatInt_pthread_rwlock_trywrlock] = " pthread_rwlock_trywrlock "; 169 name[StatInt_pthread_rwlock_timedwrlock] 170 = " pthread_rwlock_timedwrlock "; 171 name[StatInt_pthread_rwlock_unlock] = " pthread_rwlock_unlock "; 172 name[StatInt_pthread_cond_init] = " pthread_cond_init "; 173 name[StatInt_pthread_cond_destroy] = " pthread_cond_destroy "; 174 name[StatInt_pthread_cond_signal] = " pthread_cond_signal "; 175 name[StatInt_pthread_cond_broadcast] = " pthread_cond_broadcast "; 176 name[StatInt_pthread_cond_wait] = " pthread_cond_wait "; 177 name[StatInt_pthread_cond_timedwait] = " pthread_cond_timedwait "; 178 name[StatInt_pthread_barrier_init] = " pthread_barrier_init "; 179 name[StatInt_pthread_barrier_destroy] = " pthread_barrier_destroy "; 180 name[StatInt_pthread_barrier_wait] = " pthread_barrier_wait "; 181 name[StatInt_pthread_once] = " pthread_once "; 182 name[StatInt_pthread_getschedparam] = " pthread_getschedparam "; 183 name[StatInt_sem_init] = " sem_init "; 184 name[StatInt_sem_destroy] = " sem_destroy "; 185 name[StatInt_sem_wait] = " sem_wait "; 186 name[StatInt_sem_trywait] = " sem_trywait "; 187 name[StatInt_sem_timedwait] = " sem_timedwait "; 188 name[StatInt_sem_post] = " sem_post "; 189 name[StatInt_sem_getvalue] = " sem_getvalue "; 190 name[StatInt_stat] = " stat "; 191 name[StatInt___xstat] = " __xstat "; 192 name[StatInt_stat64] = " stat64 "; 193 name[StatInt___xstat64] = " __xstat64 "; 194 name[StatInt_lstat] = " lstat "; 195 name[StatInt___lxstat] = " __lxstat "; 196 name[StatInt_lstat64] = " lstat64 "; 197 name[StatInt___lxstat64] = " __lxstat64 "; 198 name[StatInt_fstat] = " fstat "; 199 name[StatInt___fxstat] = " __fxstat "; 200 name[StatInt_fstat64] = " fstat64 "; 201 name[StatInt___fxstat64] = " __fxstat64 "; 202 name[StatInt_open] = " open "; 203 name[StatInt_open64] = " open64 "; 204 name[StatInt_creat] = " creat "; 205 name[StatInt_creat64] = " creat64 "; 206 name[StatInt_dup] = " dup "; 207 name[StatInt_dup2] = " dup2 "; 208 name[StatInt_dup3] = " dup3 "; 209 name[StatInt_eventfd] = " eventfd "; 210 name[StatInt_signalfd] = " signalfd "; 211 name[StatInt_inotify_init] = " inotify_init "; 212 name[StatInt_inotify_init1] = " inotify_init1 "; 213 name[StatInt_socket] = " socket "; 214 name[StatInt_socketpair] = " socketpair "; 215 name[StatInt_connect] = " connect "; 216 name[StatInt_bind] = " bind "; 217 name[StatInt_listen] = " listen "; 218 name[StatInt_accept] = " accept "; 219 name[StatInt_accept4] = " accept4 "; 220 name[StatInt_epoll_create] = " epoll_create "; 221 name[StatInt_epoll_create1] = " epoll_create1 "; 222 name[StatInt_close] = " close "; 223 name[StatInt___close] = " __close "; 224 name[StatInt___res_iclose] = " __res_iclose "; 225 name[StatInt_pipe] = " pipe "; 226 name[StatInt_pipe2] = " pipe2 "; 227 name[StatInt_read] = " read "; 228 name[StatInt_prctl] = " prctl "; 229 name[StatInt_pread] = " pread "; 230 name[StatInt_pread64] = " pread64 "; 231 name[StatInt_readv] = " readv "; 232 name[StatInt_preadv] = " preadv "; 233 name[StatInt_preadv64] = " preadv64 "; 234 name[StatInt_write] = " write "; 235 name[StatInt_pwrite] = " pwrite "; 236 name[StatInt_pwrite64] = " pwrite64 "; 237 name[StatInt_writev] = " writev "; 238 name[StatInt_pwritev] = " pwritev "; 239 name[StatInt_pwritev64] = " pwritev64 "; 240 name[StatInt_send] = " send "; 241 name[StatInt_sendmsg] = " sendmsg "; 242 name[StatInt_recv] = " recv "; 243 name[StatInt_recvmsg] = " recvmsg "; 244 name[StatInt_unlink] = " unlink "; 245 name[StatInt_fopen] = " fopen "; 246 name[StatInt_freopen] = " freopen "; 247 name[StatInt_fclose] = " fclose "; 248 name[StatInt_fread] = " fread "; 249 name[StatInt_fwrite] = " fwrite "; 250 name[StatInt_fflush] = " fflush "; 251 name[StatInt_abort] = " abort "; 252 name[StatInt_puts] = " puts "; 253 name[StatInt_rmdir] = " rmdir "; 254 name[StatInt_opendir] = " opendir "; 255 name[StatInt_epoll_ctl] = " epoll_ctl "; 256 name[StatInt_epoll_wait] = " epoll_wait "; 257 name[StatInt_poll] = " poll "; 258 name[StatInt_ppoll] = " ppoll "; 259 name[StatInt_sigaction] = " sigaction "; 260 name[StatInt_signal] = " signal "; 261 name[StatInt_sigsuspend] = " sigsuspend "; 262 name[StatInt_raise] = " raise "; 263 name[StatInt_kill] = " kill "; 264 name[StatInt_pthread_kill] = " pthread_kill "; 265 name[StatInt_sleep] = " sleep "; 266 name[StatInt_usleep] = " usleep "; 267 name[StatInt_nanosleep] = " nanosleep "; 268 name[StatInt_gettimeofday] = " gettimeofday "; 269 name[StatInt_fork] = " fork "; 270 name[StatInt_vscanf] = " vscanf "; 271 name[StatInt_vsscanf] = " vsscanf "; 272 name[StatInt_vfscanf] = " vfscanf "; 273 name[StatInt_scanf] = " scanf "; 274 name[StatInt_sscanf] = " sscanf "; 275 name[StatInt_fscanf] = " fscanf "; 276 name[StatInt___isoc99_vscanf] = " vscanf "; 277 name[StatInt___isoc99_vsscanf] = " vsscanf "; 278 name[StatInt___isoc99_vfscanf] = " vfscanf "; 279 name[StatInt___isoc99_scanf] = " scanf "; 280 name[StatInt___isoc99_sscanf] = " sscanf "; 281 name[StatInt___isoc99_fscanf] = " fscanf "; 282 name[StatInt_on_exit] = " on_exit "; 283 name[StatInt___cxa_atexit] = " __cxa_atexit "; 284 name[StatInt_localtime] = " localtime "; 285 name[StatInt_localtime_r] = " localtime_r "; 286 name[StatInt_gmtime] = " gmtime "; 287 name[StatInt_gmtime_r] = " gmtime_r "; 288 name[StatInt_ctime] = " ctime "; 289 name[StatInt_ctime_r] = " ctime_r "; 290 name[StatInt_asctime] = " asctime "; 291 name[StatInt_asctime_r] = " asctime_r "; 292 name[StatInt_frexp] = " frexp "; 293 name[StatInt_frexpf] = " frexpf "; 294 name[StatInt_frexpl] = " frexpl "; 295 name[StatInt_getpwnam] = " getpwnam "; 296 name[StatInt_getpwuid] = " getpwuid "; 297 name[StatInt_getgrnam] = " getgrnam "; 298 name[StatInt_getgrgid] = " getgrgid "; 299 name[StatInt_getpwnam_r] = " getpwnam_r "; 300 name[StatInt_getpwuid_r] = " getpwuid_r "; 301 name[StatInt_getgrnam_r] = " getgrnam_r "; 302 name[StatInt_getgrgid_r] = " getgrgid_r "; 303 name[StatInt_clock_getres] = " clock_getres "; 304 name[StatInt_clock_gettime] = " clock_gettime "; 305 name[StatInt_clock_settime] = " clock_settime "; 306 name[StatInt_getitimer] = " getitimer "; 307 name[StatInt_setitimer] = " setitimer "; 308 name[StatInt_time] = " time "; 309 name[StatInt_glob] = " glob "; 310 name[StatInt_glob64] = " glob64 "; 311 name[StatInt_wait] = " wait "; 312 name[StatInt_waitid] = " waitid "; 313 name[StatInt_waitpid] = " waitpid "; 314 name[StatInt_wait3] = " wait3 "; 315 name[StatInt_wait4] = " wait4 "; 316 name[StatInt_inet_ntop] = " inet_ntop "; 317 name[StatInt_inet_pton] = " inet_pton "; 318 name[StatInt_inet_aton] = " inet_aton "; 319 name[StatInt_getaddrinfo] = " getaddrinfo "; 320 name[StatInt_getnameinfo] = " getnameinfo "; 321 name[StatInt_getsockname] = " getsockname "; 322 name[StatInt_gethostent] = " gethostent "; 323 name[StatInt_gethostbyname] = " gethostbyname "; 324 name[StatInt_gethostbyname2] = " gethostbyname2 "; 325 name[StatInt_gethostbyaddr] = " gethostbyaddr "; 326 name[StatInt_gethostent_r] = " gethostent_r "; 327 name[StatInt_gethostbyname_r] = " gethostbyname_r "; 328 name[StatInt_gethostbyname2_r] = " gethostbyname2_r "; 329 name[StatInt_gethostbyaddr_r] = " gethostbyaddr_r "; 330 name[StatInt_getsockopt] = " getsockopt "; 331 name[StatInt_modf] = " modf "; 332 name[StatInt_modff] = " modff "; 333 name[StatInt_modfl] = " modfl "; 334 name[StatInt_getpeername] = " getpeername "; 335 name[StatInt_ioctl] = " ioctl "; 336 name[StatInt_sysinfo] = " sysinfo "; 337 name[StatInt_readdir] = " readdir "; 338 name[StatInt_readdir64] = " readdir64 "; 339 name[StatInt_readdir_r] = " readdir_r "; 340 name[StatInt_readdir64_r] = " readdir64_r "; 341 name[StatInt_ptrace] = " ptrace "; 342 name[StatInt_setlocale] = " setlocale "; 343 name[StatInt_getcwd] = " getcwd "; 344 name[StatInt_get_current_dir_name] = " get_current_dir_name "; 345 name[StatInt_strtoimax] = " strtoimax "; 346 name[StatInt_strtoumax] = " strtoumax "; 347 name[StatInt_mbstowcs] = " mbstowcs "; 348 name[StatInt_mbsrtowcs] = " mbsrtowcs "; 349 name[StatInt_mbsnrtowcs] = " mbsnrtowcs "; 350 name[StatInt_wcstombs] = " wcstombs "; 351 name[StatInt_wcsrtombs] = " wcsrtombs "; 352 name[StatInt_wcsnrtombs] = " wcsnrtombs "; 353 name[StatInt_tcgetattr] = " tcgetattr "; 354 name[StatInt_realpath] = " realpath "; 355 name[StatInt_canonicalize_file_name] = " canonicalize_file_name "; 356 name[StatInt_confstr] = " confstr "; 357 name[StatInt_sched_getaffinity] = " sched_getaffinity "; 358 name[StatInt_strerror] = " strerror "; 359 name[StatInt_strerror_r] = " strerror_r "; 360 name[StatInt_scandir] = " scandir "; 361 name[StatInt_scandir64] = " scandir64 "; 362 name[StatInt_getgroups] = " getgroups "; 363 364 name[StatAnnotation] = "Dynamic annotations "; 365 name[StatAnnotateHappensBefore] = " HappensBefore "; 366 name[StatAnnotateHappensAfter] = " HappensAfter "; 367 name[StatAnnotateCondVarSignal] = " CondVarSignal "; 368 name[StatAnnotateCondVarSignalAll] = " CondVarSignalAll "; 369 name[StatAnnotateMutexIsNotPHB] = " MutexIsNotPHB "; 370 name[StatAnnotateCondVarWait] = " CondVarWait "; 371 name[StatAnnotateRWLockCreate] = " RWLockCreate "; 372 name[StatAnnotateRWLockCreateStatic] = " StatAnnotateRWLockCreateStatic "; 373 name[StatAnnotateRWLockDestroy] = " RWLockDestroy "; 374 name[StatAnnotateRWLockAcquired] = " RWLockAcquired "; 375 name[StatAnnotateRWLockReleased] = " RWLockReleased "; 376 name[StatAnnotateTraceMemory] = " TraceMemory "; 377 name[StatAnnotateFlushState] = " FlushState "; 378 name[StatAnnotateNewMemory] = " NewMemory "; 379 name[StatAnnotateNoOp] = " NoOp "; 380 name[StatAnnotateFlushExpectedRaces] = " FlushExpectedRaces "; 381 name[StatAnnotateEnableRaceDetection] = " EnableRaceDetection "; 382 name[StatAnnotateMutexIsUsedAsCondVar] = " MutexIsUsedAsCondVar "; 383 name[StatAnnotatePCQGet] = " PCQGet "; 384 name[StatAnnotatePCQPut] = " PCQPut "; 385 name[StatAnnotatePCQDestroy] = " PCQDestroy "; 386 name[StatAnnotatePCQCreate] = " PCQCreate "; 387 name[StatAnnotateExpectRace] = " ExpectRace "; 388 name[StatAnnotateBenignRaceSized] = " BenignRaceSized "; 389 name[StatAnnotateBenignRace] = " BenignRace "; 390 name[StatAnnotateIgnoreReadsBegin] = " IgnoreReadsBegin "; 391 name[StatAnnotateIgnoreReadsEnd] = " IgnoreReadsEnd "; 392 name[StatAnnotateIgnoreWritesBegin] = " IgnoreWritesBegin "; 393 name[StatAnnotateIgnoreWritesEnd] = " IgnoreWritesEnd "; 394 name[StatAnnotatePublishMemoryRange] = " PublishMemoryRange "; 395 name[StatAnnotateUnpublishMemoryRange] = " UnpublishMemoryRange "; 396 name[StatAnnotateThreadName] = " ThreadName "; 397 398 name[StatMtxTotal] = "Contentionz "; 399 name[StatMtxTrace] = " Trace "; 400 name[StatMtxThreads] = " Threads "; 401 name[StatMtxReport] = " Report "; 402 name[StatMtxSyncVar] = " SyncVar "; 403 name[StatMtxSyncTab] = " SyncTab "; 404 name[StatMtxSlab] = " Slab "; 405 name[StatMtxAtExit] = " Atexit "; 406 name[StatMtxAnnotations] = " Annotations "; 407 name[StatMtxMBlock] = " MBlock "; 408 name[StatMtxJavaMBlock] = " JavaMBlock "; 409 name[StatMtxFD] = " FD "; 410 411 Printf("Statistics:\n"); 412 for (int i = 0; i < StatCnt; i++) 413 Printf("%s: %zu\n", name[i], (uptr)stat[i]); 414} 415 416} // namespace __tsan 417